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

str() on a FixedLengthError instance crashes with AttributeError #2

Open
dargueta opened this issue Jun 25, 2020 · 0 comments
Open
Labels

Comments

@dargueta
Copy link
Contributor

  • FWFFR version: 0.4.0
  • Python version: 3.7
  • Operating System: Ubuntu, OSX

Description

Tried calling str() on a caught exception and it blew up.

What I Did

>>> import fwffr                                                                                                                                                                                                

>>> str(fwffr.FixedLengthError("asdf"))                                                                                                                                                                         
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/diegoargueta/.pyenv/versions/3.7.6/envs/gds3/lib/python3.7/site-packages/fwffr.py", line 31, in __str__
    return self.message
AttributeError: 'FixedLengthError' object has no attribute 'message'

'FixedLengthError' object has no attribute 'message'

Either this should be an abstract base class or some tweaking is needed for rendering the error message.

@dargueta dargueta added the bug label Jun 25, 2020
kstark added a commit that referenced this issue Feb 9, 2022
The `message` attribute on ValueError has been deprecated since 2.6 and removed in Python 3. Explicitly add it ourselves for our subclasses. Fixes #2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant