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

Fix ValueError: invalid PNG header on Windows #5182

Merged
merged 1 commit into from Oct 5, 2015
Merged

Fix ValueError: invalid PNG header on Windows #5182

merged 1 commit into from Oct 5, 2015

Conversation

cgohlke
Copy link
Contributor

@cgohlke cgohlke commented Oct 4, 2015

On Windows the urlparse(...).scheme != '' test for URLs does not work.
For file names the drive letter is returned as scheme.

See also #5071.

This fixes one test failure on Windows:

======================================================================
ERROR: matplotlib.tests.test_image.test_imread_pil_uint16
----------------------------------------------------------------------
Traceback (most recent call last):
  File "X:\Python34\lib\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "X:\Python34\lib\site-packages\matplotlib\testing\decorators.py", line 53, in failer
    result = f(*args, **kwargs)
  File "X:\Python34\lib\site-packages\matplotlib\tests\test_image.py", line 95, in test_imread_pil_uint16
    'baseline_images', 'test_image', 'uint16.tif'))
  File "X:\Python34\lib\site-packages\matplotlib\pyplot.py", line 2290, in imread
    return _imread(*args, **kwargs)
  File "X:\Python34\lib\site-packages\matplotlib\image.py", line 1324, in imread
    return handler(fd)
ValueError: invalid PNG header

On Windows the `urlparse(...).scheme != ''` test for URLs does not work.
For file names the drive letter is returned as scheme.
WeatherGod added a commit that referenced this pull request Oct 5, 2015
Fix `ValueError: invalid PNG header` on Windows
@WeatherGod WeatherGod merged commit c01ed60 into matplotlib:master Oct 5, 2015
@tacaswell
Copy link
Member

@WeatherGod please backport

@WeatherGod
Copy link
Member

Ok, I think I did it right:

[centos6] [broot@rd22 matplotlib]$ git cherry-pick 3e28138
Finished one cherry-pick.
[v1.5.x 6107fb5] Fix ValueError: invalid PNG header on Windows
 Author: Christoph Gohlke <cgohlke@uci.edu>
 1 files changed, 1 insertions(+), 1 deletions(-)
[centos6] [broot@rd22 matplotlib]$ git push origin v1.5.x 
Counting objects: 9, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 2.72 KiB, done.
Total 5 (delta 2), reused 3 (delta 1)
To git@github.com:matplotlib/matplotlib
   c8eea31..6107fb5  v1.5.x -> v1.5.x

@tacaswell
Copy link
Member

I usually cherry-pick the merge commit, git cherry-pick -m 1 c01ed60 which will work if the PR has multiple commits.

@WeatherGod
Copy link
Member

Ah, that's what I was doing wrong! I was referencing the PR's commit when I
tried it, not the merge commit. Ok, good to know going forward.

On Mon, Oct 5, 2015 at 3:05 PM, Thomas A Caswell notifications@github.com
wrote:

I usally cherry-pick the merge commit, git cherry-pick -m 1 c01ed60 which
will work if the PR has multiple commits.


Reply to this email directly or view it on GitHub
#5182 (comment)
.

@QuLogic QuLogic added this to the next point release (1.5.0) milestone Oct 24, 2015
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

4 participants