Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failure with Python 3.13 #846

Closed
tillea opened this issue Dec 15, 2024 · 3 comments · Fixed by #847
Closed

Test failure with Python 3.13 #846

tillea opened this issue Dec 15, 2024 · 3 comments · Fixed by #847

Comments

@tillea
Copy link

tillea commented Dec 15, 2024

Problem description

The Debian package received a bug report about a failure of the test suite.

Steps/code to reproduce the problem

I reproduced the issue in the CI of the Debian development platform which reproduces the issue:

____________________ WriterTest.test_nonexisting_container _____________________
self = <[AttributeError("'Writer' object has no attribute '_blob'") raised in repr()] Writer object at 0x7f46b7e3fa90>
    def __repr__(self):
        return "%s(container=%r, blob=%r, min_part_size=%r)" % (
            self.__class__.__name__,
            self._container_name,
>           self._blob.blob_name,
            self._min_part_size
        )
E       AttributeError: 'Writer' object has no attribute '_blob'
smart_open/azure.py:538: AttributeError

The CI contains the full build log to inform you about all involved versions.

Versions

Please provide the output of:

platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0

The former package smart_open 7.0.5-1 was building fine using Python 3.12

Kind regards, Andreas.

@ddelange
Copy link
Contributor

ddelange commented Dec 15, 2024

Interesting for two reasons:

  • the test should fail on hitting this call during Writer.__init__, but apparently it doesn't, or it does and py313 tries to do a repr for the traceback before pytest can catch it? edit: looks like py313 does a repr on the Writer despite init not having completed successfully. repr should be only called on initialized objects, why is py313/pytest doing this?
  • the Writer always has _blob populated, so I see no reason for repr to fail. edit: see above

@ddelange
Copy link
Contributor

this really is a python 3.13 thing: #847 (comment)

pytest only calls repr to build the traceback.

@ddelange
Copy link
Contributor

@tillea smart_open 7.1.0 has been released

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 a pull request may close this issue.

2 participants