[issue3991] urllib.request.urlopen does not handle non-ASCII characters

2008-09-30 Thread Toshio Kuratomi

Toshio Kuratomi <[EMAIL PROTECTED]> added the comment:

Oh, that's cool.  I've been fine with this being a request for a needed
function to quote and unquote full urls rather than a bug in urlopen().

I think iri's are a distraction here, though.  The RFC for iris even
says that specifications that call for uris and do not mention iris
should not take iris.  So there's definitely a need for a function to
quote a full uri.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4005] pydoc in web server mode tails at initial request

2008-09-30 Thread James Mills

New submission from James Mills <[EMAIL PROTECTED]>:

Trying to use pydoc in it's webserver mode fails:

$ pydoc3.0 -p 8000
pydoc server ready at http://localhost:8000/

Exception happened during processing of request from ('127.0.0.1', 42939)
Traceback (most recent call last):
  File "/usr/lib/python3.0/socketserver.py", line 281, in
_handle_request_noblock
self.process_request(request, client_address)
  File "/usr/lib/python3.0/socketserver.py", line 307, in process_request
self.finish_request(request, client_address)
  File "/usr/lib/python3.0/socketserver.py", line 320, in finish_request
self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.0/socketserver.py", line 614, in __init__
self.handle()
  File "/usr/lib/python3.0/http/server.py", line 363, in handle
self.handle_one_request()
  File "/usr/lib/python3.0/http/server.py", line 357, in handle_one_request
method()
  File "/usr/lib/python3.0/pydoc.py", line 1957, in do_GET
indices.append(html.index(dir, seen))
  File "/usr/lib/python3.0/pydoc.py", line 929, in index
for importer, name, ispkg in pkgutil.iter_modules([dir]):
  File "/usr/lib/python3.0/pkgutil.py", line 147, in iter_modules
for name, ispkg in iter_importer_modules(i, prefix):
  File "/usr/lib/python3.0/pkgutil.py", line 325, in iter_zipimport_modules
dirlist.sort()
AttributeError: 'dict_keys' object has no attribute 'sort'

pydoc server stopped

--
components: Demos and Tools
messages: 74116
nosy: prologic
severity: normal
status: open
title: pydoc in web server mode tails at initial request
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



[issue4000] Additional 2to3 documentation updates

2008-09-30 Thread David W. Lambert

David W. Lambert <[EMAIL PROTECTED]> added the comment:

http://docs.python.org/dev/3.0/library/reprlib.html

Should read  return eval(obj)

return `obj`



http://docs.python.org/dev/3.0/library/collections.html#id2

Relic decimal point in named tuple example.

>>> for p in Point(3, 4), Point(14, 5/7.):

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2382] [Py3k] SyntaxError cursor shifted if multibyte character is in line.

2008-09-30 Thread Hirokazu Yamamoto

Hirokazu Yamamoto <[EMAIL PROTECTED]> added the comment:

You are right, this issue is more difficult than I thought...
I found wcswidth(3), if this function is available we can use this
function, but unfortunately there is no such function in VC6 and this
function is meaningless on cygwn, so I cannot test it. ;-(

Maybe we can use
import unicodedata
unicodedata.east_asian_width()
but I need to investigate more.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3862] test_array fails on FreeBSD7 amd64

2008-09-30 Thread Andrew I MacIntyre

Andrew I MacIntyre <[EMAIL PROTECTED]> added the comment:

Yes, the bleeding obvious became so after some sleep.

Committed to trunk as r66708 with the extra fix and a more abbreviated
failure message, which I hope is still semantically the same as Mark's
suggested text.

Will forward port as appropriate to py3k.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3991] urllib.request.urlopen does not handle non-ASCII characters

2008-09-30 Thread Bill Janssen

Bill Janssen <[EMAIL PROTECTED]> added the comment:

I'm not concerned about any example inputs.  I was just trying to
explain why this isn't a bug.

On the other hand, the IRI spec (RFC 3897) is another thing we might
try to implement for Python.

--
type:  -> feature request

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3448] Multi-process 2to3

2008-09-30 Thread Benjamin Peterson

Benjamin Peterson <[EMAIL PROTECTED]> added the comment:

Nick, is there a way you could isolate the process functionality in a
RefactoringTool subclass? It's an interesting idea, but I don't it needs
to infect the main library.

--
nosy: +benjamin.peterson

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2876] Write UserDict fixer for 2to3

2008-09-30 Thread Benjamin Peterson

Changes by Benjamin Peterson <[EMAIL PROTECTED]>:


--
assignee:  -> benjamin.peterson
nosy: +benjamin.peterson

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3448] Multi-process 2to3

2008-09-30 Thread Nick Edds

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

Is there still any interest in this Collin? Is there anything else you
need me to do for it?

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2876] Write UserDict fixer for 2to3

2008-09-30 Thread Nick Edds

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

Could somebody else take a look at this and check in it if it looks
alright? I think that it works currently but I can't check it in...

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2382] [Py3k] SyntaxError cursor shifted if multibyte character is in line.

2008-09-30 Thread Amaury Forgeot d'Arc

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

I think that your patch works only for terminals where one byte of the 
encoded text is displayed as one character on the terminal. This is not 
true for utf-8 terminals, for example.

In the attached patch, I tried to write some unit tests, (I had to adapt 
the traceback module as well), and one test still fails because the 
captured stderr has a utf-8 encoding.
I think that it's better to count unicode characters.

--
nosy: +amaury.forgeotdarc
Added file: http://bugs.python.org/file11670/traceback_adjust_cursor.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue694374] Recursive regular expressions

2008-09-30 Thread Matthew Barnett

Matthew Barnett <[EMAIL PROTECTED]> added the comment:

I'll have a look at this. No promises, though.

--
nosy: +mrabarnett

___
Python tracker <[EMAIL PROTECTED]>

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



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2008-09-30 Thread Matthew Barnett

Matthew Barnett <[EMAIL PROTECTED]> added the comment:

The explanation of the zero-width bug is incorrect. What happens is this:

The functions for finditer(), findall(), etc, perform searches and want
the next one to continue from where the previous match ended. However,
if the match was actually zero-width then that would've made it search
from where the previous search _started_, and it would be stuck forever.
Therefore, after a zero-width match the caller of the search consumes a
character. Unfortunately, that can result a character being 'missed'.

The bug in re.split() is also the result of an incorrect fix to this
zero-width problem.

I suggest that the regex code should include the fix for the zero-width
split bug; we can have code to turn it off unless a re.ZEROWIDTH flag is
present, if that's the decision.

The patch issue2636+01+09-02+17+18+19+20+21+24+26_speedup.diff includes
some speedups.

Added file: 
http://bugs.python.org/file11669/issue2636+01+09-02+17+18+19+20+21+24+26_speedup.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4001] 2to3 does relative import for modules not in a package.

2008-09-30 Thread Benjamin Peterson

Benjamin Peterson <[EMAIL PROTECTED]> added the comment:

Thanks. Fixed in r66707.

--
nosy: +benjamin.peterson
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



[issue4004] missing newline in "Could not convert argument %s to string" error message

2008-09-30 Thread STINNER Victor

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

Example:

$ ./python $(echo -e "\xff"); ./python $(echo -e "\xff"); echo "--"
Could not convert argument 1 to stringCould not convert argument 1 to 
string--

--
files: argv_error_newline.patch
keywords: patch
messages: 74102
nosy: haypo
severity: normal
status: open
title: missing newline in "Could not convert argument %s to string" error 
message
type: behavior
versions: Python 3.0
Added file: http://bugs.python.org/file11668/argv_error_newline.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3187] os.listdir can return byte strings

2008-09-30 Thread STINNER Victor

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

As I wrote, python3_bytes_filename.patch was just an initial support 
for bytes filename. So as asked by Guido, here is a new version of my 
patch.

Changes:
 - for all functions, support bytes as well as bytearray
 - os.readlink(unicode) -> unicode and raise an error if unicode 
conversion fails. Note: os.readlink(bytes)->bytes was already working.
 - many changes in posixpath to fix all functions: add many "if 
isinstance(...):" and repeat sep / curdir / parent / ... in bytes
 - current version of test_posixpath contains a duplicate to 
test_splitdrive() and test_normcase() calls normcase() twice which is 
wrong (fixed in my patch)
 - i used copy/paste + conversion to bytes to test posixpath with 
bytes arguments
 - i added some checks in posixpath tests to reject mixing bytes + str
 - fix quoting style
 - factorize pattern compilation in fnmatch
 - fnmatch.fnmatchcase() supports bytes
 - fix test_unicode_file: replace getcwdu() by getcwd(), and sometimes 
getcwd() by getcwdb()

Open issues:
 - pwd.getpwnam() and grp.getgrpnam() should accept bytes, and then
   expanduser() should use pwd with bytes. Now expanduser() 
   supposes that an username is an ASCII string and the user
   directory can be converted using getfilesystemencoding()
 - expandvars() doesn't support non-ASCII variable value:
   that's new problem. os.environ key should be str or bytes?
   And the value: str or bytes? It str is choosen, what is the
   charset to convert str to bytes?

Added file: http://bugs.python.org/file11667/python3_bytes_filename-2.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3623] _json: fix raise_errmsg(), py_encode_basestring_ascii() and linecol()

2008-09-30 Thread Bob Ippolito

Bob Ippolito <[EMAIL PROTECTED]> added the comment:

I applied the changes proposed in _json26.patch to simplejson and they 
worked perfectly fine. Again I'm not the best judge of python 3.0 code 
because I have not made myself familiar with the API changes so someone 
else should review it (but it's probably fine).

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3863] 2.6rc1: test_threading hangs on FreeBSD 6.3 i386

2008-09-30 Thread Gregory P. Smith

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

marking release blocker for 3.0, the patch just needs to be merged after
it runs through any existing trunk freebsd buildbot(s).

--
priority: normal -> 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



[issue3863] 2.6rc1: test_threading hangs on FreeBSD 6.3 i386

2008-09-30 Thread Gregory P. Smith

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

r66703 in trunk (2.6) applies the test_threading_fbsd6.py.patch modified
to also print a note to stderr when skipping the test and adds a mention
of buggy OSes in the os.fork documentation.

still needs merging over to 3.0 and possibly 2.5.

--
assignee:  -> gregory.p.smith
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



[issue3623] _json: fix raise_errmsg(), py_encode_basestring_ascii() and linecol()

2008-09-30 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc <[EMAIL PROTECTED]>:


--
keywords: +needs review

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3995] iso-xxx/cp1252 inconsistencies in Python 2.* not in 3.*

2008-09-30 Thread Martin v. Löwis

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

> I don't know iso codeset that define characters in code range 0x80 0x9f.

That's not true. In ISO-8859-1 (atleast, in the IANA charset), these
characters are indeed assigned - for control functions. So the
ISO-8859-1 byte \x80 corresponds to the Unicode character U+0080,
likewise for \x9c and U+009c. ISO-8859-1 and ISO-8859-15 do have
differences, but *not* for the range 0x80..0x9f - they are identical
in that range (namely, referring to control characters).

--
title: iso-xxx/cp1252 inconsistencies inPython 2.* not in 3.* -> 
iso-xxx/cp1252 inconsistencies in Python 2.* not in 3.*

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3862] test_array fails on FreeBSD7 amd64

2008-09-30 Thread Martin v. Löwis

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

> The 2**16 in the error message is wrong. 

As he says.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3995] iso-xxx/cp1252 inconsistencies in Python 2.* not in 3.*

2008-09-30 Thread Roumen Petrov

Roumen Petrov <[EMAIL PROTECTED]> added the comment:

I don't know iso codeset that define characters in code range 0x80 0x9f.
This range is reserved for control symbols.

The code of euro is 0xa4 in iso-8859-15. Also changes include symbols
like 1/2, 3/4 and I forgot other differences.

--
nosy: +rpetrov

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3959] Add Google's ipaddr.py to the stdlib

2008-09-30 Thread STINNER Victor

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

Another Python library: http://erlug.linux.it/~da/soft/iplib/

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3959] Add Google's ipaddr.py to the stdlib

2008-09-30 Thread STINNER Victor

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

Ooops, the website: http://software.inl.fr/trac/wiki/IPy

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3959] Add Google's ipaddr.py to the stdlib

2008-09-30 Thread STINNER Victor

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

I'm the maintainer of IPy library. Another library for IPv4/IPv6 
manipulation. The code is old (was written for Python 2.2?), but 
released under BSD license. Main issue of this library: it's unable to 
manipulation "invalid ranges": 10.20.4.0/30 is valid but 
10.20.4.1-10.20.4.5 is invalid since it's not possible to create a 
bitmask matching the range. I don't care if you choose Google library, 
maybe better. But you might check IPy to reuse some idea ;-)

--
nosy: +haypo

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3951] Disable Py_USING_MEMORY_DEBUGGER!

2008-09-30 Thread STINNER Victor

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

Close the issue since it's commited in 2.6 and 3.0. My patch 
configure-memory-debugger.patch is useless, a developer can fix 
obmalloc.c.

--
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



[issue3871] cross building python for mingw32 with distutils

2008-09-30 Thread Roumen Petrov

Roumen Petrov <[EMAIL PROTECTED]> added the comment:

note: updated patch contain unsynchronized with trunk code in
./Objects/fileobject.c (after /* EINVAL is returned when an invalid
filename or ... )

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3999] Real segmentation fault handler

2008-09-30 Thread STINNER Victor

Changes by STINNER Victor <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file11659/segfault.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3999] Real segmentation fault handler

2008-09-30 Thread STINNER Victor

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

Oops, my patch was broken. I forgot to install the fault handler! Here 
is a new version of the patch which also catch SIGFPE: raise an 
ArithmeticError.

Added file: http://bugs.python.org/file11666/segfault-2.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3991] urllib.request.urlopen does not handle non-ASCII characters

2008-09-30 Thread Toshio Kuratomi

Toshio Kuratomi <[EMAIL PROTECTED]> added the comment:

The purpose of such a function would be to take something that is not a
valid uri but 1) is a common way of expressing the way to get to the
resource and 2) follows certain rules and turns that into something that
is a valid uri.  non-ASCii strings in the path are a good example of
this since there is a well defined method to encode the strings into the
URL if you are given a character encoding to apply to it.

My first, naive thought is that if the input can be parsed by
urlparse(), then there is a very good chance that we have the ability to
escape the string properly.  Looking at the invalid uri that I gave, for
instance, if you additionally specified an encoding for the path element
there's no reason a function couldn't do the escaping.

What are example inputs that you are concerned about?  I'll see if I can
come up with code that works with them.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3871] cross building python for mingw32 with distutils

2008-09-30 Thread Roumen Petrov

Changes by Roumen Petrov <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file11491/python-trunk.patch-MINGW

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3871] cross building python for mingw32 with distutils

2008-09-30 Thread Roumen Petrov

Changes by Roumen Petrov <[EMAIL PROTECTED]>:


--
keywords: +patch
Added file: http://bugs.python.org/file11665/python-trunk-MINGW.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3754] minimal cross-compilation support for configure

2008-09-30 Thread Roumen Petrov

Changes by Roumen Petrov <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file11337/python-trunk-CROSS.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3754] minimal cross-compilation support for configure

2008-09-30 Thread Roumen Petrov

Changes by Roumen Petrov <[EMAIL PROTECTED]>:


Added file: http://bugs.python.org/file11664/python-trunk-CROSS.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3895] _lsprof issue

2008-09-30 Thread Brett Cannon

Brett Cannon <[EMAIL PROTECTED]> added the comment:

See the fix in r66700 for the change to _lsprof.c to use.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4003] Reference leak in test_cprofile

2008-09-30 Thread Brett Cannon

Brett Cannon <[EMAIL PROTECTED]> added the comment:

Amaury's fix works for me; since this is an edge case situation anyway,
I am not terribly worried about some fancy error message.

Fixed in r66700 for 2.6, r66701 for 2.5.

--
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



[issue3991] urllib.request.urlopen does not handle non-ASCII characters

2008-09-30 Thread Bill Janssen

Bill Janssen <[EMAIL PROTECTED]> added the comment:

It's not immediately clear to me how an auto-quote function can be
written; as you say (and as the URI spec points out), you have to take
a URL apart before quoting it, and you can't parse an invalid URL,
which is what the input is.

Best to think of this as a difference from 2.x.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4002] A Bug in the Documentation

2008-09-30 Thread Georg Brandl

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

I don't see the bug in the code, nor what is solved by the code you propose.

--
resolution:  -> wont fix
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



[issue3187] os.listdir can return byte strings

2008-09-30 Thread Guido van Rossum

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

On Tue, Sep 30, 2008 at 8:21 AM, Martin v. Löwis <[EMAIL PROTECTED]> wrote:
> Martin v. Löwis <[EMAIL PROTECTED]> added the comment:
> Here is a patch that solves the issue in a different way: it introduces
> sys.setfilesystemencoding. If applications invoke
> sys.setfilesystemencoding("iso-8859-1"), all file names can be
> successfully converted into a character string.

I'm not opposed to this going in as well, but I don't think it's the
right approach, as it can cause severe cases of mojibake (which you
have strongly opposed in the past). It's quite orthogonal to Victor's
patch IMO.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4003] Reference leak in test_cprofile

2008-09-30 Thread Amaury Forgeot d'Arc

New submission from Amaury Forgeot d'Arc <[EMAIL PROTECTED]>:

r66677 introduces a reference leak in test_cprofile, as shown by
http://mail.python.org/pipermail/python-checkins/2008-September/074355.html

IMO, the code at the end of the function should not have been modified
this way. It is enough to do:

if (PyErr_Occurred()) {
PyErr_WriteUnraisable(pObj->externalTimer);
return 0;
}

it's the same "PyErr_WriteUnraisable" statement as 18 lines above, which
is valid because pObj->externalTimer is still a living python object
even if pObj is being cleared.

--
assignee: brett.cannon
keywords: needs review, patch
messages: 74082
nosy: amaury.forgeotdarc, benjamin.peterson, brett.cannon
priority: high
severity: normal
status: open
title: Reference leak in test_cprofile
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



[issue4002] A Bug in the Documentation

2008-09-30 Thread John

New submission from John <[EMAIL PROTECTED]>:

Hello,

I've found a little bug in the documentation again and I wanna report 
it. Please navigate to where the built-in property() function is 
documented and look at the beginning of the 3rd code snippet:

class C(object):
def __init__(self): self._x = None


Please fix this to the following...

class C(object):
def __init__(self):
self._x = None

--
assignee: georg.brandl
components: Documentation
messages: 74081
nosy: fretai, georg.brandl
severity: normal
status: open
title: A Bug in the Documentation
versions: Python 3.0, Python 3.1

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3187] os.listdir can return byte strings

2008-09-30 Thread Martin v. Löwis

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

Here is a patch that solves the issue in a different way: it introduces
sys.setfilesystemencoding. If applications invoke
sys.setfilesystemencoding("iso-8859-1"), all file names can be
successfully converted into a character string.

Added file: http://bugs.python.org/file11663/setfsenc.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3863] 2.6rc1: test_threading hangs on FreeBSD 6.3 i386

2008-09-30 Thread Hirokazu Yamamoto

Hirokazu Yamamoto <[EMAIL PROTECTED]> added the comment:

Cygwin1.5 also hangs on test_3_join_in_forked_from_thread.
Cygwin1.7 + following snapshot doesn't hang but
http://cygwin.com/snapshots/cygwin1-20080929.dll.bz2
fails with following message.

==
FAIL: test_3_join_in_forked_from_thread (__main__.ThreadJoinOnShutdown)
--
Traceback (most recent call last):
  File "Lib/test/test_threading.py", line 400, in
test_3_join_in_forked_from_thr
ead
self._run_and_join(script)
  File "Lib/test/test_threading.py", line 342, in _run_and_join
self.assertEqual(data, "end of main\nend of thread\n")
AssertionError: '' != 'end of main\nend of thread\n'

If stdout is unbuffered mode,
$ export PYTHONUNBUFFERED=x
test passes.

--
nosy: +ocean-city

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3862] test_array fails on FreeBSD7 amd64

2008-09-30 Thread Mark Dickinson

Mark Dickinson <[EMAIL PROTECTED]> added the comment:

The 2**16 in the error message is wrong.  Maybe the error message should
be something like:

"Attempt to create array of size larger than maxsize failed to raise
MemoryError."

A bit verbose, but more accurate.

There's another error in that patch, too.  The line:

b * maxsize//3 + 1

should be

b * (maxsize//3 + 1)

(I was mistakenly reading the '*' as '*=', as in the first test.)

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3770] test_multiprocessing fails on systems with HAVE_SEM_OPEN=0

2008-09-30 Thread Andrew I MacIntyre

Andrew I MacIntyre <[EMAIL PROTECTED]> added the comment:

The checked in change has the planned effect on FreeBSD 6.3 i386. I
can't check on my 7.0 amd64 box as I can't quickly put a current source
tree on it.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3862] test_array fails on FreeBSD7 amd64

2008-09-30 Thread Andrew I MacIntyre

Andrew I MacIntyre <[EMAIL PROTECTED]> added the comment:

On FreeBSD 7.0 amd64, applying Mark's patch does get the test to pass.

As noted on python-dev, the response I got from the author of the new
malloc() package in FreeBSD 7.x indicates that as of 7.1 the allocator
defaults to using sbrk() rather than mmap() (strategy selection is
tunable with an environment variable) so the problematic behaviour
should be masked once 7.1 is released.

Martin: I'm missing something regarding your comment about the failure
message - the exception text seems literally correct (though not
particularly useful), though I haven't spent a lot of time trying to
understand how test_array works.  What would you suggest?

___
Python tracker <[EMAIL PROTECTED]>

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



[issue4001] 2to3 does relative import for modules not in a package.

2008-09-30 Thread Mark Hammond

New submission from Mark Hammond <[EMAIL PROTECTED]>:

Create an empty directory with only 2 files, foo.py and bar.py, both
exactly 1 line:

foo.py:
|from bar import bar
bar.py:
|bar = "bar"

Running 2to3 results in the following patch for foo.py:
-from bar import bar
+from .bar import bar

However, the resulting foo.py fails to run - the 2 files are not in a
package, so we get:

| ValueError: Attempted relative import in non-package

Attaching a patch which checks there is an __init__.py in the same
directory as the files before it considers it a potential relative import.

--
components: 2to3 (2.x to 3.0 conversion tool)
files: relative_must_be_package.patch
keywords: patch
messages: 74075
nosy: mhammond
severity: normal
status: open
title: 2to3 does relative import for modules not in a package.
Added file: http://bugs.python.org/file11662/relative_must_be_package.patch

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3863] 2.6rc1: test_threading hangs on FreeBSD 6.3 i386

2008-09-30 Thread Andrew I MacIntyre

Andrew I MacIntyre <[EMAIL PROTECTED]> added the comment:

I believe this issue ties into the underlying problem FreeBSD 6.x upto
and including 6.3R have with fork() in a threaded application - see the
6.3R errata notice referenced in issue3864.

The issue should be fixed in FreeBSD 6.4 (currently in beta), but it
would be nice to get the patch in to Python 2.6 and Python 3.0 (not sure
about 2.5) just so that running the test doesn't hang on earlier 6.x
releases.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue1745035] DoS smtpd vulnerability

2008-09-30 Thread Giampaolo Rodola'

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

Yes, you're right. I mixed up SMTP with FTP which does not send data on
the same connection used for receiving commands.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3723] Py_NewInterpreter does not work

2008-09-30 Thread Graham Dumpleton

Graham Dumpleton <[EMAIL PROTECTED]> added the comment:

Unified diff now attached.

Added file: http://bugs.python.org/file11661/pythonrun.c.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3723] Py_NewInterpreter does not work

2008-09-30 Thread Graham Dumpleton

Changes by Graham Dumpleton <[EMAIL PROTECTED]>:


Removed file: http://bugs.python.org/file11660/pythonrun.c.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3723] Py_NewInterpreter does not work

2008-09-30 Thread Graham Dumpleton

Graham Dumpleton <[EMAIL PROTECTED]> added the comment:

Argh. Personally I like to provide context diff's but more often than not 
get abused for providing them over a unified diff. Was in a hurry this 
time as had only a couple of minutes of battery life left on the laptop, 
so quickly did it without thinking and then ran off to find a power point. 
:-)

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3723] Py_NewInterpreter does not work

2008-09-30 Thread Amaury Forgeot d'Arc

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

Your patch may go in the right direction, but please provide only
context diff or unified diff files. 
Use "diff -du", or "svn diff" to generate the file.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3723] Py_NewInterpreter does not work

2008-09-30 Thread Graham Dumpleton

Graham Dumpleton <[EMAIL PROTECTED]> added the comment:

Adding the functions as initfunc in module init table is of no use as 
they aren't invoked when creating a sub interpreter.

One thing that does appear to work, although no idea of whether it is 
correct way to solve problem, is to duplicate the builtin/sys 
initialisation that occurs in Py_InitializeEx() function.

Attached diff shows nature of changes. Diff is bit messy as have left 
existing code in there but #ifdef'd out.

Maybe this will give someone who knows how overall interpreter 
initialisation is supposed to work a head start on coming up with proper 
fix. But then it could be totally wrong as well.

At least with change as is, mod_wsgi works for sub interpreters now. 
I'll do more work later on whether it is correct way to solve it.

--
nosy: +grahamd
Added file: http://bugs.python.org/file11660/pythonrun.c.diff

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3999] Real segmentation fault handler

2008-09-30 Thread STINNER Victor

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

Note: my patch can be adapted to catch SIGFPE (divison by zero or 
other math error). For int/long types, Python avoids divison by zero, 
but for code written in C ("external modules"), Python is unable to 
catch such errors. Eg. see last imageop issue: i was possible to 
generate many divisions by zero.

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3999] Real segmentation fault handler

2008-09-30 Thread STINNER Victor

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

@amaury.forgeotdarc: It looks like PyOS_CheckStack() is only 
implemented for Windows. It uses alloca() + __try/__except + 
_resetstkoflw(). The GNU libc nor Linux kernel don't check stack 
pointer on alloca(), it's just $esp += . Using 
alloca() you may also be able to able outside the stack to move your 
stack pointer to the heap or another memory mapping. PyOS_CheckStack() 
doesn't really protect the stack: if a function use alloca() or a 
similar construction like « void test(int size) { char 
allocated_on_the_stack[size]; ... } », you will not catch this error.

PyOS_CheckStack() only checks one type of error: stack overflow. It 
doesn't check invalid memory read / write (see my first example, 
read.py).

___
Python tracker <[EMAIL PROTECTED]>

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



[issue3999] Real segmentation fault handler

2008-09-30 Thread Amaury Forgeot d'Arc

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

Did you consider using PyOS_CheckStack for this?
Currently there is only a Windows implementation, but it seems that the
primitives you use in your patch could form a Unix version.

--
nosy: +amaury.forgeotdarc

___
Python tracker <[EMAIL PROTECTED]>

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