You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to add a pdf from a file using pdf.addFromFile(open(f, "rb"))
I get this error 'file' object has no attribute 'encode'.
Taking a look at the code, I saw that self.addFromURI(f) is always called, even when f is a file-like obj. Shouldn't the code
def addFromFile(self, f):
if hasattr(f, "read"):
self.files.append(f)
self.addFromURI(f)
be changed to
def addFromFile(self, f):
if hasattr(f, "read"):
self.files.append(f)
else:
self.addFromURI(f)
The text was updated successfully, but these errors were encountered:
When I try to add a pdf from a file using
pdf.addFromFile(open(f, "rb"))
I get this error
'file' object has no attribute 'encode'
.Taking a look at the code, I saw that
self.addFromURI(f)
is always called, even when f is a file-like obj. Shouldn't the codebe changed to
The text was updated successfully, but these errors were encountered: