-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-92613: Deprecate other uuencode functionality per PEP 594 & document as such #92758
base: main
Are you sure you want to change the base?
Conversation
@warsaw , I've tagged you on behalf of the |
@warsaw @python/email-team Any chance you could take a look at this? To provide some more detail about the potential for a backward-compat impact of the Once the actual removal occurs, Doing a bit more research, a grep.app search for Furthermore, of those, nearly all are appear to be oriented toward processing new email, which is very unlikely to be receiving attachments encoded in a 1980s-vintage encoding—and in case they do, the uuencoded text will still be preserved, so they can just paste it into a uuencode decode website or program, which IIUC is exactly what people did back in the days when uuencode was still relevant; before MIME replaced it, there was no such thing as "attachments", and embedding uuencode data into MIME messages has always been non-standard. |
6a45435
to
9cc18b3
Compare
This invokes the use case I'm worried about. Processing new mail as you say shouldn't use this old encoding, but processing old emails in archives could be broken by removing this. This could happen in e.g. Mailman if you had really old archives, you wouldn't be able to parse their attachments. OTOH, maybe I'm worrying too much about that. @maxking or @msapiro can you chime in? |
The other thought is whether it's worth it to inline the uu functions in the email package, in the same way as was done for determining the subtype for audio and image data. It might be too much baggage to keep carrying around, even if made private. |
Ah. good point—in my grep.app searching, the great majority of the use cases I found were processing new (ish) email, as opposed to email archives where this could theoretically be a problem, but I didn't think about Mailman:
So, unless there's something I missed, it looks like Mailman is not affected—since it is a very specific code path that needs to be hit to even have the possibility to trigger the deprecated behavior. If there are other users, we should hopefully discover them during the >two year period when DeprecationWarnings will be issued. However, if you feel its best to inline the functionality (which we can always do at any point prior to the final removal, if it has significant real-world impact, I'd be happy to help with that. |
@warsaw wrote:
It seems to me that the only place where this might be an issue is in hyperkitty_import of an old mbox, but hyprerkitty_import does not use a compat32 policy. It retrieves messages as raw bytes from the mbox and parses them into a message object with |
So are we chopping this out in 3.11 (if we still can), taking it out in 3.12, or leaving it behind? |
I assume its too late for 3.11 now that rc1 is almost upon us (especially given how things have gone), so I imagine a push to 3.12 (with removal in 3.14) is the only practical solution. Per my discussions with @warsaw here and on Discord as well as the results of several rounds of analysis of existing code bases, the backward compat impact appears to be very minimal at best, and the deprecation period would give us time to inline the relevant code or revert specific parts of the change in case it was a significant enough real-world issue. Assuming we agree on moving forward, I can bump it to the 3.12 What's New instead and update the various bits that reference the versions accordingly. |
@CAM-Gerlach yep, it's too late for 3.11. |
9cc18b3
to
1c29ff2
Compare
I've pushed a commit updating the various deprecating warnings, documentation messages, NEWS item and What's New content to target 3.12 as the deprecation version and 3.14 as the removal version. |
acccff0
to
53141f5
Compare
I re-rebased this again to fix the merge conflict and update to the latest @brettcannon @warsaw would you like to review this, so we can start evaluating any potential impact of these deprecations as early as practical (if needed, I can undeprecate or revise the deprecation strategy here based on feedback, either before or after the 3.12 release). Thanks! |
c3a4a05
to
acc62ea
Compare
acc62ea
to
e4632af
Compare
Sorry for the force-push; in the last commit I accidentally committed several completely unrelated local test scripts that were untracked in my working tree, so I had to prune those out of the history. |
I consider this primarily an email team call at this point. |
See issue #100308 for a non-email use of uuencoding. This usage is for a newly generated file, and is a non-email example. |
While it doesn't necessarily capture proprietary-only uses, a grep.app search for the Also, for reference, a grep.app search for the already-deprecated If the functionality is still useful, you could consider maintaining a PyPI package with it, which would give you much more flexibility to fix issues like the one you mentioned, and deploy fixes and enhancements much more quickly than with a whole new Python feature version. I'd be willing to help advise you on what code would need to be moved, and how you might most easily structure it, as well as suggest migration advice so that existing use cases can move to it seamlessly with minimal or no changes. |
We need to decide on this PR and its parent issue because 3.12 release is approaching. |
All modules scheduled for removal by PEP 594 have been removed in Python 3.12 and Python 3.13. The last batch was done in #104773 especially the uu module. @CAM-Gerlach: Would you mind to solve the conflicts on your PR? |
The main branch is now Python 3.13. Honestly, IMO it's ok to keep this code a little bit longer, it has been there for maybe 30 years. 1 or 2 more Python releases is fine. At the same time, I'm also fine with deprecating it in Python 3.12 beta2, but you might ask to Release Manager to validate that. |
Oh. I wasn't aware that the email package was using the |
While the
|
That all should be updated to 3.13 -> 3.15 if we decide we want to do this.
I would, yeah, and update the various versions that need to be bumped again, but I'd like to hear at least a +0.5 from @warsaw or the @python/email-team before going ahead with all of it.
I thought it was policy to not introduce new deprecations during the beta period, but maybe I'm wrong here? IMO, if we're going to do this (which I still think we should), it would be best to push it to Python 3.13 given we want to give as much time as practical for users to report any issues which might cause a reconsideration of the various deprecations/planned removals (and conversely, makes a lot more comfortable going ahead with this now despite a few potential corner cases where this might still be used).
See the extensive discussion above—it's only actually ever used if a non-default value is passed to an optional parameter of one method of one class in the legacy email interface, and would only cause a non-fatal degradation in content for extremely old messages (uuencded attachments would not be decoded automatically). IMO, I'm not sure its worth just removing one of the two parallel methods just for that—is there a precedent? If there is significant usage, they will get a clear deprecation warning, and if it is an important-enough problem, we can just revert that part of the deprecation. However, if there isn't the risk tolerance for that, then it seems we may as well just leave both.
Yeah, that's something we looked carefully at, but Mailman, Hyperkitty, Postorios, and related mailing list tools had zero affected usages and of the few usages in the wild of that particular legacy method, only a very small number could even theoretically be affected, and all those we found were oriented toward processing new email rather than archives. And the worst that would happen is those non-standard "attachments" would be displayed as plain text and decoded manually, just like people used to have to do back in uuencode's day. And again, if this is a significant concern based on response to the deprecation warnings (and we could perhaps even roll out user-visible warnings if necessary), we could either provide clear guidance to putting the code on PyPI, postpone the removal, or un-deprecate that. |
Per #92613 , for the following functionality deprecated by PEP 594 (PEP-594) but not formally implemented due to an oversight:
binascii.a2b_uu
andbinascii.b2a_uu
for decoding and encoding uuencode datauu_codec
binary transform in thecodecs
module, implementing uuencode as a Python codecget_payload(decode=True)
method of the legacyemail.message.Message
(compat32
) APIThis PR adds missing:
Fixes #92613