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

python3 support claimed but not actually working #3

Closed
thomasgilgenast opened this issue Feb 17, 2020 · 1 comment
Closed

python3 support claimed but not actually working #3

thomasgilgenast opened this issue Feb 17, 2020 · 1 comment

Comments

@thomasgilgenast
Copy link
Member

specifically there are two errors currently breaking python3 compatibility:

the first is the use of urllib when downloading test images, which causes

Traceback (most recent call last):
  ...
  File "...\projectile\server.py", line 306, in main
    get_test_data()
  File "...\projectile\get_test_data.py", line 10, in main
    urllib.urlretrieve(
AttributeError: module 'urllib' has no attribute 'urlretrieve'

the second is the use of StringIO as the buffer for the image data between PIL and the Tornado response, which causes:

Traceback (most recent call last):
  File "...\tornado\web.py", line 1697, in _execute
    result = method(*self.path_args, **self.path_kwargs)
  File "...\projectile\server.py", line 41, in get
    self.get_slices(z, x, y)), s)))
  File "...\projectile\server.py", line 165, in send_image
    image.save(stream, format='png')
  File "...\PIL\Image.py", line 2084, in save
    save_handler(self, fp, filename)
  File "...\PIL\PngImagePlugin.py", line 807, in _save
    fp.write(_MAGIC)
TypeError: string argument expected, got 'bytes'
@thomasgilgenast
Copy link
Member Author

an easy way to avoid issues like this is to have tests for both py2 and py3 managed by something like tox; we currently have zero tests so even a simple smoketest test case would represent a lot of progress here

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

1 participant