-
-
Notifications
You must be signed in to change notification settings - Fork 176
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
Fix vText.__repr__
BytesWarning
#554
Conversation
@@ -719,7 +719,7 @@ def __new__(cls, value, encoding=DEFAULT_ENCODING): | |||
return self | |||
|
|||
def __repr__(self): | |||
return f"vText('{self.to_ical()}')" | |||
return f"vText('{self.to_ical()!r}')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The !r
approach preserves existing behavior. Depending on desired outcome, another fix would be
return f"vText('{self.to_ical()!r}')" | |
return f"vText('{self.to_ical().decode(self.encoding)}')" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the decode
version better
hey, big thanks for the PR! Since the ical text is stored as bytes internally, I think having bytes explicitly in A Also, please fill out the CHANGELOG and add yourself to CREDITS as per CONTRIBUTING |
Exposed by running in `python3 -b` mode.
Agree, that's (and for no behavioral changes) why I opted for the
Kind of, but then again I don't know if the
Done. |
Thanks for the PR :) |
This is part of release 5.0.8 |
Exposed by running in
python3 -b
mode.