Skip to content

Commit

Permalink
another minor fix and bump release.
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiomb2 committed Sep 25, 2014
1 parent 9b0c220 commit 53db93d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion MultipartPostHandler.py
Expand Up @@ -106,7 +106,9 @@ def multipart_encode(vars, files, boundary = None, buffer = None):
buffer.write('Content-Disposition: form-data; name="%s"' % key)
if value is None:
value = ""
buffer.write('\r\n\r\n' + value + '\r\n')
# if type(value) is not str, we need str(value) to not error with cannot concatenate 'str'
# and 'dict' or 'tuple' or somethingelse objects
buffer.write('\r\n\r\n' + str(value) + '\r\n')
for(key, fd) in files:
file_size = os.fstat(fd.fileno())[stat.ST_SIZE]
filename = fd.name.split('/')[-1]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -2,7 +2,7 @@
setup(
name = "MultipartPostHandler2",
py_modules = ['MultipartPostHandler'],
version = "0.1.4",
version = "0.1.5",
description = "A handler for urllib2 to enable multipart form uploading",
license = "LGPLv2.1+",
author = "Will Holcomb",
Expand Down

0 comments on commit 53db93d

Please sign in to comment.