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)
Thu, Jul 25, 10:07 AM
Unknown Object (File)
Tue, Jul 23, 2:44 PM
Unknown Object (File)
Sat, Jul 20, 3:52 AM
Unknown Object (File)
Mon, Jul 8, 4:52 PM
Unknown Object (File)
Jun 27 2024, 12:33 AM
Unknown Object (File)
Jun 23 2024, 9:46 AM
Unknown Object (File)
Jun 22 2024, 10:54 PM
Unknown Object (File)
Jun 22 2024, 1:08 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.