[mod_python] Re: next beta

Nicolas Lehuen nicolas.lehuen at gmail.com
Mon Nov 14 10:08:31 EST 2005


Alexis, sorry but this is not the latest version. I've made some
changes to your version with the hope of simplifying the source code
and documenting it. Could you please try the version you'll find at :

http://svn.apache.org/viewcvs.cgi/httpd/mod_python/trunk/lib/python/mod_python/util.py?rev=332779&view=markup

Be sure to use the whole file, and not just read_to_boundary. Indeed,
I've introduced some changes in FieldStorage.__init__ that will be
required by read_to_boundary.

Thanks,
Nicolas

2005/11/14, Alexis Marrero <amarrero at mitre.org>:
> I did try the code and worked fine for my test file set (~55000 files).
>
> Like I stated in a previous email I made some changes based on Mike's
> concern about performance.
>
> So my last version of the function was, I tested it tih my file set
> and it passed all my tests.
>
> def read_to_boundary_new(self, req, boundary, file):
>      previous_delimiter = ''
>      bound_length = len(boundary)
>      while 1:
>          line = req.readline(readBlockSize)
>          if line[:bound_length] == boundary:
>              break
>
>          if line[-2:] == '\r\n':
>              file.write(previous_delimiter + line[:-2])
>              previous_delimiter = '\r\n'
>
>          elif line[-1:] == '\r':
>              file.write(previous_delimiter + line[:-1])
>              previous_delimiter = '\r'
>
>          elif line[-1:] == '\n':
>              if len(line[:-1]) > 0:
>                  file.write(previous_delimiter + line[:-1])
>                  previous_delimiter = '\n'
>
>              else:
>                  previous_delimiter += '\n'
>
>          else:
>              file.write(previous_delimiter + line)
>              previous_delimiter = ''
>
> /amn
> On Nov 14, 2005, at 8:34 AM, Jim Gallacher wrote:
>
> > It looks like Nicolas was very busy on the weekend cleaning up
> > remaining issues.  Has Alexis had a chance to test the new upload
> > code?
> >
> > Are there any objections to creating a 3.2.5 beta today?
> >
> > Jim
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>



More information about the Mod_python mailing list