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

PR: Save file with original encoding if possible #3929

Merged
merged 1 commit into from
Jan 7, 2017

Conversation

rlaverde
Copy link
Member

@rlaverde rlaverde commented Jan 7, 2017

Fixes #3753


encodings.write() will try to save the file with the original encoding as first option.

@rlaverde rlaverde changed the title Save file with original encoding if possible PR: Save file with original encoding if possible Jan 7, 2017
@ccordoba12 ccordoba12 added this to the v3.1 milestone Jan 7, 2017
@ccordoba12
Copy link
Member

Great job, now this works as expected :-)

@ccordoba12 ccordoba12 merged commit aaf345c into spyder-ide:3.x Jan 7, 2017
ccordoba12 added a commit that referenced this pull request Jan 7, 2017
@rlaverde rlaverde deleted the save-original-encoding branch January 7, 2017 16:54
if orig_coding:
try:
return text.encode(orig_coding), orig_coding
except UnicodeError:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rlaverde, I failed to see that in all other places we except in two errors: UnicodeError and LookupError. This shouldn't be an exception.

Please fix that in another PR.

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.

2 participants