[ python-Bugs-1367631 ] maximum length not enforce in cgi.parse()

2005-11-27 Thread SourceForge.net
Bugs item #1367631, was opened at 2005-11-27 17:47
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1367631&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Andrew Rogers (adr26)
Assigned to: Nobody/Anonymous (nobody)
Summary: maximum length not enforce in cgi.parse()

Initial Comment:
I have a simple form in HTML to upload a file:

http://foo/cgi-bin/test.py"; 
enctype="multipart/form-data" method="post">

Please specify a file:







I use this to post to a CGI python script that looks 
like this:

import cgi
import cgitb; cgitb.enable()

cgi.maxlen = 50

print "Content-type: text/plain"
print

q = cgi.parse()
print q

I was expecting that cgi.pm would then throw an 
exception if I send a file > 50 bytes long to it. If 
I construct a FieldStorage object, it certainly
does:

form = cgi.FieldStorage()
print form

The issue is that in parse_multipart() in cgi.pm, if 
a part of a multi-part message does not have the 
Content-Length header, you read lines until you
get to the next boundary "--...", but don't honour 
maxlen whilst doing so. I'd consider this to be a bug 
and would even be happy to have a go at fixing
it as my first contribution to Python, should others 
concur with me... :-)


--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1367631&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1367631 ] maximum length not enforced in cgi.parse()

2005-11-27 Thread SourceForge.net
Bugs item #1367631, was opened at 2005-11-27 17:47
Message generated for change (Settings changed) made by adr26
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1367631&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Andrew Rogers (adr26)
Assigned to: Nobody/Anonymous (nobody)
>Summary: maximum length not enforced in cgi.parse()

Initial Comment:
I have a simple form in HTML to upload a file:

http://foo/cgi-bin/test.py"; 
enctype="multipart/form-data" method="post">

Please specify a file:







I use this to post to a CGI python script that looks 
like this:

import cgi
import cgitb; cgitb.enable()

cgi.maxlen = 50

print "Content-type: text/plain"
print

q = cgi.parse()
print q

I was expecting that cgi.pm would then throw an 
exception if I send a file > 50 bytes long to it. If 
I construct a FieldStorage object, it certainly
does:

form = cgi.FieldStorage()
print form

The issue is that in parse_multipart() in cgi.pm, if 
a part of a multi-part message does not have the 
Content-Length header, you read lines until you
get to the next boundary "--...", but don't honour 
maxlen whilst doing so. I'd consider this to be a bug 
and would even be happy to have a go at fixing
it as my first contribution to Python, should others 
concur with me... :-)


--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1367631&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1367814 ] loogger module locks

2005-11-27 Thread SourceForge.net
Bugs item #1367814, was opened at 2005-11-27 17:31
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1367814&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Chris Fuller (cfuller)
Assigned to: Nobody/Anonymous (nobody)
Summary: loogger module locks

Initial Comment:
I have an application that uses the logger
functionality, and the RotatingFileHandler class. If my
application is running, and another instance is
launched, it fails at the rollover step. I don't want
multiple instances running at once, so this is fine,
and even general, since the rollover must occur if an
instance is already running.

Rather than checking for a generic I/O error, however,
I'd like to use some sort of locking mechanism that is
less opaque. The locking provided won't work, since it
is blocking only: the application deadlocks if one ias
runnning already. Why doesn't it work like a normal
Lock() instance and take a blocking parameter?

I could use locking via the portalocker module from the
python cookbook (hmm, portable file locking would be a
nice thing to have in the standard library, the logger
module already does it anyway!) but I can't find anyway
to access the file descriptor!

Sure, I could workaround that. I could create a
RotatingFileHandler instance, roll over, close it, open
the file, pass it to StreamHandler, but python is way
more elegant than that.

For now, I'll just trap the rollover. Still very cool
stuff!


--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1367814&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Feature Requests-1367936 ] split() string method has two splitting algorithms

2005-11-27 Thread SourceForge.net
Feature Requests item #1367936, was opened at 2005-11-28 06:13
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1367936&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: crackwitz (crackwitz)
Assigned to: Nobody/Anonymous (nobody)
Summary: split() string method has two splitting algorithms

Initial Comment:
The docs of Python 2.4.2 for .split([sep [,maxsplit]]) say:
"If sep is not specified or is None, a different
splitting algorithm is applied."
I would like to see that behavior exposed and
consistent, i.e. stripping (new key strip=...?)
independent of whether sep is None or not.
Making it consistent could break existing code because
people already built on split()'s special behavior.
You could say strip=None by default and only keep
switching if strip==None.
I don't like this magic behavior though because there's
no reason for it to exist.

# this is now (Python v2.4.2)
' foo  bar '.split() # => ['foo', 'bar']
' foo  bar '.split(' ') # => ['', 'foo', '', 'bar', '']

# this is how I would like it to be
' foo  bar '.split(strip=True) # => ['foo', 'bar']
' foo  bar '.split(strip=False) # => ['', 'foo', '',
'bar', '']

# compatibility preserved (strip=None by default):
' foo  bar '.split(strip=None) # => ['foo', 'bar']
' foo  bar '.split(' ', strip=None) # => ['', 'foo',
'', 'bar', '']

what do you think?

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=355470&aid=1367936&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com