Debug: Include LANG and sys.getfilesystemencoding in error reports.
Also use an ordered dict to preserve env order.
This commit is contained in:
parent
aa6a9524e6
commit
566a10da4f
@ -16,6 +16,7 @@ errorreporting.py
|
|||||||
|
|
||||||
Patch the `traceback' module to print "self" with each stack frame.
|
Patch the `traceback' module to print "self" with each stack frame.
|
||||||
"""
|
"""
|
||||||
|
import collections
|
||||||
import sys
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
import platform
|
import platform
|
||||||
@ -127,7 +128,7 @@ def json_crash_report():
|
|||||||
exception['message'] = sanitize(str(exc_value))
|
exception['message'] = sanitize(str(exc_value))
|
||||||
except:
|
except:
|
||||||
exception['message'] = ""
|
exception['message'] = ""
|
||||||
|
|
||||||
exception['occurred_at'] = datetime.now().isoformat()
|
exception['occurred_at'] = datetime.now().isoformat()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -142,7 +143,7 @@ def json_crash_report():
|
|||||||
app_env['language'] = 'python'
|
app_env['language'] = 'python'
|
||||||
app_env['language_version'] = sys.version
|
app_env['language_version'] = sys.version
|
||||||
|
|
||||||
env = app_env['env'] = {}
|
env = app_env['env'] = collections.OrderedDict()
|
||||||
|
|
||||||
env['OS_NAME'] = os.name,
|
env['OS_NAME'] = os.name,
|
||||||
env['OS_VERSION'] = platform.version()
|
env['OS_VERSION'] = platform.version()
|
||||||
@ -150,6 +151,10 @@ def json_crash_report():
|
|||||||
env['OS_PLATFORM'] = platform.platform()
|
env['OS_PLATFORM'] = platform.platform()
|
||||||
env['OS_CPU'] = platform.processor()
|
env['OS_CPU'] = platform.processor()
|
||||||
|
|
||||||
|
env['FS_ENCODING'] = sys.getfilesystemencoding()
|
||||||
|
|
||||||
|
if 'LANG' in os.environ:
|
||||||
|
env['LANG'] = os.environ['LANG']
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from albow import root
|
from albow import root
|
||||||
|
Reference in New Issue
Block a user