Skip to content

Commit c8052b9

Browse files
authored
Merge pull request #1 from AdrianMos/ymodem
updated for python 3.0. Thanks for the patch!
2 parents d26b492 + cab8cc8 commit c8052b9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

xmodem/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,12 @@ def callback(total_packets, success_count, error_count)
305305
filename = filenames.pop()
306306
stream = open(filename, 'rb')
307307
stat = os.stat(filename)
308-
data = os.path.basename(filename) + NUL + str(stat.st_size)
308+
data = os.path.basename(filename).encode() + NUL + str(stat.st_size).encode()
309309
self.log.debug('ymodem sending : "%s" len:%d', filename, stat.st_size)
310310
else:
311311
# empty file name packet terminates transmission
312312
filename = ''
313-
data = ''
313+
data = ''.encode()
314314
stream = None
315315
self.log.debug('ymodem done, sending empty header.')
316316
if len(data) <= 128:

0 commit comments

Comments
 (0)