Page MenuHomePhorge

[Python 3]rfc822 module has been removed
ClosedPublic

Authored by ghane on Mar 14 2022, 12:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 17, 9:17 AM
Unknown Object (File)
Sat, Apr 13, 12:15 PM
Unknown Object (File)
Sat, Apr 13, 11:01 AM
Unknown Object (File)
Fri, Apr 12, 9:46 PM
Unknown Object (File)
Sat, Apr 6, 1:34 PM
Unknown Object (File)
Sat, Mar 30, 12:34 PM
Unknown Object (File)
Tue, Mar 26, 1:47 AM
Unknown Object (File)
Mar 17 2024, 12:33 AM
Subscribers

Details

Summary

python 2.7 -3 ./kolab-cli.py -d 9 lm

DeprecationWarning: in 3.x, rfc822 has been removed in favor of the email package

Diff Detail

Repository
rP pykolab
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ghane created this revision.
sicherha subscribed.

The only rfc822 function used below is rfc822.parsedate(); according to https://docs.python.org/3.10/library/email.utils.html, its email counterpart is not not email.parsedate() but email.utils.parsedate().

Since the email.utils module is already available in Python 2.7, I suggest the following:

  • In line 22, change import rfc822 to import email.utils
  • In line 199, change the call to rfc822.parsedate() to email.utils.parsedate()
This revision now requires changes to proceed.Mar 15 2022, 12:10 AM

I'll just change line 22

import email.utils as rfc822

this keeps the history and intention of the code alive.

This revision is now accepted and ready to land.Mar 16 2022, 10:22 PM
This revision was automatically updated to reflect the committed changes.