208 """ |
208 """ |
209 if os.path.exists(fileName): |
209 if os.path.exists(fileName): |
210 try: |
210 try: |
211 with open(fileName, "rb") as inputFile: |
211 with open(fileName, "rb") as inputFile: |
212 data = inputFile.read() |
212 data = inputFile.read() |
213 except IOError: |
213 except OSError: |
214 return QByteArray() |
214 return QByteArray() |
215 |
215 |
216 if ( |
216 if ( |
217 Preferences.getWebBrowser("SyncEncryptData") and |
217 Preferences.getWebBrowser("SyncEncryptData") and |
218 (not Preferences.getWebBrowser("SyncEncryptPasswordsOnly") or |
218 (not Preferences.getWebBrowser("SyncEncryptPasswordsOnly") or |
273 with open(fileName, "wb") as outputFile: |
273 with open(fileName, "wb") as outputFile: |
274 outputFile.write(data) |
274 outputFile.write(data) |
275 if timestamp > 0: |
275 if timestamp > 0: |
276 os.utime(fileName, (timestamp, timestamp)) |
276 os.utime(fileName, (timestamp, timestamp)) |
277 return True, "" |
277 return True, "" |
278 except IOError as error: |
278 except OSError as error: |
279 return False, str(error) |
279 return False, str(error) |