Opened 8 years ago
Closed 8 years ago
#723 closed defect (fixed)
accidentally trying to save image in dir w/o permission gives traceback
Reported by: | Elaine Meng | Owned by: | Tom Goddard |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | Input/Output | Version: | |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Notify when closed: | Platform: | all | |
Project: | ChimeraX |
Description
This is obviously user error, failure to specify a pathname where I have write permission, but I don't think it should give a traceback. It seems to be specific to images, that is, I don't get a similar traceback for saving a session.
save flowers.png
Traceback (most recent call last):
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chimerax/cmd_line/tool.py", line 178, in execute
cmd.run(cmd_text)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chimerax/core/commands/cli.py", line 2366, in run
result = ci.function(session, kw_args)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chimerax/core/commands/save.py", line 58, in save
fmt.export(session, filename, format, kw)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chimerax/core/io.py", line 160, in export
return self.export_func(*args, kw)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/chimerax/core/image.py", line 90, in save_image
i.save(path, fmt.pil_name, quality=quality)
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/PIL/Image.py", line 1823, in save
fp = builtins.open(filename, "w+b")
PermissionError: [Errno 13] Permission denied: 'flowers.png'
PermissionError: [Errno 13] Permission denied: 'flowers.png'
File "/Users/chimera/Applications/ChimeraX_Daily.app/Contents/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/PIL/Image.py", line 1823, in save
fp = builtins.open(filename, "w+b")
See log for complete Python traceback.
If you wish to report this error, send mail to chimerax-bugs@… and describe what you were doing and include a copy of the contents of the log.
Fixed.
Made all export IO errors omit the traceback.