• Bug#1098600: python-marshmallow-polyfield: FTBFS: E TypeError: Failed t

    From Santiago Vila@21:1/5 to All on Sat Feb 22 00:40:20 2025
    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'

    [continued in next message]

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Colin Watson@21:1/5 to All on Mon Feb 24 02:20:01 2025
    Control: tag -1 pending

    Hello,

    Bug #1098600 in python-marshmallow-polyfield reported by you has been fixed in the
    Git repository and is awaiting an upload. You can see the commit
    message below and you can check the diff of the fix at:

    https://salsa.debian.org/python-team/packages/python-marshmallow-polyfield/-/commit/86fad353e3f275c147fc4f26283d9989d67144ed

    ------------------------------------------------------------------------
    Update upstream source from tag 'upstream/5.11'

    Update to upstream version '5.11'
    with Debian dir d415ccc3d7dce96609bc1418e0fc2fd88ba8f822

    Closes: #1098600 ------------------------------------------------------------------------

    (this message was generated automatically)
    --
    Greetings

    https://bugs.debian.org/1098600

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Debian Bug Tracking System@21:1/5 to All on Mon Feb 24 02:20:01 2025
    Processing control commands:

    tag -1 pending
    Bug #1098600 [src:python-marshmallow-polyfield] python-marshmallow-polyfield: FTBFS: E TypeError: Failed to serialize object. Error: 'NoneType' object is not iterable
    Added tag(s) pending.

    --
    1098600: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1098600
    Debian Bug Tracking System
    Contact owner@bugs.debian.org with problems

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Debian Bug Tracking System@21:1/5 to All on Mon Feb 24 02:40:01 2025
    This is a multi-part message in MIME format...

    Your message dated Mon, 24 Feb 2025 01:34:25 +0000
    with message-id <E1tmNMX-00H39x-LH@fasolo.debian.org>
    and subject line Bug#1098600: fixed in python-marshmallow-polyfield 5.11-1
    has caused the Debian Bug report #1098600,
    regarding python-marshmallow-polyfield: FTBFS: E TypeError: Failed to serialize object. Error: 'NoneType' object is not iterable
    to be marked as done.

    This means that you claim that the problem has been dealt with.
    If this is not the case it is now your responsibility to reopen the
    Bug report if necessary, and/or fix the problem forthwith.

    (NB: If you are a system administrator and have no idea what this
    message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@bugs.debian.org
    immediately.)


    --
    1098600: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1098600
    Debian Bug Tracking System
    Contact owner@bugs.debian.org with problems

    Received: (at submit) by bugs.debian.org; 21 Feb 2025 23:28:41 +0000 X-Spam-Checker-Version: SpamAssassin 3.4.6-bugs.debian.org_2005_01_02
    (2021-04-09) on buxtehude.debian.org
    X-Spam-Level:
    X-Spam-Status: No, score=-121.6 required=4.0 tests=ALL_TRUSTED,BAYES_00,
    BODY_INCLUDES_PACKAGE,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,
    DKIM_VALID_AU,DKIM_VALID_EF,FROMDEVELOPER,HAS_PACKAGE,
    USER_IN_DKIM_WELCOMELIST,USER_IN_DKIM_WHITELIST,WEIRD_PORT,
    X_DEBBUGS_CC autolearn=ham autolearn_force=no
    version=3.4.6-bugs.debian.org_2005_01_02
    X-Spam-Bayes: score:0.0000 Tokens: new, 94; hammy, 150; neutral, 294; spammy,
    0. spammytokens: hammytokens:0.000-+--python3, 0.000-+--trixie,
    0.000-+--pkgbuilddir, 0.000-+--PKGBUILDDIR, 0.000-+--sk:dh_auto Return-path: <sanvila@debian.org>
    Received: from muffat.debian.org ([2607:f8f0:614:1::1274:33]:38452)
    from C=NA,ST=NA,L=