Package: src:python-marshmallow-polyfield
Version: 5.10-1
Severity: serious
Tags: ftbfs trixie sid

Dear maintainer:

During a rebuild of all packages in unstable, your package failed to build:

--------------------------------------------------------------------------------
[...]
 debian/rules clean
dh clean --with python3 --buildsystem=pybuild
   dh_auto_clean -O--buildsystem=pybuild
I: pybuild base:311: python3.12 setup.py clean 
running clean
removing '/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_marshmallow-polyfield/build' 
(and everything under it)
'build/bdist.linux-x86_64' does not exist -- can't clean it
'build/scripts-3.12' does not exist -- can't clean it
I: pybuild base:311: python3.13 setup.py clean 
running clean
removing '/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_marshmallow-polyfield/build' 
(and everything under it)
'build/bdist.linux-x86_64' does not exist -- can't clean it
'build/scripts-3.13' does not exist -- can't clean it
   dh_autoreconf_clean -O--buildsystem=pybuild
   dh_clean -O--buildsystem=pybuild
 debian/rules binary
dh binary --with python3 --buildsystem=pybuild
   dh_update_autotools_config -O--buildsystem=pybuild
   dh_autoreconf -O--buildsystem=pybuild
   dh_auto_configure -O--buildsystem=pybuild
I: pybuild base:311: python3.12 setup.py config 
running config
I: pybuild base:311: python3.13 setup.py config 
running config
   dh_auto_build -O--buildsystem=pybuild
I: pybuild base:311: /usr/bin/python3.12 setup.py build 
running build
running build_py
creating 
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_marshmallow-polyfield/build/marshmallow_polyfield
copying marshmallow_polyfield/__init__.py -> 
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_marshmallow-polyfield/build/marshmallow_polyfield
copying marshmallow_polyfield/polyfield.py -> 
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_marshmallow-polyfield/build/marshmallow_polyfield
I: pybuild base:311: /usr/bin/python3 setup.py build 
running build
running build_py
creating 
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_marshmallow-polyfield/build/marshmallow_polyfield
copying marshmallow_polyfield/__init__.py -> 
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_marshmallow-polyfield/build/marshmallow_polyfield
copying marshmallow_polyfield/polyfield.py -> 
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_marshmallow-polyfield/build/marshmallow_polyfield
   dh_auto_test -O--buildsystem=pybuild
I: pybuild base:311: cd 
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_marshmallow-polyfield/build; python3.12 
-m pytest -c /dev/null
============================= test session starts ==============================
platform linux -- Python 3.12.9, pytest-8.3.4, pluggy-1.5.0
rootdir: /dev
configfile: null
plugins: typeguard-4.4.1
collected 19 items

../../../../../../dev/tests/test_deserialization.py ...........          [ 57%]
../../../../../../dev/tests/test_polyfield_base.py .                     [ 63%]
../../../../../../dev/tests/test_serialization.py ..F.F.F                [100%]

=================================== FAILURES ===================================
_____________________ test_serializing_polyfield_rectangle _____________________

self = <fields.PolyField(dump_default=<marshmallow.missing>, attribute=None, 
validate=None, required=False, load_only=False, ...equired': 'Missing data for 
required field.', 'null': 'Field may not be null.', 'validator_failed': 
'Invalid value.'})>
value = <tests.shapes.Rectangle object at 0x7f229588ae10>, key = 'shape'
obj = Sticker(shape=<tests.shapes.Rectangle object at 0x7f229588ae10>, 
image='marshmallow.png')
kwargs = {}, schema = <RectangleSchema(many=False)>

    def _serialize(self, value, key, obj, **kwargs):
        if value is None:
            return None
        try:
            if self.many:
                res = []
                for v in value:
                    schema = self.serialization_schema_selector(v, obj)
                    schema.context.update(getattr(self, 'context', {}))
                    res.append(schema.dump(v))
                return res
            else:
                schema = self.serialization_schema_selector(value, obj)
>               schema.context.update(getattr(self, 'context', {}))
E               TypeError: 'NoneType' object is not iterable

marshmallow_polyfield/polyfield.py:74: TypeError

During handling of the above exception, another exception occurred:

args_ = ()

    def wrapped(*args_):
        return [
>           func(*(args_ + (a,)))
            for a in args
        ]

tests/polyclasses.py:15: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_serialization.py:52: in test_serializing_polyfield_rectangle
    rect_dict = field.serialize('shape', marshmallow_sticker)
/usr/lib/python3/dist-packages/marshmallow/fields.py:348: in serialize
    return self._serialize(value, attr, obj, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <fields.PolyField(dump_default=<marshmallow.missing>, attribute=None, 
validate=None, required=False, load_only=False, ...equired': 'Missing data for 
required field.', 'null': 'Field may not be null.', 'validator_failed': 
'Invalid value.'})>
value = <tests.shapes.Rectangle object at 0x7f229588ae10>, key = 'shape'
obj = Sticker(shape=<tests.shapes.Rectangle object at 0x7f229588ae10>, 
image='marshmallow.png')
kwargs = {}, schema = <RectangleSchema(many=False)>

    def _serialize(self, value, key, obj, **kwargs):
        if value is None:
            return None
        try:
            if self.many:
                res = []
                for v in value:
                    schema = self.serialization_schema_selector(v, obj)
                    schema.context.update(getattr(self, 'context', {}))
                    res.append(schema.dump(v))
                return res
            else:
                schema = self.serialization_schema_selector(value, obj)
                schema.context.update(getattr(self, 'context', {}))
                return schema.dump(value)
        except Exception as err:
>           raise TypeError(
                'Failed to serialize object. Error: {0}\n'
                ' Ensure the serialization_schema_selector exists and '
                ' returns a Schema and that schema'
                ' can serialize this value {1}'.format(err, value))
E           TypeError: Failed to serialize object. Error: 'NoneType' object is 
not iterable
E            Ensure the serialization_schema_selector exists and  returns a 
Schema and that schema can serialize this value <tests.shapes.Rectangle object 
at 0x7f229588ae10>

marshmallow_polyfield/polyfield.py:77: TypeError
_______________________ test_serializing_polyfield_many ________________________

self = <fields.PolyField(dump_default=<marshmallow.missing>, attribute=None, 
validate=None, required=False, load_only=False, ...equired': 'Missing data for 
required field.', 'null': 'Field may not be null.', 'validator_failed': 
'Invalid value.'})>
value = [<tests.shapes.Rectangle object at 0x7f2295752030>, 
<tests.shapes.Triangle object at 0x7f2295752180>]
key = 'shapes'
obj = StickerCollection(shapes=[<tests.shapes.Rectangle object at 
0x7f2295752030>, <tests.shapes.Triangle object at 0x7f2295752180>], 
image='marshmallow.png')
kwargs = {}, res = [], v = <tests.shapes.Rectangle object at 0x7f2295752030>
schema = <RectangleSchema(many=False)>

    def _serialize(self, value, key, obj, **kwargs):
        if value is None:
            return None
        try:
            if self.many:
                res = []
                for v in value:
                    schema = self.serialization_schema_selector(v, obj)
>                   schema.context.update(getattr(self, 'context', {}))
E                   TypeError: 'NoneType' object is not iterable

marshmallow_polyfield/polyfield.py:69: TypeError

During handling of the above exception, another exception occurred:

args_ = ()

    def wrapped(*args_):
        return [
>           func(*(args_ + (a,)))
            for a in args
        ]

tests/polyclasses.py:15: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_serialization.py:79: in test_serializing_polyfield_many
    shapes = field.serialize('shapes', marshmallow_sticker_collection)
/usr/lib/python3/dist-packages/marshmallow/fields.py:348: in serialize
    return self._serialize(value, attr, obj, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <fields.PolyField(dump_default=<marshmallow.missing>, attribute=None, 
validate=None, required=False, load_only=False, ...equired': 'Missing data for 
required field.', 'null': 'Field may not be null.', 'validator_failed': 
'Invalid value.'})>
value = [<tests.shapes.Rectangle object at 0x7f2295752030>, 
<tests.shapes.Triangle object at 0x7f2295752180>]
key = 'shapes'
obj = StickerCollection(shapes=[<tests.shapes.Rectangle object at 
0x7f2295752030>, <tests.shapes.Triangle object at 0x7f2295752180>], 
image='marshmallow.png')
kwargs = {}, res = [], v = <tests.shapes.Rectangle object at 0x7f2295752030>
schema = <RectangleSchema(many=False)>

    def _serialize(self, value, key, obj, **kwargs):
        if value is None:
            return None
        try:
            if self.many:
                res = []
                for v in value:
                    schema = self.serialization_schema_selector(v, obj)
                    schema.context.update(getattr(self, 'context', {}))
                    res.append(schema.dump(v))
                return res
            else:
                schema = self.serialization_schema_selector(value, obj)
                schema.context.update(getattr(self, 'context', {}))
                return schema.dump(value)
        except Exception as err:
>           raise TypeError(
                'Failed to serialize object. Error: {0}\n'
                ' Ensure the serialization_schema_selector exists and '
                ' returns a Schema and that schema'
                ' can serialize this value {1}'.format(err, value))
E           TypeError: Failed to serialize object. Error: 'NoneType' object is 
not iterable
E            Ensure the serialization_schema_selector exists and  returns a 
Schema and that schema can serialize this value [<tests.shapes.Rectangle object 
at 0x7f2295752030>, <tests.shapes.Triangle object at 0x7f2295752180>]

marshmallow_polyfield/polyfield.py:77: TypeError
__________________ test_serializing_polyfield_by_parent_type ___________________

self = <fields.PolyField(dump_default=<marshmallow.missing>, attribute=None, 
validate=None, required=False, load_only=False, ...equired': 'Missing data for 
required field.', 'null': 'Field may not be null.', 'validator_failed': 
'Invalid value.'})>
value = <tests.shapes.Rectangle object at 0x7f2295753fe0>, key = 'shape'
obj = Sticker(shape=<tests.shapes.Rectangle object at 0x7f2295753fe0>, 
image='marshmallow.png', type='rectangle')
kwargs = {}, schema = <RectangleSchema(many=False)>

    def _serialize(self, value, key, obj, **kwargs):
        if value is None:
            return None
        try:
            if self.many:
                res = []
                for v in value:
                    schema = self.serialization_schema_selector(v, obj)
                    schema.context.update(getattr(self, 'context', {}))
                    res.append(schema.dump(v))
                return res
            else:
                schema = self.serialization_schema_selector(value, obj)
>               schema.context.update(getattr(self, 'context', {}))
E               TypeError: 'NoneType' object is not iterable

marshmallow_polyfield/polyfield.py:74: TypeError

During handling of the above exception, another exception occurred:

args_ = ()

    def wrapped(*args_):
        return [
>           func(*(args_ + (a,)))
            for a in args
        ]

tests/polyclasses.py:15: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_serialization.py:99: in test_serializing_polyfield_by_parent_type
    rect_dict = field.serialize('shape', marshmallow_sticker)
/usr/lib/python3/dist-packages/marshmallow/fields.py:348: in serialize
    return self._serialize(value, attr, obj, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <fields.PolyField(dump_default=<marshmallow.missing>, attribute=None, 
validate=None, required=False, load_only=False, ...equired': 'Missing data for 
required field.', 'null': 'Field may not be null.', 'validator_failed': 
'Invalid value.'})>
value = <tests.shapes.Rectangle object at 0x7f2295753fe0>, key = 'shape'
obj = Sticker(shape=<tests.shapes.Rectangle object at 0x7f2295753fe0>, 
image='marshmallow.png', type='rectangle')
kwargs = {}, schema = <RectangleSchema(many=False)>

    def _serialize(self, value, key, obj, **kwargs):
        if value is None:
            return None
        try:
            if self.many:
                res = []
                for v in value:
                    schema = self.serialization_schema_selector(v, obj)
                    schema.context.update(getattr(self, 'context', {}))
                    res.append(schema.dump(v))
                return res
            else:
                schema = self.serialization_schema_selector(value, obj)
                schema.context.update(getattr(self, 'context', {}))
                return schema.dump(value)
        except Exception as err:
>           raise TypeError(
                'Failed to serialize object. Error: {0}\n'
                ' Ensure the serialization_schema_selector exists and '
                ' returns a Schema and that schema'
                ' can serialize this value {1}'.format(err, value))
E           TypeError: Failed to serialize object. Error: 'NoneType' object is 
not iterable
E            Ensure the serialization_schema_selector exists and  returns a 
Schema and that schema can serialize this value <tests.shapes.Rectangle object 
at 0x7f2295753fe0>

marshmallow_polyfield/polyfield.py:77: TypeError
=============================== warnings summary ===============================
tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield
  /usr/lib/python3/dist-packages/_pytest/python.py:163: 
PytestReturnNotNoneWarning: Expected None, but 
tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield 
returned [None, None], which will be an error in a future version of pytest.  
Did you mean to use `assert` instead of `return`?
    warnings.warn(

tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_none
  /usr/lib/python3/dist-packages/_pytest/python.py:163: 
PytestReturnNotNoneWarning: Expected None, but 
tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_none 
returned [None, None], which will be an error in a future version of pytest.  
Did you mean to use `assert` instead of `return`?
    warnings.warn(

tests/test_deserialization.py::TestPolyField::test_deserailize_polyfield_none_required
  /usr/lib/python3/dist-packages/_pytest/python.py:163: 
PytestReturnNotNoneWarning: Expected None, but 
tests/test_deserialization.py::TestPolyField::test_deserailize_polyfield_none_required
 returned [None, None], which will be an error in a future version of pytest.  
Did you mean to use `assert` instead of `return`?
    warnings.warn(

tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_invalid_type_error
  /usr/lib/python3/dist-packages/_pytest/python.py:163: 
PytestReturnNotNoneWarning: Expected None, but 
tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_invalid_type_error
 returned [None, None], which will be an error in a future version of pytest.  
Did you mean to use `assert` instead of `return`?
    warnings.warn(

tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_invalid_validation_error
  /usr/lib/python3/dist-packages/_pytest/python.py:163: 
PytestReturnNotNoneWarning: Expected None, but 
tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_invalid_validation_error
 returned [None, None], which will be an error in a future version of pytest.  
Did you mean to use `assert` instead of `return`?
    warnings.warn(

tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_invalid_generic_error
  /usr/lib/python3/dist-packages/_pytest/python.py:163: 
PytestReturnNotNoneWarning: Expected None, but 
tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_invalid_generic_error
 returned [None, None], which will be an error in a future version of pytest.  
Did you mean to use `assert` instead of `return`?
    warnings.warn(

tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_invalid_schema_returned_is_invalid
  /usr/lib/python3/dist-packages/_pytest/python.py:163: 
PytestReturnNotNoneWarning: Expected None, but 
tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_invalid_schema_returned_is_invalid
 returned [None, None], which will be an error in a future version of pytest.  
Did you mean to use `assert` instead of `return`?
    warnings.warn(

tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_errors
  /usr/lib/python3/dist-packages/_pytest/python.py:163: 
PytestReturnNotNoneWarning: Expected None, but 
tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_errors 
returned [None, None], which will be an error in a future version of pytest.  
Did you mean to use `assert` instead of `return`?
    warnings.warn(

tests/test_deserialization.py::TestPolyFieldDisambiguationByProperty::test_deserialize_polyfield
  /usr/lib/python3/dist-packages/_pytest/python.py:163: 
PytestReturnNotNoneWarning: Expected None, but 
tests/test_deserialization.py::TestPolyFieldDisambiguationByProperty::test_deserialize_polyfield
 returned [None, None], which will be an error in a future version of pytest.  
Did you mean to use `assert` instead of `return`?
    warnings.warn(

tests/test_serialization.py::test_serializing_named_tuple
  
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_marshmallow-polyfield/build/tests/test_serialization.py:27:
 ChangedInMarshmallow4Warning: `Field` should not be instantiated. Use 
`fields.Raw` or  another field subclass instead.
    field = fields.Field()

tests/test_serialization.py::test_serializing_polyfield_None
  /usr/lib/python3/dist-packages/_pytest/python.py:163: 
PytestReturnNotNoneWarning: Expected None, but 
tests/test_serialization.py::test_serializing_polyfield_None returned [None, 
None], which will be an error in a future version of pytest.  Did you mean to 
use `assert` instead of `return`?
    warnings.warn(

tests/test_serialization.py::test_invalid_polyfield
  /usr/lib/python3/dist-packages/_pytest/python.py:163: 
PytestReturnNotNoneWarning: Expected None, but 
tests/test_serialization.py::test_invalid_polyfield returned [None, None], 
which will be an error in a future version of pytest.  Did you mean to use 
`assert` instead of `return`?
    warnings.warn(

../../../../../../usr/lib/python3/dist-packages/_pytest/cacheprovider.py:475
  /usr/lib/python3/dist-packages/_pytest/cacheprovider.py:475: 
PytestCacheWarning: could not create cache path 
/dev/.pytest_cache/v/cache/nodeids: [Errno 13] Permission denied: 
'/dev/pytest-cache-files-iw_04ss5'
    config.cache.set("cache/nodeids", sorted(self.cached_nodeids))

../../../../../../usr/lib/python3/dist-packages/_pytest/cacheprovider.py:429
  /usr/lib/python3/dist-packages/_pytest/cacheprovider.py:429: 
PytestCacheWarning: could not create cache path 
/dev/.pytest_cache/v/cache/lastfailed: [Errno 13] Permission denied: 
'/dev/pytest-cache-files-k2mwy9iy'
    config.cache.set("cache/lastfailed", self.lastfailed)

../../../../../../usr/lib/python3/dist-packages/_pytest/stepwise.py:51
  /usr/lib/python3/dist-packages/_pytest/stepwise.py:51: PytestCacheWarning: 
could not create cache path /dev/.pytest_cache/v/cache/stepwise: [Errno 13] 
Permission denied: '/dev/pytest-cache-files-53580col'
    session.config.cache.set(STEPWISE_CACHE_DIR, [])

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED 
../../../../../../dev/tests/test_serialization.py::test_serializing_polyfield_rectangle
FAILED 
../../../../../../dev/tests/test_serialization.py::test_serializing_polyfield_many
FAILED 
../../../../../../dev/tests/test_serialization.py::test_serializing_polyfield_by_parent_type
================== 3 failed, 16 passed, 15 warnings in 0.11s ===================
E: pybuild pybuild:389: test: plugin distutils failed with: exit code=1: cd 
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_marshmallow-polyfield/build; python3.12 
-m pytest -c /dev/null
I: pybuild base:311: cd 
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_marshmallow-polyfield/build; python3.13 
-m pytest -c /dev/null
============================= test session starts ==============================
platform linux -- Python 3.13.2, pytest-8.3.4, pluggy-1.5.0
rootdir: /dev
configfile: null
plugins: typeguard-4.4.1
collected 19 items

../../../../../../dev/tests/test_deserialization.py ...........          [ 57%]
../../../../../../dev/tests/test_polyfield_base.py .                     [ 63%]
../../../../../../dev/tests/test_serialization.py ..F.F.F                [100%]

=================================== FAILURES ===================================
_____________________ test_serializing_polyfield_rectangle _____________________

self = <fields.PolyField(dump_default=<marshmallow.missing>, attribute=None, 
validate=None, required=False, load_only=False, ...equired': 'Missing data for 
required field.', 'null': 'Field may not be null.', 'validator_failed': 
'Invalid value.'})>
value = <tests.shapes.Rectangle object at 0x7fc64815d010>, key = 'shape'
obj = Sticker(shape=<tests.shapes.Rectangle object at 0x7fc64815d010>, 
image='marshmallow.png')
kwargs = {}, schema = <RectangleSchema(many=False)>

    def _serialize(self, value, key, obj, **kwargs):
        if value is None:
            return None
        try:
            if self.many:
                res = []
                for v in value:
                    schema = self.serialization_schema_selector(v, obj)
                    schema.context.update(getattr(self, 'context', {}))
                    res.append(schema.dump(v))
                return res
            else:
                schema = self.serialization_schema_selector(value, obj)
>               schema.context.update(getattr(self, 'context', {}))
E               TypeError: 'NoneType' object is not iterable

marshmallow_polyfield/polyfield.py:74: TypeError

During handling of the above exception, another exception occurred:

args_ = ()

    def wrapped(*args_):
        return [
>           func(*(args_ + (a,)))
            for a in args
        ]

tests/polyclasses.py:15: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_serialization.py:52: in test_serializing_polyfield_rectangle
    rect_dict = field.serialize('shape', marshmallow_sticker)
/usr/lib/python3/dist-packages/marshmallow/fields.py:348: in serialize
    return self._serialize(value, attr, obj, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <fields.PolyField(dump_default=<marshmallow.missing>, attribute=None, 
validate=None, required=False, load_only=False, ...equired': 'Missing data for 
required field.', 'null': 'Field may not be null.', 'validator_failed': 
'Invalid value.'})>
value = <tests.shapes.Rectangle object at 0x7fc64815d010>, key = 'shape'
obj = Sticker(shape=<tests.shapes.Rectangle object at 0x7fc64815d010>, 
image='marshmallow.png')
kwargs = {}, schema = <RectangleSchema(many=False)>

    def _serialize(self, value, key, obj, **kwargs):
        if value is None:
            return None
        try:
            if self.many:
                res = []
                for v in value:
                    schema = self.serialization_schema_selector(v, obj)
                    schema.context.update(getattr(self, 'context', {}))
                    res.append(schema.dump(v))
                return res
            else:
                schema = self.serialization_schema_selector(value, obj)
                schema.context.update(getattr(self, 'context', {}))
                return schema.dump(value)
        except Exception as err:
>           raise TypeError(
                'Failed to serialize object. Error: {0}\n'
                ' Ensure the serialization_schema_selector exists and '
                ' returns a Schema and that schema'
                ' can serialize this value {1}'.format(err, value))
E           TypeError: Failed to serialize object. Error: 'NoneType' object is 
not iterable
E            Ensure the serialization_schema_selector exists and  returns a 
Schema and that schema can serialize this value <tests.shapes.Rectangle object 
at 0x7fc64815d010>

marshmallow_polyfield/polyfield.py:77: TypeError
_______________________ test_serializing_polyfield_many ________________________

self = <fields.PolyField(dump_default=<marshmallow.missing>, attribute=None, 
validate=None, required=False, load_only=False, ...equired': 'Missing data for 
required field.', 'null': 'Field may not be null.', 'validator_failed': 
'Invalid value.'})>
value = [<tests.shapes.Rectangle object at 0x7fc64815dda0>, 
<tests.shapes.Triangle object at 0x7fc6482fe8b0>]
key = 'shapes'
obj = StickerCollection(shapes=[<tests.shapes.Rectangle object at 
0x7fc64815dda0>, <tests.shapes.Triangle object at 0x7fc6482fe8b0>], 
image='marshmallow.png')
kwargs = {}, res = [], v = <tests.shapes.Rectangle object at 0x7fc64815dda0>
schema = <RectangleSchema(many=False)>

    def _serialize(self, value, key, obj, **kwargs):
        if value is None:
            return None
        try:
            if self.many:
                res = []
                for v in value:
                    schema = self.serialization_schema_selector(v, obj)
>                   schema.context.update(getattr(self, 'context', {}))
E                   TypeError: 'NoneType' object is not iterable

marshmallow_polyfield/polyfield.py:69: TypeError

During handling of the above exception, another exception occurred:

args_ = ()

    def wrapped(*args_):
        return [
>           func(*(args_ + (a,)))
            for a in args
        ]

tests/polyclasses.py:15: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_serialization.py:79: in test_serializing_polyfield_many
    shapes = field.serialize('shapes', marshmallow_sticker_collection)
/usr/lib/python3/dist-packages/marshmallow/fields.py:348: in serialize
    return self._serialize(value, attr, obj, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <fields.PolyField(dump_default=<marshmallow.missing>, attribute=None, 
validate=None, required=False, load_only=False, ...equired': 'Missing data for 
required field.', 'null': 'Field may not be null.', 'validator_failed': 
'Invalid value.'})>
value = [<tests.shapes.Rectangle object at 0x7fc64815dda0>, 
<tests.shapes.Triangle object at 0x7fc6482fe8b0>]
key = 'shapes'
obj = StickerCollection(shapes=[<tests.shapes.Rectangle object at 
0x7fc64815dda0>, <tests.shapes.Triangle object at 0x7fc6482fe8b0>], 
image='marshmallow.png')
kwargs = {}, res = [], v = <tests.shapes.Rectangle object at 0x7fc64815dda0>
schema = <RectangleSchema(many=False)>

    def _serialize(self, value, key, obj, **kwargs):
        if value is None:
            return None
        try:
            if self.many:
                res = []
                for v in value:
                    schema = self.serialization_schema_selector(v, obj)
                    schema.context.update(getattr(self, 'context', {}))
                    res.append(schema.dump(v))
                return res
            else:
                schema = self.serialization_schema_selector(value, obj)
                schema.context.update(getattr(self, 'context', {}))
                return schema.dump(value)
        except Exception as err:
>           raise TypeError(
                'Failed to serialize object. Error: {0}\n'
                ' Ensure the serialization_schema_selector exists and '
                ' returns a Schema and that schema'
                ' can serialize this value {1}'.format(err, value))
E           TypeError: Failed to serialize object. Error: 'NoneType' object is 
not iterable
E            Ensure the serialization_schema_selector exists and  returns a 
Schema and that schema can serialize this value [<tests.shapes.Rectangle object 
at 0x7fc64815dda0>, <tests.shapes.Triangle object at 0x7fc6482fe8b0>]

marshmallow_polyfield/polyfield.py:77: TypeError
__________________ test_serializing_polyfield_by_parent_type ___________________

self = <fields.PolyField(dump_default=<marshmallow.missing>, attribute=None, 
validate=None, required=False, load_only=False, ...equired': 'Missing data for 
required field.', 'null': 'Field may not be null.', 'validator_failed': 
'Invalid value.'})>
value = <tests.shapes.Rectangle object at 0x7fc64804d730>, key = 'shape'
obj = Sticker(shape=<tests.shapes.Rectangle object at 0x7fc64804d730>, 
image='marshmallow.png', type='rectangle')
kwargs = {}, schema = <RectangleSchema(many=False)>

    def _serialize(self, value, key, obj, **kwargs):
        if value is None:
            return None
        try:
            if self.many:
                res = []
                for v in value:
                    schema = self.serialization_schema_selector(v, obj)
                    schema.context.update(getattr(self, 'context', {}))
                    res.append(schema.dump(v))
                return res
            else:
                schema = self.serialization_schema_selector(value, obj)
>               schema.context.update(getattr(self, 'context', {}))
E               TypeError: 'NoneType' object is not iterable

marshmallow_polyfield/polyfield.py:74: TypeError

During handling of the above exception, another exception occurred:

args_ = ()

    def wrapped(*args_):
        return [
>           func(*(args_ + (a,)))
            for a in args
        ]

tests/polyclasses.py:15: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/test_serialization.py:99: in test_serializing_polyfield_by_parent_type
    rect_dict = field.serialize('shape', marshmallow_sticker)
/usr/lib/python3/dist-packages/marshmallow/fields.py:348: in serialize
    return self._serialize(value, attr, obj, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <fields.PolyField(dump_default=<marshmallow.missing>, attribute=None, 
validate=None, required=False, load_only=False, ...equired': 'Missing data for 
required field.', 'null': 'Field may not be null.', 'validator_failed': 
'Invalid value.'})>
value = <tests.shapes.Rectangle object at 0x7fc64804d730>, key = 'shape'
obj = Sticker(shape=<tests.shapes.Rectangle object at 0x7fc64804d730>, 
image='marshmallow.png', type='rectangle')
kwargs = {}, schema = <RectangleSchema(many=False)>

    def _serialize(self, value, key, obj, **kwargs):
        if value is None:
            return None
        try:
            if self.many:
                res = []
                for v in value:
                    schema = self.serialization_schema_selector(v, obj)
                    schema.context.update(getattr(self, 'context', {}))
                    res.append(schema.dump(v))
                return res
            else:
                schema = self.serialization_schema_selector(value, obj)
                schema.context.update(getattr(self, 'context', {}))
                return schema.dump(value)
        except Exception as err:
>           raise TypeError(
                'Failed to serialize object. Error: {0}\n'
                ' Ensure the serialization_schema_selector exists and '
                ' returns a Schema and that schema'
                ' can serialize this value {1}'.format(err, value))
E           TypeError: Failed to serialize object. Error: 'NoneType' object is 
not iterable
E            Ensure the serialization_schema_selector exists and  returns a 
Schema and that schema can serialize this value <tests.shapes.Rectangle object 
at 0x7fc64804d730>

marshmallow_polyfield/polyfield.py:77: TypeError
=============================== warnings summary ===============================
tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield
  /usr/lib/python3/dist-packages/_pytest/python.py:163: 
PytestReturnNotNoneWarning: Expected None, but 
tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield 
returned [None, None], which will be an error in a future version of pytest.  
Did you mean to use `assert` instead of `return`?
    warnings.warn(

tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_none
  /usr/lib/python3/dist-packages/_pytest/python.py:163: 
PytestReturnNotNoneWarning: Expected None, but 
tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_none 
returned [None, None], which will be an error in a future version of pytest.  
Did you mean to use `assert` instead of `return`?
    warnings.warn(

tests/test_deserialization.py::TestPolyField::test_deserailize_polyfield_none_required
  /usr/lib/python3/dist-packages/_pytest/python.py:163: 
PytestReturnNotNoneWarning: Expected None, but 
tests/test_deserialization.py::TestPolyField::test_deserailize_polyfield_none_required
 returned [None, None], which will be an error in a future version of pytest.  
Did you mean to use `assert` instead of `return`?
    warnings.warn(

tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_invalid_type_error
  /usr/lib/python3/dist-packages/_pytest/python.py:163: 
PytestReturnNotNoneWarning: Expected None, but 
tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_invalid_type_error
 returned [None, None], which will be an error in a future version of pytest.  
Did you mean to use `assert` instead of `return`?
    warnings.warn(

tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_invalid_validation_error
  /usr/lib/python3/dist-packages/_pytest/python.py:163: 
PytestReturnNotNoneWarning: Expected None, but 
tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_invalid_validation_error
 returned [None, None], which will be an error in a future version of pytest.  
Did you mean to use `assert` instead of `return`?
    warnings.warn(

tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_invalid_generic_error
  /usr/lib/python3/dist-packages/_pytest/python.py:163: 
PytestReturnNotNoneWarning: Expected None, but 
tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_invalid_generic_error
 returned [None, None], which will be an error in a future version of pytest.  
Did you mean to use `assert` instead of `return`?
    warnings.warn(

tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_invalid_schema_returned_is_invalid
  /usr/lib/python3/dist-packages/_pytest/python.py:163: 
PytestReturnNotNoneWarning: Expected None, but 
tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_invalid_schema_returned_is_invalid
 returned [None, None], which will be an error in a future version of pytest.  
Did you mean to use `assert` instead of `return`?
    warnings.warn(

tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_errors
  /usr/lib/python3/dist-packages/_pytest/python.py:163: 
PytestReturnNotNoneWarning: Expected None, but 
tests/test_deserialization.py::TestPolyField::test_deserialize_polyfield_errors 
returned [None, None], which will be an error in a future version of pytest.  
Did you mean to use `assert` instead of `return`?
    warnings.warn(

tests/test_deserialization.py::TestPolyFieldDisambiguationByProperty::test_deserialize_polyfield
  /usr/lib/python3/dist-packages/_pytest/python.py:163: 
PytestReturnNotNoneWarning: Expected None, but 
tests/test_deserialization.py::TestPolyFieldDisambiguationByProperty::test_deserialize_polyfield
 returned [None, None], which will be an error in a future version of pytest.  
Did you mean to use `assert` instead of `return`?
    warnings.warn(

tests/test_serialization.py::test_serializing_named_tuple
  
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_marshmallow-polyfield/build/tests/test_serialization.py:27:
 ChangedInMarshmallow4Warning: `Field` should not be instantiated. Use 
`fields.Raw` or  another field subclass instead.
    field = fields.Field()

tests/test_serialization.py::test_serializing_polyfield_None
  /usr/lib/python3/dist-packages/_pytest/python.py:163: 
PytestReturnNotNoneWarning: Expected None, but 
tests/test_serialization.py::test_serializing_polyfield_None returned [None, 
None], which will be an error in a future version of pytest.  Did you mean to 
use `assert` instead of `return`?
    warnings.warn(

tests/test_serialization.py::test_invalid_polyfield
  /usr/lib/python3/dist-packages/_pytest/python.py:163: 
PytestReturnNotNoneWarning: Expected None, but 
tests/test_serialization.py::test_invalid_polyfield returned [None, None], 
which will be an error in a future version of pytest.  Did you mean to use 
`assert` instead of `return`?
    warnings.warn(

../../../../../../usr/lib/python3/dist-packages/_pytest/cacheprovider.py:475
  /usr/lib/python3/dist-packages/_pytest/cacheprovider.py:475: 
PytestCacheWarning: could not create cache path 
/dev/.pytest_cache/v/cache/nodeids: [Errno 13] Permission denied: 
'/dev/pytest-cache-files-yosx16aa'
    config.cache.set("cache/nodeids", sorted(self.cached_nodeids))

../../../../../../usr/lib/python3/dist-packages/_pytest/cacheprovider.py:429
  /usr/lib/python3/dist-packages/_pytest/cacheprovider.py:429: 
PytestCacheWarning: could not create cache path 
/dev/.pytest_cache/v/cache/lastfailed: [Errno 13] Permission denied: 
'/dev/pytest-cache-files-rp2itp0t'
    config.cache.set("cache/lastfailed", self.lastfailed)

../../../../../../usr/lib/python3/dist-packages/_pytest/stepwise.py:51
  /usr/lib/python3/dist-packages/_pytest/stepwise.py:51: PytestCacheWarning: 
could not create cache path /dev/.pytest_cache/v/cache/stepwise: [Errno 13] 
Permission denied: '/dev/pytest-cache-files-cxb835s0'
    session.config.cache.set(STEPWISE_CACHE_DIR, [])

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED 
../../../../../../dev/tests/test_serialization.py::test_serializing_polyfield_rectangle
FAILED 
../../../../../../dev/tests/test_serialization.py::test_serializing_polyfield_many
FAILED 
../../../../../../dev/tests/test_serialization.py::test_serializing_polyfield_by_parent_type
================== 3 failed, 16 passed, 15 warnings in 0.10s ===================
E: pybuild pybuild:389: test: plugin distutils failed with: exit code=1: cd 
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_marshmallow-polyfield/build; python3.13 
-m pytest -c /dev/null
dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p "3.12 
3.13" returned exit code 13
make: *** [debian/rules:10: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
--------------------------------------------------------------------------------

The above is just how the build ends and not necessarily the most relevant part.
If required, the full build log is available here:

https://people.debian.org/~sanvila/build-logs/202502/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you could not reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:python-marshmallow-polyfield, so that this 
is still
visible in the BTS web page for this package.

Thanks.

Reply via email to