0

I am trying to update anonymize slide (which deletes slide labels from scanned virtual slides) to work with Python3. It was written for Python2.6 or 2.7. I don't think that python version compatibility is the problem here, though I could be wrong. Here's the code giving me the error:

class TiffFile(file):
    def __init__(self, path):
        file.__init__(self, path, 'r+b')

TypeError: __init__() takes 2 positional arguments but 4 were given

I haven't used classes and methods too much, so these multiple init layers are confusing for me. Hopefully, the overall code will compile if this issue is fixed.

Benyamin Jafari
  • 27,880
  • 26
  • 135
  • 150
LobstaBoy
  • 515
  • 1
  • 3
  • 10
  • The problem isn't here - it is where you initialized a TiffFile. – MarkReedZ Feb 13 '19 at 04:18
  • I don't think TiffFile is initialized anywhere. The only other places where TiffFile appears is in the form (for example): def do_aperio_svs(filename): with TiffFile(filename) as fh: # Check for SVS file try: ... – LobstaBoy Feb 13 '19 at 04:27
  • What do you think `TiffFile(filename)` *is*, if not an initialization? One of the places like that evidently has three parameters given, instead of one. – jasonharper Feb 13 '19 at 04:55
  • The error happens when the TiffFile class is created, in the lines of code above. I have not gotten to the point to try to initialize any specific TiffFile. – LobstaBoy Feb 13 '19 at 17:26

0 Answers0