Applies "log to file" necessary fix, whether we're forcing it or not.

This commit is contained in:
Athanasius committed 2020-06-21 16:23:00 +01:00
1 parent 0d893c1c56
commit 1fbdfcc113
1 file changed
+1 -1
+1 -1
View File
@@ -800,7 +800,7 @@ if __name__ == "__main__":
if getattr(sys, 'frozen', False):
# By default py2exe tries to write log to dirname(sys.executable) which fails when installed
import tempfile
sys.stdout = sys.stderr = open(join(tempfile.gettempdir(), '%s.log' % appname), 'wt', 0) # unbuffered
sys.stdout = sys.stderr = open(join(tempfile.gettempdir(), '%s.log' % appname), 'wt', 1) # unbuffered not allowed for text in python3, so use line buffering
print('%s %s %s' % (applongname, appversion, strftime('%Y-%m-%dT%H:%M:%S', localtime())))
Translations.install(config.get('language') or None) # Can generate errors so wait til log set up