Repository navigation
gh-71199: Name posixmodule types os.<type> on every platform - #161461
Merged
Merged
Conversation
…odule Pickles name posixmodule types and functions either through os or through the platform module (posix or nt). Both spellings must keep loading. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
times_result, uname_result, waitid_result, sched_param, DirEntry and ScandirIterator were named after the platform module (posix or nt), so pickles referenced posix.times_result and could not be loaded on Windows. Name them os.<type> like stat_result (pythongh-63408). Older pickles keep loading through the platform module. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
StanFromIreland
approved these changes
Nov 6, 2026
…N4cV.rst Co-authored-by: Stan Ulbrych <stan@python.org>
Member
|
Nice change! I wanted to make it for a few years :-) Good that you did it!
Oh! I didn't make the change since I was worried about breaking pickle. But I tested manually and "it just works"! Types can be get from the old "posix" name or from the new "os" name: |
Contributor
Author
|
Yea, pickle actually still uses the (although currently I'm spending way too much time trying to get a clearing on locale change and not leaking cache dict working) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These share code across platforms when present on multiple. Add a pickle test to keep both the platform-specific fully qualified version and the
os.name loadable.