ValueError: I/O operation on closed file in OpenSuSe/Windows while Multi-part encoding

Anonymous avatarAnonymous created an issue


there is a Problem while encoding a file in OpenSuSe and Windows, I tested it in Ubuntu and it works without a problem.

Any help will be very appreciated, thanks

Python 2.7, Poster 0.8.1


datagen, headers = multipart_encode(body) File "/usr/local/lib/python2.7/site-packages/poster/", line 411, in multipart_encode headers = get_headers(params, boundary) File "/usr/local/lib/python2.7/site-packages/poster/", line 311, in get_headers headers['Content-Length'] = str(get_body_size(params, boundary)) File "/usr/local/lib/python2.7/site-packages/poster/", line 302, in get_body_size size = sum(p.get_size(boundary) for p in MultipartParam.from_params(params)) File "/usr/local/lib/python2.7/site-packages/poster/", line 177, in from_params filetype=filetype, fileobj=value)) File "/usr/local/lib/python2.7/site-packages/poster/", line 108, in _init_ self.filesize = os.fstat(fileobj.fileno()).st_size ValueError: I/O operation on closed file

Comments (1)

  1. Chris AtLee

    (Reply via ch...Atle

    Can you send some sample code that exhibits this problem? It's hard to tell from the stack trace, but I suspect that perhaps the same file object is being used multiple places?

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.