Skip to content

Commit 9fb1f6a

Browse files
committed
Fix compatibility with python3 in putFile method
in python3 os.read returns byte object not a string which caused writing loop to be endless by adding b'' comparison we hold compatibility both with python2 and python3
1 parent 48acbc8 commit 9fb1f6a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cupspk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ def putFile(self, *args, **kwds):
448448
if fd is not None:
449449
os.lseek (fd, 0, os.SEEK_SET)
450450
buf = os.read (fd, 512)
451-
while buf != '':
451+
while buf != '' and buf != b'':
452452
os.write (tmpfd, buf)
453453
buf = os.read (fd, 512)
454454
else:

0 commit comments

Comments
 (0)