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

Avoid problems in str.format() with char accents #269

Closed
wants to merge 1 commit into from

Conversation

davizucon
Copy link
Collaborator

@davizucon davizucon commented Aug 30, 2016

If you input a char like "é" or "ã" with terminalAdapter, in log method str.format(), if no unicode .format(() raise a error.

To reproduce, just clone master, and run with IN/OUT using TerminalAdapter.

Thanks

@gunthercox
Copy link
Owner

Hi @davizucon, sorry about the delay in reviewing this. I was able to confirm the issue, but I'm going to have to make a small change to the pull request so that it doesn't break Python 3 compatibility.

Python 3 has an improved way of dealing with strings which eliminates issues with unicode characters, however it breaks backwards compatibility with the string decode method.

Python 3:

'é'.decode('utf-8')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'str' object has no attribute 'decode'

Python 2.7:

'é'.decode('utf-8')

>>> u'\xe9'

@gunthercox
Copy link
Owner

This has been closed by 3576076

@gunthercox gunthercox closed this Sep 4, 2016
@davizucon davizucon deleted the accents-fix branch March 3, 2017 01:38
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 this pull request may close these issues.

None yet

2 participants