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

PerceptualDiff and Python 3.4.1 exception #38

Closed
DevOptimusPrime opened this issue Jan 16, 2015 · 7 comments
Closed

PerceptualDiff and Python 3.4.1 exception #38

DevOptimusPrime opened this issue Jan 16, 2015 · 7 comments

Comments

@DevOptimusPrime
Copy link

Have some prototype tests written using Needle and Python 3.4.1. When the tests run with the default image comparison setting they run fine. When I added PerceptualDiff to the tests, an ugly exception gets thrown coming out of PIL.

Traceback (most recent call last):
File "D:\Temp\TestDev\Needle_Tests_Workflow\Needle_Tests_Workflow\Needle_Tests_Workflow.py", line 42, in test_loginPage
self.assertScreenshot('body', 'body')
File "D:\Python34\lib\site-packages\needle\cases.py", line 128, in assertScreenshot
pass
File "D:\Python34\lib\contextlib.py", line 66, in exit
next(self.gen)
File "D:\Python34\lib\site-packages\needle\cases.py", line 198, in compareScreenshot
self.engine.assertSameFiles(output_file, baseline_file, threshold)
File "D:\Python34\lib\site-packages\needle\engines\perceptualdiff_engine.py", line 16, in assertSameFiles
width, height = Image.open(open(output_file)).size
File "D:\Python34\lib\site-packages\PIL\Image.py", line 2255, in open
prefix = fp.read(16)
File "D:\Python34\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
nose.proxy.UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 49: character maps to

@acdha
Copy link
Collaborator

acdha commented Jan 16, 2015

It looks like this was fixed in the source last July:

https://github.com/bfirsh/needle/commits/master/needle/engines/perceptualdiff_engine.py

Is it possible that you have a version earlier than 0.2.2 installed?

@DevOptimusPrime
Copy link
Author

I've got 0.2.2 installed according to PIP - I initially installed maybe 3 months ago.

@jphalip
Copy link
Collaborator

jphalip commented Jan 16, 2015

It looks like that fix was pushed after the 0.2.2 release, so we'd need to cut a new release. I could do that in the next couple of days unless someone beats me to it :)

@jphalip
Copy link
Collaborator

jphalip commented Jan 18, 2015

I've just released version 0.2.3. Could you please update and check if that fixes it? Thanks!

@DevOptimusPrime
Copy link
Author

Will do first thing tomorrow - thanks !

@DevOptimusPrime
Copy link
Author

Looks good! Thanks so much for pushing an update that quickly, it is appreciated!

@jphalip
Copy link
Collaborator

jphalip commented Jan 20, 2015

Great, thanks for checking!

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

No branches or pull requests

3 participants