This is an automated notification sent by LCG Savannah.
It relates to:
task #14902, project CDS Invenio
==============================================================================
LATEST MODIFICATIONS of task #14902:
==============================================================================
Update of task #14902 (project cdsware):
Status: None => Invalid
Open/Closed: Open => Closed
_______________________________________________________
Follow-up Comment #1:
Indeed this is not a correct pattern for file objects.
In C++ file objects evaluates to False once it's all read. In Python this is
not the case, while instead the file object support the iteration pattern:
fp = file(file_path, "wb")
for row in form_file:
fp.write(row)
and the loop ends once there are no more rows to read.
==============================================================================
OVERVIEW of task #14902:
==============================================================================
URL:
<http://savannah.cern.ch/task/?14902>
Summary: iterating over POSTed files does not work in wsgi
handler
Project: CDS Invenio
Submitted by: skaplun
Submitted on: 2010-04-09 07:27
Should Start On: 2010-04-09 00:00
Should be Finished on: 2010-04-09 00:00
Category: WebStyle
Priority: 5 - Normal
Status: Invalid
Privacy: Public
Percent Complete: 0%
Assigned to: skaplun
Open/Closed: Closed
Discussion Lock: Any
Effort: 0.00
_______________________________________________________
The following code:
fp = file(file_path, "wb")
while form_file:
fp.write(form_file.read(10240))
fp.close()
as form_file does evaluate to False when the end of the file is reached (like
canonical file objects do)
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: 2010-05-10 07:41 By: Samuele Kaplun <skaplun>
Indeed this is not a correct pattern for file objects.
In C++ file objects evaluates to False once it's all read. In Python this is
not the case, while instead the file object support the iteration pattern:
fp = file(file_path, "wb")
for row in form_file:
fp.write(row)
and the loop ends once there are no more rows to read.
_______________________________________________________
Carbon-Copy List:
CC Address | Comment
------------------------------------+-----------------------------
2195 | -SUB-
==============================================================================
This item URL is:
<http://savannah.cern.ch/task/?14902>
_______________________________________________
Message sent via/by LCG Savannah
http://savannah.cern.ch/