Open PeterStrom opened 4 years ago
A quick 2to3
only indicates trivial changes. Hoping to test these shortly.
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 )
Pull Request created (with only Python 3 support, since Python 2 now beyond life) at: PR https://github.com/bgilbert/anonymize-slide/pull/5
+1
+1
@r3m0chop I added a pull request with an update for Python 3 a while back.
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
Whould be very nice with an update for Python 3.