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

Update for Python 3 #4

Open
PeterStrom opened this issue Dec 1, 2019 · 7 comments
Open

Update for Python 3 #4

PeterStrom opened this issue Dec 1, 2019 · 7 comments

Comments

@PeterStrom
Copy link

Whould be very nice with an update for Python 3.

@r3m0chop
Copy link

A quick 2to3 only indicates trivial changes. Hoping to test these shortly.

@r3m0chop
Copy link

r3m0chop commented Jan 2, 2020

The Python 2 inheritance of TiffFile from the file class, however, is another issue, as at: https://github.com/bgilbert/anonymize-slide/blob/master/anonymize-slide.py#L70:
class TiffFile(file):

Possible clues on approaching this might be found at: https://stackoverflow.com/questions/16085292/subclassing-file-objects-to-extend-open-and-close-operations-in-python-3

... most-specifically, see the following answer, with a similar requirement of supporting both Python 2.x and 3.x.:
https://stackoverflow.com/questions/16085292/subclassing-file-objects-to-extend-open-and-close-operations-in-python-3/16085830#16085830

Discussion around a different answer to the above (starting with "tl;dr Use a context manager", and using io.TextIOWrapper), at:
https://stackoverflow.com/questions/16085292/subclassing-file-objects-to-extend-open-and-close-operations-in-python-3/23796737#23796737
spawned a newly related question that might also be useful, at:
: https://stackoverflow.com/questions/33155741/subclassing-file-by-subclassing-io-textiowrapper-but-what-signature-does-its )

@r3m0chop
Copy link

Pull Request created (with only Python 3 support, since Python 2 now beyond life) at: PR #5

@jetic83
Copy link

jetic83 commented Jan 17, 2020

+1

1 similar comment
@a-dev-walker
Copy link

+1

@markemus
Copy link

@r3m0chop I added a pull request with an update for Python 3 a while back.

@kimalaacer
Copy link

I am trying this code on python 3.
getting this error. I tested the svs file and it opens with imagescope
still getting the error even if i use the absolute path.

C:\New folder>anonymize-slide.py test1.svs
Usage: anonymize-slide.py [options] file [file...]

anonymize-slide.py: error: specify a file

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

6 participants