Edgewall Software
Modify

Opened 17 months ago

Closed 12 months ago

Last modified 12 months ago

#13510 closed defect (fixed)

cgi, crypt and smtpd modules are deprecated since Python 3.11 and will be removed in Python 3.13

Reported by: Jun Omae Owned by:
Priority: normal Milestone: 1.6
Component: general Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
  • Use multipart module instead of deprecated cgi since Python 3.11 if the multipart available
API Changes:
  • Added trac.test.makeSuite to fix deprecated unittest.makeSuite since Python 3.11.
Internal Changes:
  • Use aiosmtpd instead of deprecated smtpd since Python 3.10 if aiosmtpd is available.

Description (last modified by Jun Omae)

trac/util/compat.py:25: DeprecationWarning: 'crypt' is deprecated and slated for removal in Python 3.13
  from crypt import crypt
trac/web/api.py:20: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
  import cgi
trac/tests/notification.py:22: DeprecationWarning: The asyncore module is deprecated and will be removed in Python 3.12. The recommended replacement is asyncio
  import asyncore
trac/tests/notification.py:27: DeprecationWarning: The smtpd module is deprecated and unmaintained and will be removed in Python 3.12.  Please see aiosmtpd (https://aiosmtpd.readthedocs.io/) for the recommended replacement.
  import smtpd
/usr/lib/python3.11/smtpd.py:97: DeprecationWarning: The asynchat module is deprecated and will be removed in Python 3.12. The recommended replacement is asyncio
  import asynchat
trac/tests/attachment.py:770: DeprecationWarning: unittest.makeSuite() is deprecated and will be removed in Python 3.13. Please use unittest.TestLoader.loadTestsFromTestCase() instead.
  suite.addTest(unittest.makeSuite(AttachmentTestCase))
...
$ git grep '\(import\|from\) *\<\(audioop\|cgi\|cgitb\|chunk\|crypt\|imghdr\|mailcap\|msilib\|nntplib\|nis\|ossaudiodev\|pipes\|smtpd\|sndhdr\|spwd\|sunau\|telnetlib\|uu\|xdrlib\)\>'
contrib/htpasswd.py:from trac.util.compat import crypt, wait_for_file_mtime_change
trac/tests/notification.py:import smtpd
trac/util/compat.py:    from crypt import crypt
trac/web/_fcgi.py:        import cgi
trac/web/api.py:import cgi
trac/web/auth.py:from trac.util.compat import crypt
trac/web/main.py:import cgi
trac/web/tests/auth.py:from trac.util.compat import crypt

Attachments (0)

Change History (11)

comment:1 by Jun Omae, 17 months ago

Description: modified (diff)
Summary: crypt module is deprecated since Python 3.11 and will be removed in Python 3.13cgi, crypt and smtpd modules are deprecated since Python 3.11 and will be removed in Python 3.13

comment:2 by Jun Omae, 17 months ago

Description: modified (diff)

comment:3 by Jun Omae, 17 months ago

trac/tests/attachment.py:770: DeprecationWarning: unittest.makeSuite() is deprecated and will be removed in Python 3.13. Please use unittest.TestLoader.loadTestsFromTestCase() instead.
  suite.addTest(unittest.makeSuite(AttachmentTestCase))

Proposed changes in [11b0fdb86/jomae.git] (jomae.git@trunk:t13510_make_suite).

in reply to:  3 ; comment:4 by Ryan J Ollos, 17 months ago

Replying to Jun Omae:

Proposed changes in [11b0fdb86/jomae.git] (jomae.git@trunk:t13510_make_suite).

Those changes look good. After rebasing on trunk I get no additional test failures (Python 3.11.1 with macOS) beyond the unrelated failures mentioned in comment:18:ticket:13402.

in reply to:  4 comment:5 by Jun Omae, 17 months ago

API Changes: modified (diff)

Replying to Ryan J Ollos:

Replying to Jun Omae:

Proposed changes in [11b0fdb86/jomae.git] (jomae.git@trunk:t13510_make_suite).

Those changes look good. After rebasing on trunk I get no additional test failures (Python 3.11.1 with macOS) beyond the unrelated failures mentioned in comment:18:ticket:13402.

Thanks for the reviewing! Committed in [17631].

in reply to:  description ; comment:6 by Jun Omae, 16 months ago

trac/tests/notification.py:22: DeprecationWarning: The asyncore module is deprecated and will be removed in Python 3.12. The recommended replacement is asyncio
  import asyncore
trac/tests/notification.py:27: DeprecationWarning: The smtpd module is deprecated and unmaintained and will be removed in Python 3.12.  Please see aiosmtpd (https://aiosmtpd.readthedocs.io/) for the recommended replacement.
  import smtpd
/usr/lib/python3.11/smtpd.py:97: DeprecationWarning: The asynchat module is deprecated and will be removed in Python 3.12. The recommended replacement is asyncio
  import asynchat

Proposed changes in [010ee5f2c/jomae.git] (jomae.git@t13510_aiosmtpd). After the changes, use aiosmtpd instead of smtpd if available.

Last edited 15 months ago by Jun Omae (previous) (diff)

in reply to:  description ; comment:7 by Jun Omae, 16 months ago

trac/web/api.py:20: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
  import cgi

Proposed changes in [463bd0b73/jomae.git] (jomae.git@t13510_cgi). After the changes, use multipart module instead of deprecated cgi module if available.

Last edited 15 months ago by Jun Omae (previous) (diff)

comment:8 by Jun Omae, 15 months ago

Milestone: 1.61.6.1

in reply to:  6 comment:9 by Jun Omae, 12 months ago

Internal Changes: modified (diff)

Replying to Jun Omae:

Proposed changes in [010ee5f2c/jomae.git] (jomae.git@t13510_aiosmtpd). After the changes, use aiosmtpd instead of smtpd if available.

Committed in [17701].

in reply to:  7 comment:10 by Jun Omae, 12 months ago

Release Notes: modified (diff)

Proposed changes in [463bd0b73/jomae.git] (jomae.git@t13510_cgi). After the changes, use multipart module instead of deprecated cgi module if available.

Committed in [17702].

in reply to:  description comment:11 by Jun Omae, 12 months ago

Milestone: 1.6.11.6
Resolution: fixed
Status: newclosed
trac/util/compat.py:25: DeprecationWarning: 'crypt' is deprecated and slated for removal in Python 3.13
  from crypt import crypt

Fixed in [17622].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) 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.