New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 1396 bad png path #1556
Issue 1396 bad png path #1556
Conversation
@@ -4812,6 +4812,9 @@ def png(self, file, width=None, height=None, | |||
a.plot(array) | |||
a.png('example') # Overwrite a png file | |||
""" | |||
base = os.path.dirname(file) | |||
if base!="" and not os.path.exists(base): | |||
raise vcsError("Output path: %s does not exists" % base) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@doutriaux1 "does not exists" -> "does not exist"
@@ -4812,6 +4812,9 @@ def png(self, file, width=None, height=None, | |||
a.plot(array) | |||
a.png('example') # Overwrite a png file | |||
""" | |||
base = os.path.dirname(file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not put this block of code in try catch instead of checking of the file exists? In general thats a better practice
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it does not fail, that is actually the issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aashish24 are you suggesting we create the subdirectory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I was not.
LGTM 👍 |
No description provided.