Skip to content
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

Merged
merged 4 commits into from
Sep 23, 2015
Merged

Issue 1396 bad png path #1556

merged 4 commits into from
Sep 23, 2015

Conversation

doutriaux1
Copy link
Contributor

No description provided.

@@ -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)
Copy link
Member

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)
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I was not.

@aashish24
Copy link
Contributor

LGTM 👍

aashish24 added a commit that referenced this pull request Sep 23, 2015
@aashish24 aashish24 merged commit 2ff0ff5 into master Sep 23, 2015
@aashish24 aashish24 deleted the issue_1396_bad_png_path branch September 23, 2015 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants