Skip to content

gh-145856: Fix plistlib.dumps() skipkeys behavior with mixed key types#145867

Closed
VanshAgarwal24036 wants to merge 1 commit intopython:mainfrom
VanshAgarwal24036:gh-145856-plistlib-skipkeys
Closed

gh-145856: Fix plistlib.dumps() skipkeys behavior with mixed key types#145867
VanshAgarwal24036 wants to merge 1 commit intopython:mainfrom
VanshAgarwal24036:gh-145856-plistlib-skipkeys

Conversation

@VanshAgarwal24036
Copy link
Contributor

@VanshAgarwal24036 VanshAgarwal24036 commented Mar 12, 2026

When skipkeys=True, plistlib.dumps() attempted to sort dictionary keys before filtering non-string keys,
causing a TypeError for mixed key types.

This change filters non-string keys first and then sorts the remaining items.

@stefanzetzsche
Copy link
Contributor

#145814 (review)

@VanshAgarwal24036
Copy link
Contributor Author

@stefanzetzsche Sorry, I opened this PR before noticing ZeroIntensity’s comment about giving the issue author a chance to submit a PR first. My intention was just to help resolve the issue. If the author would like to work on it themselves, I’m happy to close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants