Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 393659f

Browse files
committed
Patch for an Issue #1121
1 parent e73ac6c commit 393659f

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

lib/takeover/web.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,9 @@ def webInit(self):
213213
if success:
214214
break
215215

216+
if not directory:
217+
continue
218+
216219
uploaded = False
217220
directory = ntToPosixSlashes(normalizePath(directory))
218221

thirdparty/multipart/multipartpost.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@ def multipart_encode(vars, files, boundary = None, buf = None):
8181
buf = ''
8282

8383
for (key, value) in vars:
84-
buf += '--%s\r\n' % boundary
85-
buf += 'Content-Disposition: form-data; name="%s"' % key
86-
buf += '\r\n\r\n' + value + '\r\n'
84+
if key is not None and value is not None:
85+
buf += '--%s\r\n' % boundary
86+
buf += 'Content-Disposition: form-data; name="%s"' % key
87+
buf += '\r\n\r\n' + value + '\r\n'
8788

8889
for (key, fd) in files:
8990
file_size = os.fstat(fd.fileno())[stat.ST_SIZE] if isinstance(fd, file) else fd.len

0 commit comments

Comments
 (0)