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

Catch exception when encoding errorr #65

Open
wants to merge 1 commit into
base: creator
Choose a base branch
from

Conversation

PatriceJiang
Copy link

@PatriceJiang PatriceJiang commented Apr 21, 2020

@minggo 麻烦合并下

@@ -155,6 +155,10 @@ def get_current_string(self, key):
ret= key

if isinstance(ret, unicode):
ret = ret.encode(self.encoding)
try:
ret = ret.encode(self.encoding)
Copy link
Author

Choose a reason for hiding this comment

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

Encoding error should not stop other procedure

@@ -1685,7 +1685,7 @@ def backup(self, file_name=None, backup_name=None):
if not backup_name:
backup_name = "%s.%s.backup" % (file_name, datetime.datetime.now().strftime('%d%m%y-%H%M%S'))

shutil.copy2(file_name, backup_name)
Copy link
Author

Choose a reason for hiding this comment

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

copy2 will try to copy file meta info, which may cause permission error.

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.

1 participant