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

fix Python deprecations #335

Open
spaceone opened this issue Apr 3, 2024 · 3 comments
Open

fix Python deprecations #335

spaceone opened this issue Apr 3, 2024 · 3 comments

Comments

@spaceone
Copy link
Contributor

spaceone commented Apr 3, 2024

=============================== warnings summary ===============================
circuits/web/processors.py:2
  /home/runner/work/circuits/circuits/circuits/web/processors.py:2: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
    from cgi import parse_header
tests/web/test_servers.py:23
  /home/runner/work/circuits/circuits/tests/web/test_servers.py:23: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
    SSL_CONTEXT = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
tests/core/test_bridge.py::test
tests/node/test_node.py::test_return_value
  /opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/multiprocessing/popen_fork.py:66: DeprecationWarning: This process (pid=2001) is multi-threaded, use of fork() may lead to deadlocks in the child.
    self.pid = os.fork()
tests/web/test_expires.py::test
  /home/runner/work/circuits/circuits/tests/web/test_expires.py:26: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    diff = mktime(parsedate(expires)) - mktime(datetime.utcnow().timetuple())
tests/web/test_expires.py::test_nocache
  /home/runner/work/circuits/circuits/tests/web/test_expires.py:39: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    now = datetime.utcnow()
tests/web/test_jsonrpc.py::test
  /home/runner/work/circuits/circuits/tests/web/jsonrpclib.py:370: DeprecationWarning: urllib.parse.splittype() is deprecated as of 3.8, use urllib.parse.urlparse() instead
    utype, uri = splittype(uri)
tests/web/test_jsonrpc.py::test
  /home/runner/work/circuits/circuits/tests/web/jsonrpclib.py:373: DeprecationWarning: urllib.parse.splithost() is deprecated as of 3.8, use urllib.parse.urlparse() instead
    self.__host, self.__handler = splithost(uri)
tests/web/test_jsonrpc.py::test
  /home/runner/work/circuits/circuits/tests/web/jsonrpclib.py:236: DeprecationWarning: urllib.parse.splituser() is deprecated as of 3.8, use urllib.parse.urlparse() instead
    auth, host = splituser(host)
@jhulten
Copy link
Contributor

jhulten commented Apr 3, 2024

You planning on working through them all or do you want some help.

@spaceone
Copy link
Contributor Author

spaceone commented Apr 3, 2024

I appreciate any support :-)

@jhulten
Copy link
Contributor

jhulten commented Apr 3, 2024

I will take a swing at the jsonrpc ones. Just so we don't double up on work.

jhulten added a commit to jhulten/circuits that referenced this issue Apr 3, 2024
```
tests/web/test_jsonrpc.py::test
  /home/runner/work/circuits/circuits/tests/web/jsonrpclib.py:370: DeprecationWarning: urllib.parse.splittype() is deprecated as of 3.8, use urllib.parse.urlparse() instead
    utype, uri = splittype(uri)
tests/web/test_jsonrpc.py::test
  /home/runner/work/circuits/circuits/tests/web/jsonrpclib.py:373: DeprecationWarning: urllib.parse.splithost() is deprecated as of 3.8, use urllib.parse.urlparse() instead
    self.__host, self.__handler = splithost(uri)
tests/web/test_jsonrpc.py::test
  /home/runner/work/circuits/circuits/tests/web/jsonrpclib.py:236: DeprecationWarning: urllib.parse.splituser() is deprecated as of 3.8, use urllib.parse.urlparse() instead
    auth, host = splituser(host)
```

Replaces above uses with urllib.parse.urlparse and passed appropriate
elements from the named tuple it returns.

Refs circuits#335
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants