Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource and InsecureRequest warnings #2186

Open
chrisdel101 opened this issue Jan 10, 2025 · 0 comments
Open

Resource and InsecureRequest warnings #2186

chrisdel101 opened this issue Jan 10, 2025 · 0 comments
Labels

Comments

@chrisdel101
Copy link

Describe the bug
I'm getting these warnings in my terminal. It's overwhelming me.
While the first is from urllib3, I don't use this, so it's probably installed as a dependency.
Example:

C:\Users\me\.virtualenvs\arcgis-cloner-pO5T1BLr\Lib\site-packages\urllib3\connectionpool.py:1097: InsecureRequestWarning: Unverified HTTPS request is being made to host 'mysite.net'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
  warnings.warn(
C:\Users\me\.virtualenvs\arcgis-cloner-pO5T1BLr\Lib\site-packages\arcgis\gis\__init__.py:15445: ResourceWarning: unclosed file <_io.BufferedReader name='C:\\Users\\ME~1\\AppData\\Local\\Temp\\tmpum23pnn7\\f302f96a6e5f4cecafd488458ba4b585\\thumbnail.JPEG'>
C:\Users\me\.virtualenvs\arcgis-cloner-pO5T1BLr\Lib\site-packages\arcgis\gis\__init__.py:15445: ResourceWarning: unclosed file <_io.BufferedReader name='C:\\Users\\me~1\\AppData\\Local\\Temp\\tmp21k88qo4\\fda626ad6b25408aa57fedd664a1a345\\thumbnail.JPEG'>
  ret = self._portal.update_item(
ResourceWarning: Enable tracemalloc to get the object allocation traceback
C:\Users\me\.virtualenvs\arcgis-cloner-pO5T1BLr\Lib\site-packages\arcgis\gis\__init__.py:15445: ResourceWarning: unclosed file <_io.BufferedReader name='C:\\Users\\me~1\\AppData\\Local\\Temp\\tmpacghdceu\\183d8fe34b604f24b73eb697622c29e8\\thumbnail.JPEG'>
  ret = self._portal.update_item(
ResourceWarning: Enable tracemalloc to get the object allocation traceback
C:\Users\me\.virtualenvs\arcgis-cloner-pO5T1BLr\Lib\site-packages\arcgis\gis\__init__.py:15445: ResourceWarning: unclosed file <_io.BufferedReader name='C:\\Users\\me~1\\AppData\\Local\\Temp\\tmpbzaa29iy\\e2789e68f5a8449ea622f09a63b5178c\\thumbnail.JPEG'>

To Reproduce
I'm making lots of calls to the GIS module and also making many calls to the Rest API using requests. There is nothing specific I can pinpoint to where this occurs.
These are my imports. The only 3rd party (that requires is calling pip) is arcgis so it's likely coming from there.

import datetime
import json
import logging
import re
import urllib
import pdb
import sys
from collections.abc import MutableMapping
from arcgis.gis import GIS
from enum import Enum

I am getting tons of urllib3 warnings that seem unrelated to arcgis too. I've tried to silence all warnings. I DO seem to be able to silence urllib3 warnings not coming from arcgis like below. But arcgis related warnings still appear.
I'm using pipenv as a virtual environment. I wonder if urllib3 is related to that somehow? It's in the venv folder but not inside the arcgis folder.

C:\Users\me\.virtualenvs\arcgis-cloner-pO5T1BLr\Lib\site-packages\urllib3\connectionpool.py:1097: InsecureRequestWarning: Unverified HTTPS request is being made to host 'services3.arcgis.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
  warnings.warn(

Attemp to silence:

import urllib3
# https://stackoverflow.com/a/28002687/5972531
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant