Skip to content

Update pickle.py from 3.14.2#6982

Merged
youknowone merged 10 commits intoRustPython:mainfrom
ShaharNaveh:update-compat-pickle
Feb 5, 2026
Merged

Update pickle.py from 3.14.2#6982
youknowone merged 10 commits intoRustPython:mainfrom
ShaharNaveh:update-compat-pickle

Conversation

@ShaharNaveh
Copy link
Contributor

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 3, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (9)
  • Lib/_compat_pickle.py is excluded by !Lib/**
  • Lib/pickle.py is excluded by !Lib/**
  • Lib/pickletester.py is excluded by !Lib/**
  • Lib/pickletools.py is excluded by !Lib/**
  • Lib/test/support/rustpython.py is excluded by !Lib/**
  • Lib/test/test_extcall.py is excluded by !Lib/**
  • Lib/test/test_pickle.py is excluded by !Lib/**
  • Lib/test/test_picklebuffer.py is excluded by !Lib/**
  • Lib/test/test_pickletools.py is excluded by !Lib/**

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

except NameError:
pass
else:
PYTHON2_EXCEPTIONS += ("JitError",)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably we still need this for --features jit

@ShaharNaveh ShaharNaveh changed the title Update _compat_pickle.py from 3.14.2 Update pickle.py from 3.14.2 Feb 3, 2026
@ShaharNaveh ShaharNaveh marked this pull request as ready for review February 3, 2026 14:53
Copy link
Contributor Author

@ShaharNaveh ShaharNaveh Feb 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fanninpm can you please review? I've modified this slightly (renamed the class, and didn't use an if inside the check_output method)

@youknowone youknowone requested a review from fanninpm February 3, 2026 22:48
Copy link
Contributor

@fanninpm fanninpm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fanninpm can you please review? I've modified this slightly (renamed the class, and didn't use an if inside the check_output method)

A few things.


class DocTestChecker(doctest.OutputChecker):
"""
Custom output checker that lets us to add: `+EXPECTED_FAILURE` for doctest tests.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor grammar nitpick from a native speaker of English:

Suggested change
Custom output checker that lets us to add: `+EXPECTED_FAILURE` for doctest tests.
Custom output checker that lets us add: `+EXPECTED_FAILURE` for doctest tests.

Also, consider expanding upon what exactly this option string does (allows us to mark doctest examples as currently failing, for accountability).


def check_output(self, want, got, optionflags):
if optionflags & EXPECTED_FAILURE:
return want != got
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized that if

  • you have both +EXPECTED_FAILURE and another doctest flag on a test that currently would fail without +EXPECTED_FAILURE
  • but later, something is changed elsewhere in the interpreter that makes it so that the aforementioned test would pass without the presence of +EXPECTED_FAILURE

…then there's a risk of the current logic "covering up" the fact that +EXPECTED_FAILURE needs to be removed from the test.

I then came up with this:

Suggested change
return want != got
return not super().check_output(want, got, optionflags)

See #6945 for an example of it in action.

@ShaharNaveh ShaharNaveh requested a review from fanninpm February 4, 2026 07:53
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

📦 Library Dependencies

The following Lib/ modules were modified. Here are their dependencies:

[x] lib: cpython/Lib/pickle.py
[ ] lib: cpython/Lib/_compat_pickle.py
[ ] test: cpython/Lib/test/test_pickle.py (TODO: 26)
[ ] test: cpython/Lib/test/test_picklebuffer.py (TODO: 12)
[ ] test: cpython/Lib/test/test_pickletools.py (TODO: 8)

dependencies:

  • pickle (native: itertools, sys)
    • _compat_pickle
    • _compat_pickle
    • io (native: _io, _thread, errno, sys)
    • codecs, copyreg, functools, struct, types

dependent tests: (69 tests)

  • pickle: test_array test_asyncio test_builtin test_bytes test_bz2 test_codecs test_collections test_concurrent_futures test_coroutines test_csv test_ctypes test_decimal test_defaultdict test_deque test_descr test_dict test_dictviews test_email test_enum test_enumerate test_exceptions test_fractions test_functools test_generators test_genericalias test_http_cookies test_importlib test_inspect test_io test_ipaddress test_iter test_itertools test_list test_logging test_lzma test_memoryio test_memoryview test_opcache test_operator test_ordered_dict test_os test_pathlib test_pickle test_pickletools test_platform test_plistlib test_positional_only_arg test_posix test_random test_range test_set test_shelve test_slice test_socket test_statistics test_str test_string test_trace test_tuple test_types test_typing test_unittest test_uuid test_xml_dom_minicompat test_xml_etree test_zipfile test_zlib test_zoneinfo
    • logging.handlers: test_concurrent_futures

[x] lib: cpython/Lib/copyreg.py
[x] test: cpython/Lib/test/test_copyreg.py

dependencies:

  • copyreg

dependent tests: (94 tests)

  • copyreg: test_copy test_copyreg test_descr
    • copy: test_ast test_bytes test_codecs test_collections test_coroutines test_csv test_defaultdict test_deque test_dictviews test_email test_enum test_exceptions test_fractions test_functools test_generators test_genericalias test_http_cookies test_inspect test_ipaddress test_itertools test_logging test_memoryview test_opcache test_optparse test_ordered_dict test_platform test_plistlib test_posix test_set test_site test_slice test_statistics test_sysconfig test_tomllib test_types test_typing test_unittest test_uuid test_weakref test_weakset test_xml_dom_minicompat test_xml_etree test_zlib
      • dataclasses: test__colorize test_patma test_pprint test_regrtest test_zoneinfo
      • email.generator: test_email
      • http.cookiejar: test_http_cookiejar
      • http.server: test_httpservers test_robotparser test_urllib2_localnet
      • logging.handlers: test_concurrent_futures
      • mailbox: test_mailbox
      • smtplib: test_smtplib test_smtpnet
      • tarfile: test_shutil test_tarfile
    • pickle: test_array test_asyncio test_builtin test_bz2 test_concurrent_futures test_ctypes test_decimal test_dict test_enumerate test_importlib test_io test_iter test_list test_lzma test_memoryio test_operator test_os test_pathlib test_pickle test_pickletools test_positional_only_arg test_random test_range test_shelve test_socket test_str test_string test_trace test_tuple test_unittest test_zipfile test_zoneinfo

[ ] lib: cpython/Lib/pickletools.py
[ ] test: cpython/Lib/test/test_pickletools.py (TODO: 8)

dependencies:

  • pickletools (native: sys)
    • io, pickle
    • codecs, re, struct

dependent tests: (1 tests)

  • pickletools: test_pickletools

[ ] test: cpython/Lib/test/test_extcall.py (TODO: 31)

dependencies:

dependent tests: (no tests depend on extcall)

Legend:

  • [+] path exists in CPython
  • [x] up-to-date, [ ] outdated

@youknowone youknowone merged commit e2ee206 into RustPython:main Feb 5, 2026
24 of 25 checks passed
@ShaharNaveh ShaharNaveh deleted the update-compat-pickle branch February 5, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants