[issue3308] MinGW built extensions do not load (specified procedure cannot be found)

2008-07-06 Thread Roger Binns

Roger Binns <[EMAIL PROTECTED]> added the comment:

I didn't have a copy of depends.exe since it doesn't appear to come with
MinGW.  System is basically VirtualBox VM with fresh install of XP Pro
SP2, upgraded to SP3 and TortoiseSVN, Firefox, Xemacs, MinGW and Python
versions installed.

I found a GUI program named depends which is what I used to figure out
that the issue appeared to be localtime() missing in msvcr90.dll.  BTW
did you notice msg69367 and the attached file that shows the problem in
a trivial test case?

The gui depends program found the following issues:

- No localtime in msvcr90.dll
- DWMAPI.DLL not found (not mentioned on link line so no idea why
depends wants it)
- MPR.DLL & SHLWAPI.DLL are red but I don't know why (again not
mentioned on link line)

I think that the localtime() symbol is the underlying cause.  However
this isn't exactly Python's fault (Python's headers don't do anything to
the localtime symbol but there may be defines that cause "secure crt" to
be used which wants localtime_s to be used instead).  Maybe MinGW is
supposed to be redefining localtime to one of the _/32/64/s variants but
isn't.

In any event the net result is that if a Python extension uses current
MinGW and localtime() then it will compile and link correctly on Python
2.3, 2.4, 2.5, 2.6b1 & 3.0b1.  However it won't run on 2.6b1 or 3.0b1
due to some sort of mismatch between those versions of Python using new
MSVC runtime and/or MinGW.

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3308] MinGW built extensions do not load (specified procedure cannot be found)

2008-07-06 Thread Martin v. Löwis

Martin v. Löwis <[EMAIL PROTECTED]> added the comment:

Do you have a copy of depends.exe? If so, how does it resolve the DLLs
referenced in apsw.pyd?

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3119] pickle.py is limited by python's call stack

2008-07-06 Thread Ralf Schmitt

Changes by Ralf Schmitt <[EMAIL PROTECTED]>:


--
nosy: +schmir

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3046] Locking should be removed from the new buffer protocol

2008-07-06 Thread Gregory P. Smith

Changes by Gregory P. Smith <[EMAIL PROTECTED]>:


--
assignee:  -> teoliphant
nosy: +gregory.p.smith
priority:  -> critical

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3094] By default, HTTPSConnection should send header "Host: somehost" instead of "Host: somehost:443"

2008-07-06 Thread Gregory P. Smith

Gregory P. Smith <[EMAIL PROTECTED]> added the comment:

fixed in trunk r64771.

(and indeed the previous behavior was buggy in the extreemly rare event
that someone ran a https server on port 80 the :80 should have been
supplied).

--
assignee:  -> gregory.p.smith
keywords: +easy
nosy: +gregory.p.smith
resolution:  -> accepted
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue760475] asyncore.py and "handle_error"

2008-07-06 Thread Josiah Carlson

Josiah Carlson <[EMAIL PROTECTED]> added the comment:

Fixed for 2.6 in changelist 64768.
Fixed for 3.0 in changelist 64770.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1519] async_chat.__init__() parameters

2008-07-06 Thread Josiah Carlson

Josiah Carlson <[EMAIL PROTECTED]> added the comment:

Fixed for 2.6 in changelist 64768.
Fixed for 3.0 in changelist 64770.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue953599] asyncore misses socket closes when poll is used

2008-07-06 Thread Josiah Carlson

Josiah Carlson <[EMAIL PROTECTED]> added the comment:

Fixed for 2.6 in changelist 64768.
Fixed for 3.0 in changelist 64770.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3120] subprocess module truncates handles on AMD64

2008-07-06 Thread Gregory P. Smith

Changes by Gregory P. Smith <[EMAIL PROTECTED]>:


--
assignee:  -> gregory.p.smith
components: +Extension Modules
nosy: +gregory.p.smith
priority:  -> high
type:  -> behavior

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3001] RLock's are SLOW

2008-07-06 Thread Gregory P. Smith

Changes by Gregory P. Smith <[EMAIL PROTECTED]>:


--
components: +Interpreter Core, Library (Lib)
nosy: +gregory.p.smith
priority:  -> normal

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2277] MozillaCookieJar does not support Firefox3 cookie files

2008-07-06 Thread Gregory P. Smith

Gregory P. Smith <[EMAIL PROTECTED]> added the comment:

sounds like a good idea to add this.  yay firefox 3.  i'll review it.

--
assignee:  -> gregory.p.smith
components: +Library (Lib)
nosy: +gregory.p.smith
priority:  -> normal
type:  -> feature request
versions: +Python 2.6

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3210] subprocess.Popen does not release process handles if process cannot be started

2008-07-06 Thread Gregory P. Smith

Changes by Gregory P. Smith <[EMAIL PROTECTED]>:


--
assignee:  -> gregory.p.smith
components: +Library (Lib) -Extension Modules
nosy: +gregory.p.smith
priority:  -> normal
versions: +Python 2.6

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3183] sha modules & Modules/Setup.dist

2008-07-06 Thread Gregory P. Smith

Gregory P. Smith <[EMAIL PROTECTED]> added the comment:

seems harmless enough.  done in trunk r64769.

--
assignee:  -> gregory.p.smith
nosy: +gregory.p.smith
priority:  -> low
resolution:  -> fixed
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2480] eliminate recursion in pickling

2008-07-06 Thread Gregory P. Smith

Changes by Gregory P. Smith <[EMAIL PROTECTED]>:


--
dependencies: +pickle.py is limited by python's call stack

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3119] pickle.py is limited by python's call stack

2008-07-06 Thread Gregory P. Smith

Changes by Gregory P. Smith <[EMAIL PROTECTED]>:


--
superseder:  -> eliminate recursion in pickling

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3212] ssl module - should test for a wrong cert

2008-07-06 Thread Gregory P. Smith

Changes by Gregory P. Smith <[EMAIL PROTECTED]>:


--
assignee:  -> janssen
priority:  -> normal

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3308] MinGW built extensions do not load (specified procedure cannot be found)

2008-07-06 Thread Roger Binns

Roger Binns <[EMAIL PROTECTED]> added the comment:

I cleared all event categories, and then ran Python followed by the
import (which fails).  No events in any category appeared.

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue988761] re.split emptyok flag (fix for #852532)

2008-07-06 Thread Gregory P. Smith

Gregory P. Smith <[EMAIL PROTECTED]> added the comment:

take a look at the patch being worked on in issue #3262.

--
nosy: +gregory.p.smith

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3307] invalid check of _bsddb creation failure

2008-07-06 Thread Gregory P. Smith

Changes by Gregory P. Smith <[EMAIL PROTECTED]>:


--
assignee:  -> jcea
nosy: +jcea
priority:  -> normal
type:  -> crash

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3309] missing lock release in BZ2File_iternext()

2008-07-06 Thread Gregory P. Smith

Gregory P. Smith <[EMAIL PROTECTED]> added the comment:

Fixed in trunk r64767.

Needs backporting to release25-maint.

--
resolution:  -> accepted
type:  -> behavior
versions: +Python 2.5 -Python 2.6

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3308] MinGW built extensions do not load (specified procedure cannot be found)

2008-07-06 Thread Martin v. Löwis

Martin v. Löwis <[EMAIL PROTECTED]> added the comment:

Can you please check the event log at the point of failure, and report
any events it may have recorded?

--
nosy: +loewis

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1736101] asyncore should handle also ECONNABORTED in recv

2008-07-06 Thread Josiah Carlson

Josiah Carlson <[EMAIL PROTECTED]> added the comment:

Fixed in 3.0 .

--
resolution:  -> fixed
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3309] missing lock release in BZ2File_iternext()

2008-07-06 Thread Gregory P. Smith

Changes by Gregory P. Smith <[EMAIL PROTECTED]>:


--
assignee:  -> gregory.p.smith
keywords: +easy
nosy: +gregory.p.smith
priority:  -> normal

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1580] Use shorter float repr when possible

2008-07-06 Thread Guido van Rossum

Guido van Rossum <[EMAIL PROTECTED]> added the comment:

Here's a fixed patch, float2.diff. (The previous one tasted of an
earlier attempt.)

Added file: http://bugs.python.org/file10840/float2.diff

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3308] MinGW built extensions do not load (specified procedure cannot be found)

2008-07-06 Thread Roger Binns

Roger Binns <[EMAIL PROTECTED]> added the comment:

I can't prove it since Python gives no further information than a
procedure cannot be found, but using a bunch of other tools I think this
may be due at least to the use of localtime() and it not being present
in the msvcr90.dll but is in the vc version 7 dlls which is why earlier
versions of Python have no issue.

If the above is the case then I have no idea where the actual underlying
cause lies.  Is MinGW missing header information that should mangle
localtime() to one of the other variants used by msvc (_s suffix, _
prefix, 32/64 in there somewhere)?  Is the Python header causing issues?

Attached is a trivial extension providing the issue with localtime.

Added file: http://bugs.python.org/file10839/localtime.zip

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3300] urllib.quote and unquote - Unicode issues

2008-07-06 Thread Matt Giuca

Matt Giuca <[EMAIL PROTECTED]> added the comment:

Point taken. But the RFC certainly doesn't say that ISO-8859-1 should be
used. Since we're outputting a Unicode string in Python 3, we need to
decode with some encoding, and UTF-8 seems the most sensible and
standardised.
(Even the existing test case in test_urllib.py:466 uses a UTF-8-encoded
URL, and I had to fix it so it decodes into a meaningful string).

Having said that, it's possible that you may wish to use another
encoding, and legal to do so. Therefore, I'd suggest we add an
"encoding" argument to both quote and unquote, which defaults to "utf-8".

Note that in the current implementation, unquote is not an inverse of
quote, because quote uses UTF-8 to encode characters with code points >=
256, while unquote decodes them as ISO-8859-1. I think it's important
these two functions are inverses of each other.

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3311] block operation on closed socket/pipe for multiprocessing

2008-07-06 Thread STINNER Victor

New submission from STINNER Victor <[EMAIL PROTECTED]>:

_multiprocessing Connection methods don't check if handle is valid or 
not. If you close the socket/pipe, Python may crash on operations, 
especially in poll() on FD_SET(...handle, &rdfs).

Example of crash:
--
import _multiprocessing
obj = _multiprocessing.Connection(755)
obj.close()
obj.poll()
--

Attached patch is a proposition of fix to check handle in all 
Connection methods using the handle.

--
components: Library (Lib)
files: multiprocessing_closed.patch
keywords: patch
messages: 69365
nosy: haypo
severity: normal
status: open
title: block operation on closed socket/pipe for multiprocessing
versions: Python 2.6
Added file: http://bugs.python.org/file10838/multiprocessing_closed.patch

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3308] MinGW built extensions do not load (specified procedure cannot be found)

2008-07-06 Thread Roger Binns

Roger Binns <[EMAIL PROTECTED]> added the comment:

I figured maybe it was something to do with MSVC 90 dlls.  


C:\apsw>dir \*msvc*90* /s
 Volume in drive C has no label.
 Volume Serial Number is F4A5-1661

 Directory of C:\MinGW\lib

12/27/2007  08:23 AM   554,136 libmsvcr90.a
12/27/2007  08:23 AM   555,910 libmsvcr90d.a
   2 File(s)  1,110,046 bytes

 Directory of
C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_d08d0375

11/06/2007  08:23 PM   224,768 msvcm90.dll
11/07/2007  01:19 AM   568,832 msvcp90.dll
11/07/2007  01:19 AM   655,872 msvcr90.dll
   3 File(s)  1,449,472 bytes

 Directory of
C:\WINDOWS\WinSxS\x86_Microsoft.VC90.CRT_1fc8b3b9a1e18e3b_9.0.30411.0_x-ww_71382c73

04/10/2008  10:52 PM   225,280 msvcm90.dll
04/11/2008  04:32 AM   572,928 msvcp90.dll
04/11/2008  04:32 AM   655,872 msvcr90.dll
   3 File(s)  1,454,080 bytes

 Total Files Listed:
   8 File(s)  4,013,598 bytes
   0 Dir(s)  22,924,242,944 bytes free


Process Explorer shows Python 2.6 exe using MSVCR90.dll from the
71382c73 WinSxS directory.  Using Process Monitor for the 'import apsw'
invocation shows the cp437 encoding being looked for and found, then the
apsw.pyd being looked for, found, opened, LoadImage, ReadFile and
CloseFile.  Then a file named angle bracket stdin angle bracket it
looked for and not found (presumably to show the error message).

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3310] Out-of-date example 3.0b1 Tutorial Classes page, 'issubclass'

2008-07-06 Thread Alexis Layton

New submission from Alexis Layton <[EMAIL PROTECTED]>:

The bullet example for 'issubclass' should be updated since neither
'unicode' or 'basestring' are valid anymore.

--
assignee: georg.brandl
components: Documentation
messages: 69363
nosy: alexis.layton, georg.brandl
severity: normal
status: open
title: Out-of-date example 3.0b1 Tutorial Classes page, 'issubclass'
type: behavior
versions: Python 3.0

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3309] missing lock release in BZ2File_iternext()

2008-07-06 Thread STINNER Victor

New submission from STINNER Victor <[EMAIL PROTECTED]>:

Call BZ2File_iternext() on closed file doesn't release the lock.

Example:
---
import bz2
obj = bz2.BZ2File('/etc/issue')
obj.close()
try:
# acquire the lock
obj.next()
except ValueError, err:
# but don't release the lock
print err
# DEAD LOCK here
obj.readlines()
---

Attached patch fixes this bug.

--
components: Library (Lib)
files: bz2_lock.patch
keywords: patch
messages: 69362
nosy: haypo
severity: normal
status: open
title: missing lock release in BZ2File_iternext()
versions: Python 2.6
Added file: http://bugs.python.org/file10837/bz2_lock.patch

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3308] MinGW built extensions do not load (specified procedure cannot be found)

2008-07-06 Thread Roger Binns

New submission from Roger Binns <[EMAIL PROTECTED]>:

My extension (apsw) builds and runs just fine on Linux, Mac and Windows
for Python 2.3, 2.4 and 2.5.  For Linux and Mac Python 2.6 beta 1 and
Python 3.0 beta 1 also work just fine.  However on Windows using MinGW
and Python 2.6 beta 1 and Python 3.0 beta 1 the pyd fails to load
claiming the "specified procedure cannot be found".  The compile/link is
just fine and pexports shows the procedure is present.  

# Compile lines
c:/python26/python setup.py build --compile=mingw32 install
c:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -DSQLITE_THREADSAFE=1
-DNDEBUG=1 -DEXPERIMENTAL=1
-DAPSW_USE_SQLITE_AMALGAMATION=\"C:\apsw\sqlite3.c\"
-Ic:\python26\include -Ic:\python26\PC -c apsw.c -o
build\temp.win32-2.6\Release\apsw.o
writing build\temp.win32-2.6\Release\apsw.def
c:\mingw\bin\gcc.exe -mno-cygwin -shared -s
build\temp.win32-2.6\Release\apsw.o
build\temp.win32-2.6\Release\apsw.def -Lc:\python26\libs
-Lc:\python26\PCbuild -lpython26 -lmsvcr90 -o build\lib.win32-2.6\apsw.pyd
# Running
ImportError: DLL load failed: The specified procedure could not be found.
# Pexports
C:\apsw>pexports build\lib.win32-2.6\apsw.pyd
LIBRARY apsw.pyd
EXPORTS
initapsw

When using Python 3.0 things are substantially the same except the init
function is PyInit_apsw.

MinGW was installed using the default configuration with the automated
installer http://sourceforge.net/forum/forum.php?forum_id=817299  The
libmsvcr90.a is part of MinGW found in c:\MinGW\lib

--
components: Distutils
messages: 69361
nosy: rogerbinns
severity: normal
status: open
title: MinGW built extensions do not load (specified procedure cannot be found)
versions: Python 2.6, Python 3.0

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3250] datetime.time does not support arithmetic

2008-07-06 Thread Skip Montanaro

Skip Montanaro <[EMAIL PROTECTED]> added the comment:

George> To handle overflows, I figured it should wrap around a 24-hour
George> limit.

That's precisely the reason that time objects don't support arithmetic.
There is no obviously best way to handle overflow.

--
nosy: +skip.montanaro

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3307] invalid check of _bsddb creation failure

2008-07-06 Thread STINNER Victor

STINNER Victor <[EMAIL PROTECTED]> added the comment:

The bug occurs on db_create() failure. Dummy example to reproduce it:
"import _bsddb; _bsddb.DB(None, 29.515)"

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3307] invalid check of _bsddb creation failure

2008-07-06 Thread STINNER Victor

New submission from STINNER Victor <[EMAIL PROTECTED]>:

newDBObject(), called by DB_construct(), doesn't check correctly the 
result of all to the external function db_create(). It checks if 
self->db is NULL, but db_create() doesn't change self->db value on 
error. So if self->db is uninitialized, the error is not catched.

Two ideas to fix the bug:
 - check "if (err)" instead of "if (self->db != NULL)"
 - set self->db=NULL before calling db_create()

I implemented the second proposition in the attached patch.

Note: The bug occurs with PYDEBUG, I don't know if PyObject_New() 
fills new allocate memory to zero (I think no, but I'm not sure).

--
components: Library (Lib)
files: bsddb_create.patch
keywords: patch
messages: 69358
nosy: haypo
severity: normal
status: open
title: invalid check of _bsddb creation failure
versions: Python 2.6
Added file: http://bugs.python.org/file10836/bsddb_create.patch

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3299] invalid object destruction in re.finditer()

2008-07-06 Thread STINNER Victor

STINNER Victor <[EMAIL PROTECTED]> added the comment:

Hum, the bug is maybe specific to Python build with --with-pydebug. I 
don't know exactly the behaviour changes of the PYDEBUG option.

@effbot: in my patch, I replaced PyObject_DEL (PyObject_FREE) and not 
PyObject_Del (PyMem_Free).

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3306] audioop.findmax() crashs with negative length

2008-07-06 Thread STINNER Victor

New submission from STINNER Victor <[EMAIL PROTECTED]>:

Example:
>>> import audioop
>>> audioop.findmax(''.join( chr(x) for x in xrange(256)), -2392392)
Erreur de segmentation (core dumped)

The problem is that audioop_findmax() doesn't check len2 for negative 
value. Here is a patch ;-)

--
components: Library (Lib)
files: audioop_findmax.patch
keywords: patch
messages: 69356
nosy: haypo
severity: normal
status: open
title: audioop.findmax() crashs with negative length
versions: Python 2.6
Added file: http://bugs.python.org/file10835/audioop_findmax.patch

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue839496] SimpleHTTPServer reports wrong content-length for text files

2008-07-06 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment:

Committed as r64762.
Maybe a 2.5 backport candidate, but I fear that it may break existing code.

--
nosy: +amaury.forgeotdarc
resolution:  -> fixed
status: open -> pending

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3277] socket's OOB data management is broken on OS X and FreeBSD

2008-07-06 Thread Gregory P. Smith

Gregory P. Smith <[EMAIL PROTECTED]> added the comment:

not a python issue.  thanks for opening one with FreeBSD.

--
resolution:  -> invalid
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3278] socket's SO_OOBINLINE option does not work

2008-07-06 Thread Gregory P. Smith

Gregory P. Smith <[EMAIL PROTECTED]> added the comment:

A friend confirms that on NetBSD it matches the Linux behavior.

"read -> x" is printed before the exception.

also fwiw, my OS X version is 10.5.3.

IMNSHO not a python bug.  open it with FreeBSD and Apple.

--
resolution:  -> invalid
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3278] socket's SO_OOBINLINE option does not work

2008-07-06 Thread Gregory P. Smith

Gregory P. Smith <[EMAIL PROTECTED]> added the comment:

further reading reveals that this is the expected behavior.

p651 in 24.2: "select indicates an exception condition until the process
reads -beyond- the out of band data."  ...  "the solution is to only
select for an exception condition after reading normal data."  with code
examples.

in short: if you want OOB with select there are hoops to jump through
for the edge cases.  its layed out in the book.

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3299] invalid object destruction in re.finditer()

2008-07-06 Thread Georg Brandl

Georg Brandl <[EMAIL PROTECTED]> added the comment:

> It can also be used in constructors, to destroy an object that was just
> created if something goes wrong.

It appears that this is not true in debug builds: PyObject_NEW adds the
object to the global linked list of all objects, which PyObject_DEL
obviously doesn't undo.  Therefore, when the object created immediately
before is deallocated (in this case the argument tuple to finditer()), a
fatal error will be caused.

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3278] socket's SO_OOBINLINE option does not work

2008-07-06 Thread Gregory P. Smith

Gregory P. Smith <[EMAIL PROTECTED]> added the comment:

p648 of Unix Network Programming third edition:

"4. If the process has set the SO_OOBINLINE socket option and then tries
to read the out-of-band data by specifying MSG_OOB, EINVAL is returned."

so it does not sound like a bug in Python.

There -does- appear to be a difference in BSD and Linux's socket
implementation here.  select returned the socket in both the read and
exception list on Linux.  While on BSD it only returned it in the
exception list.

The application is presumably supposed to keep track of which sockets it
has set SO_OOBINLINE on to know what to do when select returns them in
the exception state.

That said... OS X (and presumably FreeBSD) behaves oddly.  The socket is
only ever returned in the e list and an attempt to conn.recv(1) from it
raises socket.error "error: [Errno 35] Resource temporarily unavailable"

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3299] invalid object destruction in re.finditer()

2008-07-06 Thread Fredrik Lundh

Fredrik Lundh <[EMAIL PROTECTED]> added the comment:

This report makes no sense to me; at least in Python 2.X, PyObject_Del
removes a chunk of memory from the object heap.  It's designed to be
used from dealloc implementations, to release the actual memory (either
directly, or as the default implementation for the tp_free slot).  It
can also be used in constructors, to destroy an object that was just
created if something goes wrong.

If you change PyObject_Del to Py_DECREF nillywilly, things will indeed
crash.

(with the original 2.5 code, I cannot see how a non-string argument to
finditer() can result in a call to scanner_dealloc(); the argument will
be rejected by getstring(), which causes state_init() to return, which
causes pattern_scanner() to free the object it just created, and return.)

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3277] socket's OOB data management is broken on OS X and FreeBSD

2008-07-06 Thread Giampaolo Rodola'

Giampaolo Rodola' <[EMAIL PROTECTED]> added the comment:

Sorry, the first reply of Martin slipped under my radar.
In fact I wasn't sure whether this was related to Python or FreeBSD.
I've filed this same report on the FreeBSD bug tracker:
http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/125258
If you're sure this is not related to python please close it, otherwise
we could wait for someone of the FreeBSD team to reply and confirm that
it's FreeBSD related.

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3305] Use Py_XDECREF() instead of Py_DECREF() in MultibyteCodec and MultibyteStreamReader

2008-07-06 Thread STINNER Victor

New submission from STINNER Victor <[EMAIL PROTECTED]>:

Functions mbstreamwriter_dealloc() and mbstreamreader_dealloc() of 
Modules/cjkcodecs/multibytecodec.c uses Py_DECREF() to free stream 
attribute memory, but this attribute may be NULL if MultibyteCodec or 
MultibyteStreamReader constructor fails.

Simple fix: use Py_XDECREF().

Example:
>>> import _multibytecodec
>>> _multibytecodec.MultibyteStreamReader(None)
Erreur de segmentation (core dumped)

--
components: Library (Lib)
files: multibytecodec_py_xdecref.patch
keywords: patch
messages: 69347
nosy: haypo
severity: normal
status: open
title: Use Py_XDECREF() instead of Py_DECREF() in MultibyteCodec and 
MultibyteStreamReader
versions: Python 2.6
Added file: http://bugs.python.org/file10834/multibytecodec_py_xdecref.patch

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3277] socket's OOB data management is broken on OS X and FreeBSD

2008-07-06 Thread Josiah Carlson

Josiah Carlson <[EMAIL PROTECTED]> added the comment:

I agree with Martin.  Why are you sure that this is a Python bug and not
a FreeBSD bug?  As per the documentation of OOB data, it's not supported
by all operating systems or TCP/IP stacks.

--
nosy: +josiahcarlson

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3299] invalid object destruction in re.finditer()

2008-07-06 Thread STINNER Victor

STINNER Victor <[EMAIL PROTECTED]> added the comment:

@georg.brandl: The error is an Heisenbug. Yes, sometimes it doesn't 
crash, but recheck in Valgrind ;-)

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3139] bytearrays are not thread safe

2008-07-06 Thread Martin v. Löwis

Changes by Martin v. Löwis <[EMAIL PROTECTED]>:


--
priority:  -> release blocker

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3301] DoS when lo is negative in bisect.insort_right() / _left()

2008-07-06 Thread Raymond Hettinger

Raymond Hettinger <[EMAIL PROTECTED]> added the comment:

Don't think negative indices make much sense in this context.  Will put 
in a test to raise a ValueError for negative indices.

--
priority:  -> high

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3278] socket's SO_OOBINLINE option does not work

2008-07-06 Thread Gregory P. Smith

Gregory P. Smith <[EMAIL PROTECTED]> added the comment:

This also happens on Linux:

read -> x
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/home/greg/sandbox/python/trunk/Lib/threading.py", line 523, in
__bootstrap_inner
self.run()
  File "/home/greg/sandbox/python/trunk/Lib/threading.py", line 478, in run
self.__target(*self.__args, **self.__kwargs)
  File "../socket_oobinline.py", line 20, in server
data = conn.recv(1024, socket.MSG_OOB)
error: [Errno 22] Invalid argument


I need to look up what the exact behavior should be.

--
title: socket's SO_OOBINLINE option does not work on OS X and FreeBSD -> 
socket's SO_OOBINLINE option does not work

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3278] socket's SO_OOBINLINE option does not work on OS X and FreeBSD

2008-07-06 Thread Gregory P. Smith

Changes by Gregory P. Smith <[EMAIL PROTECTED]>:


--
assignee:  -> gregory.p.smith
nosy: +gregory.p.smith
priority:  -> normal
title: socket's SO_OOBINLINE option does not work on FreeBSD -> socket's 
SO_OOBINLINE option does not work on OS X and FreeBSD

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3277] socket's OOB data management is broken on OS X and FreeBSD

2008-07-06 Thread Gregory P. Smith

Changes by Gregory P. Smith <[EMAIL PROTECTED]>:


--
assignee:  -> gregory.p.smith
nosy: +gregory.p.smith
priority:  -> normal
title: socket's OOB data management is broken on FreeBSD -> socket's OOB data 
management is broken on OS X and FreeBSD

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3303] invalid ref count on locale.strcoll() error

2008-07-06 Thread Martin v. Löwis

Changes by Martin v. Löwis <[EMAIL PROTECTED]>:


--
priority:  -> high

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3302] segfault on gettext(None)

2008-07-06 Thread Martin v. Löwis

Changes by Martin v. Löwis <[EMAIL PROTECTED]>:


--
priority:  -> high

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3304] invalid call to PyMem_Free() in fileio_init()

2008-07-06 Thread Gregory P. Smith

Gregory P. Smith <[EMAIL PROTECTED]> added the comment:

thanks.  fixed in trunk r64758.  i'm assuming that'll be merged into
py3k automagically.

--
resolution:  -> accepted
versions: +Python 3.0 -Python 2.6

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3299] invalid object destruction in re.finditer()

2008-07-06 Thread Georg Brandl

Changes by Georg Brandl <[EMAIL PROTECTED]>:


--
priority:  -> critical

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3299] invalid object destruction in re.finditer()

2008-07-06 Thread Georg Brandl

Changes by Georg Brandl <[EMAIL PROTECTED]>:


--
assignee:  -> effbot
nosy: +effbot

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3299] invalid object destruction in re.finditer()

2008-07-06 Thread Georg Brandl

Georg Brandl <[EMAIL PROTECTED]> added the comment:

This seems to be new in trunk; 2.5.2 raises a TypeError.

--
nosy: +georg.brandl

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3301] DoS when lo is negative in bisect.insort_right() / _left()

2008-07-06 Thread Georg Brandl

Georg Brandl <[EMAIL PROTECTED]> added the comment:

The same is true for all other _bisect functions.

The pure Python versions from bisect work with negative indices by
interpreting them as in slice notation. This should probably be harmonized.

--
assignee:  -> rhettinger
nosy: +georg.brandl, rhettinger

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3304] invalid call to PyMem_Free() in fileio_init()

2008-07-06 Thread Gregory P. Smith

Changes by Gregory P. Smith <[EMAIL PROTECTED]>:


--
assignee:  -> gregory.p.smith
keywords: +easy
nosy: +gregory.p.smith
priority:  -> normal

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3303] invalid ref count on locale.strcoll() error

2008-07-06 Thread Georg Brandl

Changes by Georg Brandl <[EMAIL PROTECTED]>:


--
assignee:  -> loewis
nosy: +loewis

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3302] segfault on gettext(None)

2008-07-06 Thread Georg Brandl

Changes by Georg Brandl <[EMAIL PROTECTED]>:


--
assignee:  -> loewis
nosy: +loewis

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3300] urllib.quote and unquote - Unicode issues

2008-07-06 Thread Martin v. Löwis

Martin v. Löwis <[EMAIL PROTECTED]> added the comment:

> RFC 3986 states that the percent-encoded byte
> values should be decoded as UTF-8.

Where precisely do you read such a SHOULD requirement?
Section 2.5 elaborates that the local encoding (of the
resource) is typically used, ignoring cases where URIs
are constructed on the client system (such scenario is
simply ignored in the RFC).

The last paragraph in section 2.5 is the only place that
seems to imply a SHOULD requirement (although it doesn't
use the keyword); this paragraph only talks about new URI
schemes. Unfortunately, for http, the encoding is of
characters is unspecified (this is somewhat solved by the
introduction of IRIs).

--
nosy: +loewis

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3304] invalid call to PyMem_Free() in fileio_init()

2008-07-06 Thread STINNER Victor

New submission from STINNER Victor <[EMAIL PROTECTED]>:

fileio_init() calls PyMem_Free(name); whereas name comes from 
PyArg_ParseTupleAndKeywords().

Attached patch removes this invalid call.

The bug may also affect Python3.0.

--
components: Library (Lib)
files: fileio_pymem_free.patch
keywords: patch
messages: 69338
nosy: haypo
severity: normal
status: open
title: invalid call to PyMem_Free() in fileio_init()
versions: Python 2.6
Added file: http://bugs.python.org/file10833/fileio_pymem_free.patch

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3303] invalid ref count on locale.strcoll() error

2008-07-06 Thread STINNER Victor

STINNER Victor <[EMAIL PROTECTED]> added the comment:

Example to reproduce the bug:

import locale; locale.strcoll(u"a", None)

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3303] invalid ref count on locale.strcoll() error

2008-07-06 Thread STINNER Victor

New submission from STINNER Victor <[EMAIL PROTECTED]>:

If locale.strcoll(a, b) fails because PyUnicode_FromObject(b) fails, 
refcount of a is wrong. Attached patch fixes the problem.

--
components: Library (Lib)
files: locale_strcoll_rel1.patch
keywords: patch
messages: 69336
nosy: haypo
severity: normal
status: open
title: invalid ref count on locale.strcoll() error
type: crash
versions: Python 2.6
Added file: http://bugs.python.org/file10832/locale_strcoll_rel1.patch

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3302] segfault on gettext(None)

2008-07-06 Thread STINNER Victor

New submission from STINNER Victor <[EMAIL PROTECTED]>:

msgid of gettext(), dgettext(), dcgettext() C functions can not be 
NULL (domainname can be NULL): "import locale; locale.gettext(None)" 
generates a segfault.

domainname argument of bindtextdomain() have to be a non empty 
string: "locale.bindtextdomain(NULL, NULL)" or 
locale.bindtextdomain('', NULL)" generates an OSError(0).

Attached patch fixes the two bugs.

--
components: Extension Modules
files: locale_none.patch
keywords: patch
messages: 69335
nosy: haypo
severity: normal
status: open
title: segfault on gettext(None)
versions: Python 2.6
Added file: http://bugs.python.org/file10831/locale_none.patch

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3301] DoS when lo is negative in bisect.insort_right() / _left()

2008-07-06 Thread STINNER Victor

New submission from STINNER Victor <[EMAIL PROTECTED]>:

"import bisect; bisect.insort(range(4), -1, -1)" goes into an 
unlimited loop.  Workaround: replace negative lo value by zero. The 
function may raise an exception.

--
components: Library (Lib)
files: bisect_lo.patch
keywords: patch
messages: 69334
nosy: haypo
severity: normal
status: open
title: DoS when lo is negative in bisect.insort_right() / _left()
type: crash
versions: Python 2.6
Added file: http://bugs.python.org/file10830/bisect_lo.patch

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3300] urllib.quote and unquote - Unicode issues

2008-07-06 Thread Matt Giuca

New submission from Matt Giuca <[EMAIL PROTECTED]>:

Three Unicode-related problems with urllib.parse.quote and
urllib.parse.unquote in Python 3.0. (Patch attached).

Firstly, unquote appears not to have been modified from Python 2, where
it is designed to output a byte string. In Python 3, it outputs a
unicode string, implicitly decoded as ISO-8859-1 (the code points are
the same as the bytes). RFC 3986 states that the percent-encoded byte
values should be decoded as UTF-8.

http://tools.ietf.org/html/rfc3986 section 2.5.

Current behaviour:
>>> urllib.parse.unquote("%CE%A3")
'Σ'
(or '\u00ce\u00a3')

Desired behaviour:
>>> urllib.parse.unquote("%CE%A3")
'Σ'
(or '\u03a3')

Secondly, while quote *has* been modified to encode to UTF-8 before
percent-encoding, it does not work correctly for characters in
range(128, 256), due to a special case in the code which again treats
the code point values as byte values.

Current behaviour:
>>> urllib.parse.quote('\u00e9')
'%E9'

Desired behaviour:
>>> urllib.parse.quote('\u00e9')
'%C3%A9'

Note that currently, quoting characters less than 256 will use
ISO-8859-1, while quoting characters 256 or higher will use UTF-8!

Thirdly, the "safe" argument to quote does not work for characters above
256, since these are excluded from the special case. I thought I would
fix this at the same time, but it's really a separate issue.

Current behaviour:
>>> urllib.parse.quote('Σϰ', safe='Σ')
'%CE%A3%CF%B0'

Desired behaviour:
>>> urllib.parse.quote('Σϰ', safe='Σ')
'Σ%CF%B0'

A patch which fixes all three issues is attached. Note that unquote now
needs to handle the case where the UTF-8 sequence is invalid. This is
currently handled by "replace" (invalid sequences are replaced by
'\ufffd'). I would like to add an optional "errors" argument to unquote,
defaulting to "replace", to allow the user to override this behaviour,
but I didn't put that in because it would change the interface.

Note I also changed one of the test cases, which had the wrong expected
output. (String literal was manually UTF-8 encoded, designed for Python
2; nonsensical when viewed as a Python 3 Unicode string).

All urllib test cases pass.

Patch is for branch /branches/py3k, revision 64752.

Note: The above unquote issue also manifests itself in Python 2 for
Unicode strings, but it's hazy as to what the behaviour should be, and
would break existing programs, so I'm just patching the Py3k branch.

Commit log:

urllib.parse.unquote: Fixed percent-encoded octets being implicitly
decoded as ISO-8859-1; now decode as UTF-8, as per RFC 3986.

urllib.parse.quote: Fixed characters in range(128, 256) being implicitly
encoded as ISO-8859-1; now encode as UTF-8. Also fixed characters
greater than 256 not responding to "safe", and also not being cached.

Lib/test/test_urllib.py: Updated one test case for unquote which
expected the wrong output. The new version of unquote passes the new
test case.

--
components: Library (Lib)
files: parse.py.patch
keywords: patch
messages: 69333
nosy: mgiuca
severity: normal
status: open
title: urllib.quote and unquote - Unicode issues
type: behavior
versions: Python 3.0
Added file: http://bugs.python.org/file10829/parse.py.patch

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue839496] SimpleHTTPServer reports wrong content-length for text files

2008-07-06 Thread Bluebird

Bluebird <[EMAIL PROTECTED]> added the comment:

I confirm that the problem is present on python2.5 on windows, and that
the attached patch fixes it.

--
nosy: +bluebird

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3299] invalid object destruction in re.finditer()

2008-07-06 Thread STINNER Victor

New submission from STINNER Victor <[EMAIL PROTECTED]>:

"import re: re.finditer("a", {})" crash on Python 2.x (tested with svn 
trunk) because of an invalid use of PyObject_NEW/PyObject_DEL. The 
error is in pattern_scanner(), in block "if (!string) { ... }".
 - scanner_dealloc() calls Py_DECREF(self->pattern); whereas pattern 
attribute is not initialized
 - scanner_dealloc() calls PyObject_DEL(self); whereas 
scanner_dealloc() is already the destructor of self object!

I wrote a patch to fix these errors. Please review my patch, I don't 
know C API very well.

I also patched _compile(): replace PyObject_DEL() by Py_DECREF(). Is 
it really needed?

--
components: Library (Lib)
files: re_finditer.patch
keywords: patch
messages: 69331
nosy: haypo
severity: normal
status: open
title: invalid object destruction in re.finditer()
type: crash
versions: Python 2.6
Added file: http://bugs.python.org/file10828/re_finditer.patch

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3298] Multiline string with quotes is not parsed correctly.

2008-07-06 Thread Stavros Korokithakis

Stavros Korokithakis <[EMAIL PROTECTED]> added the comment:

Ah, interesting, I had forgotten that adjacent strings are merged. 
Thanks.

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3298] Multiline string with quotes is not parsed correctly.

2008-07-06 Thread Georg Brandl

Georg Brandl <[EMAIL PROTECTED]> added the comment:

The last quote starts another string literal, so this is valid Python:

"""A "test B"

and results in a string 'A "test B'. The lexer cannot know whether the
second string literal is terminated or not, yielding valid or invalid code.

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3298] Multiline string with quotes is not parsed correctly.

2008-07-06 Thread Stavros Korokithakis

Stavros Korokithakis <[EMAIL PROTECTED]> added the comment:

Hmm, what would be the meaning of """ " in this particular context? I 
can't think of a situation where
"""A test""" "
would be valid code.

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3298] Multiline string with quotes is not parsed correctly.

2008-07-06 Thread Georg Brandl

Georg Brandl <[EMAIL PROTECTED]> added the comment:

There is an ambiguity: did you mean """ " or " """ (spaces added for
clarity). Python does not count quotes, parentheses or similar in
strings, so the first occurrence of """ will close the literal.

You can either use triple single quotes, or escape the first quote, like
that: """A "test\.

--
nosy: +georg.brandl
resolution:  -> invalid
status: open -> closed

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3298] Multiline string with quotes is not parsed correctly.

2008-07-06 Thread Stavros Korokithakis

New submission from Stavros Korokithakis <[EMAIL PROTECTED]>:

A multiline string with quotes next to the ending quote is not parsed 
correctly:

In [1]: """A "test

   File "", line 1
 """A "test
  ^
: EOL while scanning single-quoted string

Is this normal behaviour? It seems to me like the parser should parse 
everything inside the triple double quotes (there is no ambiguity).

--
components: Interpreter Core
messages: 69326
nosy: Stavros
severity: normal
status: open
title: Multiline string with quotes is not parsed correctly.
type: behavior
versions: Python 2.5

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2235] __eq__ / __hash__ check doesn't take inheritance into account

2008-07-06 Thread Nick Coghlan

Nick Coghlan <[EMAIL PROTECTED]> added the comment:

Two failures in the -uall run (test_codecmaps_hk, test_linuxaudiodev).
However, I see those test failures even after reverting my changes, so
they aren't related to this.

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2235] __eq__ / __hash__ check doesn't take inheritance into account

2008-07-06 Thread Nick Coghlan

Nick Coghlan <[EMAIL PROTECTED]> added the comment:

Attached updated patch which implements Guido's suggestion from above
(inheritance of __hash__ is blocked at the C level by setting the slot
to PyObject_HashNotImplemented and at the Python level by setting
__hash__ = None).

All tests which don't depend on a -u resource flag still pass (currently
running a -uall set of tests as well).

Added file: 
http://bugs.python.org/file10827/issue2235_fix_hash_inheritance_with_function_ptr.diff

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2320] Race condition in subprocess using stdin

2008-07-06 Thread Gregory P. Smith

Gregory P. Smith <[EMAIL PROTECTED]> added the comment:

lowering the priority on this back to normal as there is a workaround:
use close_fds=True.

I agree that this is messy, I'm not sure if we can really fix it or even
if we should.

Running lsof shows the /bin/cat processes on OS X all having a varying
numbers of the same PIPEs open supporting Adam's hypothesis.

--
assignee: gregory.p.smith -> 
priority: critical -> normal

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3139] bytearrays are not thread safe

2008-07-06 Thread Ismail Donmez

Changes by Ismail Donmez <[EMAIL PROTECTED]>:


--
nosy: +cartman

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2113] Bad interaction between signal and subprocess

2008-07-06 Thread Gregory P. Smith

Gregory P. Smith <[EMAIL PROTECTED]> added the comment:

Fixed as Amaury described in trunk r64756.

still needs backporting to release25-maint.

___
Python tracker <[EMAIL PROTECTED]>

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com