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
Doubled backslash in repr() method for unicode #43094
Comments
Here is an issue that caused Kid templates (used by The problem shows up with the following code: class s1:
def __repr__(self):
return '\\n'
class s2:
def __repr__(self):
return u'\\n' print repr(s1()), repr(s2()) I get the following results: Python 2.3.5: \n \n In the output for Python 2.4.3c1, the backslash in the My vague guess is that the issue may have crept in with -- Christoph |
Logged In: YES Confirmed - it's also broken in the trunk, and backing out Thanks for the bug report! |
Logged In: YES Attached a patch for the test case to be added with fix. |
Logged In: YES Looking the C code, unicode_repr is doing correct. ------------------------------------------------------------------------
|
Logged In: YES Found it!: |
Logged In: YES I'm confused how a checkin from 5+ years ago broke a change Or am I misunderstanding you? |
Logged In: YES Because unicode-escape codec didn't escape \, |
Logged In: YES We need to retain the old behaviour, but also fix the bug. |
Logged In: YES Ok. After talking to perky, I reverted the fix for 1379994 Thanks for the bug report. Man, unicode and repr is a twisty |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: