Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix Python deprecations #335

@spaceone

Description

@spaceone
=============================== 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions