Bug 2284005 - python-jsonpickle: FTBFS with Python 3.13.0b1
Summary: python-jsonpickle: FTBFS with Python 3.13.0b1
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-jsonpickle
Version: rawhide
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Gwyn Ciesla
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 2290720 (view as bug list)
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2024-05-30 16:05 UTC by Ben Beasley
Modified: 2024-06-06 18:30 UTC (History)
4 users (show)

Fixed In Version: python-jsonpickle-3.0.4-2.fc41
Clone Of:
Environment:
Last Closed: 2024-06-01 22:10:23 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github jsonpickle jsonpickle issues 504 0 None open Python 3.13 regressions 2024-05-30 16:05:50 UTC

Description Ben Beasley 2024-05-30 16:05:42 UTC
I just added python-jsonpickle to the Python 3.13 COPR and did a test build, https://copr.fedorainfracloud.org/coprs/g/python/python3.13/build/7509658/.

=================================== FAILURES ===================================
___________________ [doctest] jsonpickle.unpickler.loadrepr ____________________
275 Returns an instance of the object from the object's repr() string.
276 It involves the dynamic specification of code.
277 
278 >>> obj = loadrepr('datetime/datetime.datetime.now()')
UNEXPECTED EXCEPTION: NameError("name 'datetime' is not defined")
Traceback (most recent call last):
  File "/usr/lib64/python3.13/doctest.py", line 1395, in __run
    exec(compile(example.source, filename, "single",
    ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                 compileflags, True), test.globs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<doctest jsonpickle.unpickler.loadrepr[0]>", line 1, in <module>
  File "/builddir/build/BUILD/python-jsonpickle-3.0.4-build/jsonpickle-3.0.4/jsonpickle/unpickler.py", line 289, in loadrepr
    return eval(evalstr)
  File "<string>", line 1, in <module>
NameError: name 'datetime' is not defined. Did you forget to import 'datetime'?
/builddir/build/BUILD/python-jsonpickle-3.0.4-build/jsonpickle-3.0.4/jsonpickle/unpickler.py:278: UnexpectedException
___________________ PicklingTestCase.test_thing_with_module ____________________

self = <jsonpickle_test.PicklingTestCase testMethod=test_thing_with_module>

    def test_thing_with_module(self):
        obj = Thing('with-module')
        obj.themodule = os
    
        flattened = self.pickler.flatten(obj)
>       inflated = self.unpickler.restore(flattened)

tests/jsonpickle_test.py:392: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
jsonpickle/unpickler.py:378: in restore
    value = self._restore(obj)
jsonpickle/unpickler.py:360: in _restore
    return restore(obj)
jsonpickle/unpickler.py:797: in _restore_object
    return self._restore_object_instance(obj, cls, class_name)
jsonpickle/unpickler.py:772: in _restore_object_instance
    instance = self._restore_object_instance_variables(obj, instance)
jsonpickle/unpickler.py:706: in _restore_object_instance_variables
    instance = self._restore_from_dict(obj, instance)
jsonpickle/unpickler.py:621: in _restore_from_dict
    value = self._restore(v)
jsonpickle/unpickler.py:360: in _restore
    return restore(obj)
jsonpickle/unpickler.py:548: in _restore_repr
    obj = loadrepr(obj[tags.REPR])
jsonpickle/unpickler.py:289: in loadrepr
    return eval(evalstr)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   NameError: name 'os' is not defined. Did you forget to import 'os'?

<string>:1: NameError
__________________ PicklingTestCase.test_thing_with_submodule __________________

self = <jsonpickle_test.PicklingTestCase testMethod=test_thing_with_submodule>

    def test_thing_with_submodule(self):
        obj = Thing('with-submodule')
        obj.submodule = collections
    
        flattened = self.pickler.flatten(obj)
>       inflated = self.unpickler.restore(flattened)

tests/jsonpickle_test.py:408: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
jsonpickle/unpickler.py:378: in restore
    value = self._restore(obj)
jsonpickle/unpickler.py:360: in _restore
    return restore(obj)
jsonpickle/unpickler.py:797: in _restore_object
    return self._restore_object_instance(obj, cls, class_name)
jsonpickle/unpickler.py:772: in _restore_object_instance
    instance = self._restore_object_instance_variables(obj, instance)
jsonpickle/unpickler.py:706: in _restore_object_instance_variables
    instance = self._restore_from_dict(obj, instance)
jsonpickle/unpickler.py:621: in _restore_from_dict
    value = self._restore(v)
jsonpickle/unpickler.py:360: in _restore
    return restore(obj)
jsonpickle/unpickler.py:548: in _restore_repr
    obj = loadrepr(obj[tags.REPR])
jsonpickle/unpickler.py:289: in loadrepr
    return eval(evalstr)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   NameError: name 'collections' is not defined. Did you forget to import 'collections'?

<string>:1: NameError
=============================== warnings summary ===============================
../../../../../usr/lib64/python3.13/site-packages/sqlalchemy/sql/sqltypes.py:1902
  /usr/lib64/python3.13/site-packages/sqlalchemy/sql/sqltypes.py:1902: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    epoch = dt.datetime.utcfromtimestamp(0)

tests/bson_test.py::BSONTestCase::test_FixedOffsetSerializable
  /usr/lib64/python3.13/site-packages/bson/__init__.py:193: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
    EPOCH_NAIVE = datetime.datetime.utcfromtimestamp(0)

tests/datetime_test.py: 12 warnings
  /builddir/build/BUILD/python-jsonpickle-3.0.4-build/jsonpickle-3.0.4/tests/datetime_test.py:45: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    self._dt_read = datetime.datetime.utcnow()

tests/datetime_test.py::DateTimeInnerReferenceTestCase::test_object_with_inner_datetime_refs
tests/datetime_test.py::DateTimeInnerReferenceTestCase::test_object_with_inner_datetime_refs
  /builddir/build/BUILD/python-jsonpickle-3.0.4-build/jsonpickle-3.0.4/tests/datetime_test.py:55: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    self._dt_read = datetime.datetime.utcnow()

tests/datetime_test.py::DateTimeSimpleTestCase::test_utc
  /builddir/build/BUILD/python-jsonpickle-3.0.4-build/jsonpickle-3.0.4/tests/datetime_test.py:153: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
    self._roundtrip(datetime.datetime.utcnow().replace(tzinfo=utc))

tests/feedparser_test.py::FeedParserTestCase::test
tests/feedparser_test.py::FeedParserTestCase::test
tests/feedparser_test.py::FeedParserTestCase::test
tests/feedparser_test.py::FeedParserTestCase::test
tests/feedparser_test.py::FeedParserTestCase::test
tests/feedparser_test.py::FeedParserTestCase::test
  /usr/lib/python3.13/site-packages/feedparser/html.py:152: DeprecationWarning: 'count' is passed as positional argument
    data = re.sub(r'<!((?!DOCTYPE|--|\[))', r'&lt;!\1', data, re.IGNORECASE)

tests/numpy_test.py::test_ndarray_roundtrip
tests/sklearn_test.py::test_decision_tree
  /builddir/build/BUILD/python-jsonpickle-3.0.4-build/jsonpickle-3.0.4/jsonpickle/ext/numpy.py:305: UserWarning: ndarray is defined by reference to an object we do not know how to serialize. A deep copy is serialized instead, breaking memory aliasing.
    warnings.warn(msg)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED jsonpickle/unpickler.py::jsonpickle.unpickler.loadrepr
FAILED tests/jsonpickle_test.py::PicklingTestCase::test_thing_with_module - N...
FAILED tests/jsonpickle_test.py::PicklingTestCase::test_thing_with_submodule
============ 3 failed, 344 passed, 3 xpassed, 25 warnings in 1.29s =============

I reported this upstream in https://github.com/jsonpickle/jsonpickle/issues/504.

Reproducible: Always

Comment 2 Fedora Update System 2024-06-01 22:16:29 UTC
FEDORA-2024-df9351f772 (python-jsonpickle-3.0.4-2.fc41) has been submitted as an update to Fedora 41.
https://bodhi.fedoraproject.org/updates/FEDORA-2024-df9351f772

Comment 3 Fedora Update System 2024-06-01 22:20:21 UTC
FEDORA-2024-df9351f772 (python-jsonpickle-3.0.4-2.fc41) has been pushed to the Fedora 41 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 4 Ben Boeckel 2024-06-06 18:30:58 UTC
*** Bug 2290720 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.