Edgewall Software
Modify

Opened 8 months ago

Closed 8 months ago

#13749 closed defect (fixed)

Remove the ssl.wrap_socket() function, deprecated in Python 3.7

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 1.6.1
Component: web frontend/tracd Version: 1.6
Severity: normal Keywords: ssl
Cc: Branch:
Release Notes:

Use ssl.SSLContext.wrap_socket instead of ssl.wrap_socket removed in Python 3.12.

API Changes:
Internal Changes:

Description

https://docs.python.org/3/whatsnew/3.12.html#ssl

$ PYTHONPATH=. ~/venv/py312/bin/python -Wdefault trac/web/standalone.py \
>   -p 3000 --protocol=https \
>   --certfile=/etc/ssl/certs/ssl-cert-snakeoil.pem \
>   --keyfile=/etc/ssl/private/ssl-cert-snakeoil.key \
>   ~/var/trac/1.4-sqlite
/home/jun66j5/src/tracdev/git/trac/web/standalone.py:26: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
/home/jun66j5/venv/py312/lib/python3.12/site-packages/pkg_resources/__init__.py:2832: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
  declare_namespace(pkg)
/home/jun66j5/venv/py312/lib/python3.12/site-packages/passlib/utils/__init__.py:854: DeprecationWarning: 'crypt' is deprecated and slated for removal in Python 3.13
  from crypt import crypt as _crypt
Server starting in PID 1356756.
Serving on 0.0.0.0:3000 view at https://127.0.0.1:3000/
Using HTTP/1.1 protocol version
Traceback (most recent call last):
  File "/home/jun66j5/src/tracdev/git/trac/web/standalone.py", line 392, in <module>
    main()
  File "/home/jun66j5/src/tracdev/git/trac/web/standalone.py", line 381, in main
    serve()
  File "/home/jun66j5/src/tracdev/git/trac/web/standalone.py", line 344, in serve
    httpd.socket = ssl.wrap_socket(httpd.socket, server_side=True,
                   ^^^^^^^^^^^^^^^
AttributeError: module 'ssl' has no attribute 'wrap_socket'

Attachments (0)

Change History (1)

comment:1 by Jun Omae, 8 months ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Fixed in [17784] and merged in [17785].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.