Opened 4 years ago
Closed 4 years ago
#5986 closed defect (fixed)
Bug reporter broken: error in new locale.getdefaultlocale() code
| Reported by: | Tom Goddard | Owned by: | Greg Couch |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | Infrastructure | Version: | |
| Keywords: | Cc: | chimerax-programmers | |
| Blocked By: | Blocking: | ||
| Notify when closed: | Platform: | all | |
| Project: | ChimeraX |
Description
Bug reporter has been broken on Mac for the last 16 days in daily builds due to a change in the bug reporter code.
UCSF ChimeraX version: 1.4.dev202201200604 (2022-01-20)
© 2016-2021 Regents of the University of California. All rights reserved.
How to cite UCSF ChimeraX
Traceback (most recent call last):
File "/Users/goddard/Desktop/ChimeraX Jan 20 2022.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/bug_reporter/bug_reporter_gui.py", line 375, in <lambda>
mw.add_menu_entry(Help, 'Report a Bug', lambda: show_bug_reporter(session),
File "/Users/goddard/Desktop/ChimeraX Jan 20 2022.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/bug_reporter/bug_reporter_gui.py", line 367, in show_bug_reporter
tool = BugReporter(session, tool_name)
File "/Users/goddard/Desktop/ChimeraX Jan 20 2022.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/bug_reporter/bug_reporter_gui.py", line 115, in init
info += f"\n\nLocale: {'.'.join(locale.getdefaultlocale())}\n"
TypeError: sequence item 0: expected str instance, NoneType found
TypeError: sequence item 0: expected str instance, NoneType found
File "/Users/goddard/Desktop/ChimeraX Jan 20 2022.app/Contents/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/chimerax/bug_reporter/bug_reporter_gui.py", line 115, in init
info += f"\n\nLocale: {'.'.join(locale.getdefaultlocale())}\n"
See log for complete Python traceback.
Change History (3)
comment:1 by , 4 years ago
| Status: | assigned → feedback |
|---|
follow-up: 2 comment:2 by , 4 years ago
On macOS 10.15.7 import locale locale.getdefaultlocale() (None, 'UTF-8') getdefaultlocale() documentation says the tuple values can be None.
comment:3 by , 4 years ago
| Resolution: | → fixed |
|---|---|
| Status: | feedback → closed |
Fixed. See https://bugs.python.org/issue18378 for a discussion of this problem.
The old code was:
info += f"\n\nLocale: {locale.getdefaultlocale()}\n". What does locale.getdefaultlocale() return on macOS? The documentation for locale.getdefaultlocale says it returns a tuple.