Commit a9f1e82f9f7c5e6e4c6ad332ca321924cf420a7d

Authored by Thiago Franco de Moraes
1 parent b0873f22
Exists in master

Handling unicode error when writting session file

Showing 1 changed file with 4 additions and 1 deletions   Show diff stats
invesalius/session.py
@@ -201,7 +201,10 @@ class Session(object): @@ -201,7 +201,10 @@ class Session(object):
201 '.invesalius', 'config.cfg') 201 '.invesalius', 'config.cfg')
202 202
203 configfile = codecs.open(path, 'wb', SESSION_ENCODING) 203 configfile = codecs.open(path, 'wb', SESSION_ENCODING)
204 - config.write(configfile) 204 + try:
  205 + config.write(configfile)
  206 + except UnicodeDecodeError:
  207 + pass
205 configfile.close() 208 configfile.close()
206 209
207 def __add_to_list(self, item): 210 def __add_to_list(self, item):