[issue1533] Bug in range() function for large values

2010-05-02 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Thanks---the new patch looks good.  Pulling the argument conversion out into a 
separate function makes the whole thing much cleaner.

I still have a couple of nits:

 - Please add a comment before get_range_argument indicating
   what it's for.  I'd also consider naming the function something
   more descriptive like 'convert_range_argument' rather than
   'get_range_argument', but I've never been good with names...

 - Good catch about checking the return type of nb_int.  The error
   message should refer to __int__ though, not nb_int:  nb_int
   won't make much sense to most Python users.

 - I notice that get_range_argument steals a reference to arg.  That's
   fine of course, but it's a little bit unusual, so there should be
   a comment pointing that out somewhere.  It *might* be preferable to
   not steal the reference, and just do the usual 'return a new
   reference' thing instead; I know that leads to a little bit
   more boilerplate in handle_range_longs, but I think the code ends
   up clearer, and there won't be surprises for someone who tries to
   reuse the code in get_range_argument for their own conversions.  I
   leave it up to you. :)

 - Please could you also add a test for small arguments for each test
   class?

 - Style nit:  the codebase mostly avoids assignments in 'if' conditions;
   please separate the assignment and the NULL test in lines like
   if (!(ilow = get_range_argument(ilow, start))).  Also,
   if (ilow == NULL) is preferable to if (!ilow).

Thanks again for doing this.

--

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



[issue1533] Bug in range() function for large values

2010-05-02 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Thinking about it a bit more, I really would prefer get_range_argument not to 
steal a reference.  If I'm reading a bit of C code and encounter something like:

  obj = transform(obj);
  if (obj == NULL) ...

my hindbrain immediately starts fretting that something's wrong, and I have to 
go and ferret out the definition of 'transform' to be sure.  In contrast, 
patterns like:

  temp = transform(obj);
  Py_DECREF(obj);
  obj = temp;
  if (obj == NULL) ...

are so common and familiar in the Python codebase that they don't raise the 
same sort of red flag.

--

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



[issue8533] regrtest: use backslashreplace error handler for stdout

2010-05-02 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Ok, let's try sys.stderr solution: commited in r80694 (py3k).

If it breaks buildbot outputs, I will revert it and try the second solution.

--
status: open - pending

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



[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal

2010-05-02 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

The bug only occurs on Mac OS X because file system encoding is hardcoded to 
UTF-8 on this OS and the test is skipped if the file system encoding is ASCII.

But the bug is not specific to test_warnings, as mentionned by R. David Murray: 
#8533 is the real bug. test_warnings is just an example to reproduce it.

I just commited a fix for #8533: it should fix also this issue.

--
assignee: brett.cannon - haypo
dependencies: +regrtest: use backslashreplace error handler for stdout

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



[issue1533] Bug in range() function for large values

2010-05-02 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

BTW, I've changed the various nb_int should return int object error messages 
in Objects/intobject.c to the more meaningful and accurate message: __int__ 
method should return an integer, in r80695.

--

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



[issue7192] webbrowser.get(firefox) does not work on Mac with installed Firefox

2010-05-02 Thread Ronald Oussoren

Ronald Oussoren ronaldousso...@mac.com added the comment:

Firefox doesn't seem to support a full scripting api, which makes opening tabs 
and windows harder.

I've committed an alternate version of your patch in r80698: This uses 
osascript to open the url instead of the open command. I've also added a 
registration for safari.

The main reason to use osascript instead of just open is that it might be 
possible to add support for opening new tabs or windows later on by adjusting 
the script.

--
resolution:  - fixed

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



[issue7192] webbrowser.get(firefox) does not work on Mac with installed Firefox

2010-05-02 Thread Ronald Oussoren

Ronald Oussoren ronaldousso...@mac.com added the comment:

I've ported the change to 3.2 as well.

--

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



[issue8598] test/support: don't use localhost as IPv6 host name

2010-05-02 Thread STINNER Victor

New submission from STINNER Victor victor.stin...@haypocalc.com:

TestIPv6Environment testcase of test_ftplib uses support.HOST as hostname, and 
HOST=localhost. Usually, localhost is the name of 127.0.0.1, but not always 
::1. On Linux, the usual names for ::1 are ip6-localhost or ip6-loopback. My 
internet server provider DNS resolver does not always resolv localhost as 
::1, sometimes it answer 3(NXDOMAIN). Anyway, the name should be resolved by 
the local DNS resolver, not depend on an external (ISP) DNS server.

The simplest solution is to use ::1 instead of localhost ;-)

--
components: Tests
messages: 104778
nosy: haypo
priority: normal
severity: normal
status: open
title: test/support: don't use localhost as IPv6 host name
versions: Python 2.7, Python 3.2

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



[issue8596] crypt blowfish 'ignores' salt

2010-05-02 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

I doubt this is a Python issue, since the crypt function does little more than 
wrap the system crypt function.

What does your man page for crypt say?  Are you sure you're providing a salt 
that the system crypt accepts?

--
nosy: +mark.dickinson

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



[issue8598] test/support: don't use localhost as IPv6 host name

2010-05-02 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Attached patch uses IPV6_HOST='::1'.

--
keywords: +patch
Added file: http://bugs.python.org/file17183/support_ipv6_host.patch

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



[issue8596] crypt blowfish 'ignores' salt

2010-05-02 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
resolution:  - invalid
status: open - pending

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



[issue8598] test/support: don't use localhost as IPv6 host name

2010-05-02 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Mac OS X 10.6.3 has ::1  localhost.

My Ubuntu 9.10 has ::1  ip6-localhost ip6-loopback but I don't rember if I 
edited this line or not. I don't think so.

--

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



[issue8598] test/support: don't use localhost as IPv6 host name

2010-05-02 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Debian Sid has ::1 ip6-localhost ip6-loopback localhost.

--

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



[issue8567] decimal module doesn't respect precedence rules for exceptional conditions

2010-05-02 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
stage: unit test needed - patch review

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



[issue8533] regrtest: use backslashreplace error handler for stdout

2010-05-02 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Since it may reorder output, I think it's better revert the patch and try the 
other solution. However, I don't think you need to replace sys.stdout at all: 
just output the traceback more carefully.

--
status: pending - open

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



[issue8455] buildbot: test_urllib2_localnet failures (Connection refused) on Tiger buildbot

2010-05-02 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

I'm also seeing this on OS X 10.6.  It seems to have started with r80243.

--
nosy: +mark.dickinson, ronaldoussoren

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




[issue8455] buildbot: test_urllib2_localnet failures (Connection refused) on Tiger buildbot

2010-05-02 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

To clarify, that last message was about trunk, where this test is failing for 
me since r80243.  Adding 2.7 to the versions.

--
versions: +Python 2.7

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



[issue8538] Add ConfigureAction to argparse

2010-05-02 Thread Yaniv Aknin

Changes by Yaniv Aknin yaniv.ak...@gmail.com:


--
nosy: +Yaniv.Aknin

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



[issue7192] webbrowser.get(firefox) does not work on Mac with installed Firefox

2010-05-02 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

issue 8238 notes the problem with autoraise and new on windows.  I believe when 
I looked at that issue that I confirmed that the syntax webbrowser uses on 
Linux to support those options works on windows with the current firefox, even 
though I couldn't find them documented anywhere.  If I'm remembering correctly, 
then I would expect them to work on Mac, as well.

Webbrowser needs to be refactored so that browser specific support is not not 
required to be also platform specific.

--
nosy: +r.david.murray

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



[issue8597] build out-of-line asm on Windows

2010-05-02 Thread Brian Curtin

Changes by Brian Curtin cur...@acm.org:


--
nosy: +brian.curtin

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



[issue3445] Ignore missing attributes in functools.update_wrapper

2010-05-02 Thread July Tikhonov

July Tikhonov july.t...@gmail.com added the comment:

Patch updated: bound and unbound methods, user-defined callable, partial object 
included in test.

By the way,

 [id(abs.__doc__) for i in range(5)]
[140714383081744, 140714383081744, 140714383081744, 140714383081744, 
140714383081744]
 [id(s) for s in [abs.__doc__ for i in range(5)]]
[140714383084040, 140714383082976, 140714383083144, 140714383075904, 
140714383081744]

How it can be explained? Built-in functions (and methods) _sometimes_ return a 
new instance of its '__doc__' (and '__name__'), and sometimes does not.
(I found this trying to include built-in method into the test.)

--
nosy: +july
Added file: 
http://bugs.python.org/file17184/update_wrapper-ignore-missing-attributes.patch

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



[issue8599] _execvpe should behaves inconsistently when PATH includes a filename

2010-05-02 Thread Oren Held

New submission from Oren Held o...@held.org.il:

A. Description
When running os._execvpe with a relative pathname that does not exist, I'd 
expect to get ENOENT error. But there is an edge case in which Python throws 
ENOTDIR error - when the LAST element in PATH is a regular file (e.g. /bin/ls). 
This case is caused by a sysadmin mistake, but it may happen, as in the system 
on which I've encountered this bug.

B. Explanation + How to reproduce:
Consider the following case:
PATH=/bin:/bin/ls # Last part is a filename instead of a directory
 import os; os.execvp(blabla, [])
Throws: OSError: [Errno 20] Not a directory

Now, consider a similar but differently-ordered PATH:
PATH=/bin/ls:/bin # *First* part is a filename instead of a directory
 import os; os.execvp(blabla, [])
Throws: OSError: [Errno 2] No such file or directory


C. Why this behavior is not good:
First, IMO there is a certain problem here - differently ordered PATH shouldn't 
throw different exception. In both cases the executable was not found in PATH, 
both cases are the same for this matter.

Second, the unix shell (e.g. bash) faces the same issue, and behaves 
differently. It'll return command not found to stdout for both ENOENT and 
ENOTDIR cases, regardless of the element order in PATH.


D. My recommendation
I'd recommend throwing ENOENT even when ENODIR is thrown for some paths. I am 
not sure what's the least-evil way to do it, I've been thinking of the 
following patch, but it's not working because it depends on strerror. It also 
looks kinda ugly:

--- os.py.old   2010-05-02 17:41:21.481909804 +0300
+++ os.py   2010-05-02 18:03:11.261872651 +0300
@@ -386,7 +386,7 @@
 saved_tb = tb
 if saved_exc:
 raise error, saved_exc, saved_tb
-raise error, e, tb
+raise error, error(errno.ENOENT, os.strerror(errno.ENOENT)), tb # DOESNT 
WORK, no access to os.strerror from here
 
 # Change environ to automatically call putenv() if it exists
 try:

--
components: Library (Lib)
messages: 104788
nosy: Oren_Held
priority: normal
severity: normal
status: open
title: _execvpe should behaves inconsistently when PATH includes a filename
type: behavior
versions: Python 2.6

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



[issue8599] _execvpe behaves inconsistently when PATH includes a filename

2010-05-02 Thread Oren Held

Changes by Oren Held o...@held.org.il:


--
title: _execvpe should behaves inconsistently when PATH includes a filename - 
_execvpe behaves inconsistently when PATH includes a filename

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



[issue8599] _execvpe behaves inconsistently when PATH includes a filename

2010-05-02 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

The python functions are thin wrappers around the system calls, and are 
reporting the result of calling the corresponding system call.  The fact that 
the shell chooses to catch both errors and report a single one would be 
equivalent to, say, the cmd module doing something similar.  It would not be 
appropriate for the os module to combine the distinct errors into one.

--
nosy: +r.david.murray
resolution:  - invalid
stage:  - committed/rejected
status: open - closed

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



[issue8597] build out-of-line asm on Windows

2010-05-02 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

I think this is a duplicate of issue 7546.

--
nosy: +skrah
type: behavior - feature request

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



[issue8598] test/support: don't use localhost as IPv6 host name

2010-05-02 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

All of my Gentoo systems except one have localhost on the ::1 line.  The one 
that doesn't hasn't been updated in several years.  That one has the same entry 
for ::1 as your Ubuntu.

The FreeBSD 6.3 box I have access to has localhost on the ::1 line.

It has long been true that there are test failures if the testing system cannot 
resolve its own hostname, which often requires fixing /etc/hosts on linux 
systems.  You could call this bug a local system configuration error, too, but 
whether or not that is politic depends on whether or not there are in fact 
standard distributions that don't have localhost on the ::1 line.

--
nosy: +r.david.murray

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



[issue8597] build out-of-line asm on Windows

2010-05-02 Thread Tarek Ziadé

Tarek Ziadé ziade.ta...@gmail.com added the comment:

Distutils is frozen, switching to distutils2

--
components: +Distutils2 -Distutils

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



[issue7546] msvc9compiler.py: add .asm extension

2010-05-02 Thread Tarek Ziadé

Tarek Ziadé ziade.ta...@gmail.com added the comment:

Distutils is frozen, switching to distutils2

--
components: +Distutils2 -Distutils

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



[issue2091] file accepts 'rU+' as a mode

2010-05-02 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
keywords: +needs review
stage: patch review - commit review

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



[issue8533] regrtest: use backslashreplace error handler for stdout

2010-05-02 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

As expected, the patch doesn't work: it randomize the output order :-(

I checked sparc Ubuntu 3.x: the output order is correct. test_xxx lines are 
written to stdout, FAIL: ... + traceback are written to stderr, and the lines 
are written in the right order.

But it failed on x86 Tiger 3.x :
http://www.python.org/dev/buildbot/3.x/builders/x86 Tiger 
3.x/builds/130/steps/test/logs/stdio
http://www.python.org/dev/buildbot/3.x/builders/x86 Tiger 
3.x/builds/131/steps/test/logs/stdio

When a test is reexecuted in verbose mode, the output is written in red (why 
not, but it was not the case before my commit), and the stdout and stderr are 
in a mixed.

--

antoine just output the traceback more carefully.

Encode the traceback by hand would be possible, but it's more complex. A 
possible solution would be to write the output to a StringIO, encode unicode to 
bytes using the right encoding and backslashreplace error handler, and write 
the result to stdout. But I don't like buffering the output because the 
buildbot may hung for different reasons (search in the bug tracker for 
test_multiprocessing or test_subprocess...) and the buildbot master may 
consider the buildbot as dead (no new output since xxx seconds, whereas it's 
writing to a buffer).

--

I prefer my first simple idea: use backslashreplace error handler for stdout. 
Let's try: r80703. This commit reverts my previous commit, apply 
regrtest_stdout_backslashreplace.patch + a fix for multiprocessing mode 
(regrtest.py -j ...).

--

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



[issue8583] Hardcoded namespace_separator in the cElementTree.XMLParser

2010-05-02 Thread Stefan Behnel

Stefan Behnel sco...@users.sourceforge.net added the comment:

There is at least one valid use case: code that needs to deal with HTML and 
XHTML currently has to normalise the tag names in some way, which usually means 
that it will want to remove the namespaces from XHTML documents to make it look 
like plain HTML. It would be nice if the library could do this efficiently 
right in the parser by simply removing all namespace declarations. However, 
this doesn't really apply to (c)ElementTree where the parser does not support 
HTML parsing.

I'm -1 on the interface that the proposed patch adds. The keyword argument name 
and its semantics are badly chosen. A boolean flag will work much better.

The proposed feature will have to be used with great care by users. Code that 
depends on it is very fragile and will fail when an input document uses 
unexpected namespaces, e.g. to embed foreign content, or because it is actually 
written in a different XML language that just happens to have similar local tag 
names. This kind of code is rather hard to fix, as fixing it means that it will 
stop accepting documents that previously passed without problems. Rejecting 
broken input early is a virtue.

All in all, I'm -0.5 on this feature as I'd expect most use cases to be 
premature optimisations with potentially dangerous side effects more than 
anything else.

--
nosy: +scoder

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



[issue8598] test/support: don't use localhost as IPv6 host name

2010-05-02 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Oh, I forgot to copy/paste a test_ftplib failure:
==
ERROR: test_makeport (test.test_ftplib.TestIPv6Environment)
--
Traceback (most recent call last):
  File /home/SHARE/SVN/py3k/Lib/test/test_ftplib.py, line 561, in setUp
self.server = DummyFTPServer((HOST, 0), af=socket.AF_INET6)
  File /home/SHARE/SVN/py3k/Lib/test/test_ftplib.py, line 213, in __init__
self.bind(address)
  File /home/SHARE/SVN/py3k/Lib/asyncore.py, line 329, in bind
return self.socket.bind(addr)
socket.gaierror: [Errno -5] No address associated with hostname

==
ERROR: test_transfer (test.test_ftplib.TestIPv6Environment)
--
Traceback (most recent call last):
  File /home/SHARE/SVN/py3k/Lib/test/test_ftplib.py, line 561, in setUp
self.server = DummyFTPServer((HOST, 0), af=socket.AF_INET6)
  File /home/SHARE/SVN/py3k/Lib/test/test_ftplib.py, line 213, in __init__
self.bind(address)
  File /home/SHARE/SVN/py3k/Lib/asyncore.py, line 329, in bind
return self.socket.bind(addr)
socket.gaierror: [Errno -5] No address associated with hostname

--

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



[issue4687] GC stats not accurate because of debug overhead

2010-05-02 Thread Tres Seaver

Tres Seaver tsea...@agendaless.com added the comment:

The patch looks obviously correct to me.

I can confirm that the patch applies cleanly both to the trunk and to the 
'release26-maint' branch, and that the 'test_gc' tests pass in both cases after 
applying it and rebuilding.

--
nosy: +tseaver

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



[issue4687] GC stats not accurate because of debug overhead

2010-05-02 Thread Tres Seaver

Changes by Tres Seaver tsea...@agendaless.com:


--
versions: +Python 2.6

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



[issue4265] shutil.copyfile() leaks file descriptors when disk fills

2010-05-02 Thread Tres Seaver

Tres Seaver tsea...@agendaless.com added the comment:

This bug exists on Python 2.6, too.

It seems to me that the right solution here is to use both opened files as 
context managers.  See attached patch (made against the release26-maint branch).

The patch also cleans up the old-style exception signature in the precondition 
check.

--
keywords: +patch
nosy: +tseaver
Added file: http://bugs.python.org/file17185/issue4265_shutil_copyfile.patch

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



[issue4265] shutil.copyfile() leaks file descriptors when disk fills

2010-05-02 Thread Tres Seaver

Changes by Tres Seaver tsea...@agendaless.com:


--
versions: +Python 2.6

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



[issue4265] shutil.copyfile() leaks file descriptors when disk fills

2010-05-02 Thread Tres Seaver

Tres Seaver tsea...@agendaless.com added the comment:

The patch doesn't apply cleanly to trunk.  Attached is one which does.

--
Added file: 
http://bugs.python.org/file17186/issue4265_shutil_copyfile-trunk.patch

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



[issue4687] GC stats not accurate because of debug overhead

2010-05-02 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Thank you. Now committed in r80704 (trunk), r80705 (py3k), r80706 (2.6), r80707 
(3.1).

--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed
versions: +Python 3.1, Python 3.2

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



[issue1777134] minidom pretty xml output improvement

2010-05-02 Thread Tres Seaver

Tres Seaver tsea...@agendaless.com added the comment:

The patch applies cleanly to the 2.6 branch, and with minimal fuzz to
the trunk.  Exsting tests pass in both cases, as does the new test.

The added testcase seems plainly correct.

The first hunk of the  diff to Lib/xml/dom/minidom.py is a little messy
/ hard to follow:

- It makes the module less PEP8 conformant (line length  80, operator
  spacing)

- The 'onetextnode' flag is set, but never used.

The second hunk is somewhat problematic:  it changes 'Text.writexml' to
ignore any explicit 'indent' or 'newl' argument passed, which is a
backwards-incompatible behavior change.  Perhaps changing the default
values for those arguments to 'None', and then using the new code path
in that case, would be the better course, while falling back to the old
one if either is passed.

I'm not sure about the justification for the third hunk at all (removing
the newline at the end of the XML prologue).  There *can't* be any
meaningful whitespace outside of the root element, so we shouldn't have
round-trip issues if we leave it.

--
nosy: +tseaver

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



[issue4265] shutil.copyfile() leaks file descriptors when disk fills

2010-05-02 Thread Tarek Ziadé

Changes by Tarek Ziadé ziade.ta...@gmail.com:


--
assignee:  - tarek
nosy: +tarek

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



[issue8514] Create fsencode() and fsdecode() functions in os.path

2010-05-02 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

I really, really, REALLY think that it is bad to mix issues. This makes patch 
review impossible.

This specific issue is about introducing an fsdecode and fsencode function; 
this is what the bug title says, and what the initial patch did.

Whether or not byte-oriented access to environment variables is also needed is 
a *separate* issue. -1 on dealing with that in this report.

FWIW, I'm +0 on adding these functions. MAL, please stop messing issue 
subjects. If you are fundamentally opposed to adding such functions, please 
request that a PEP be written or something. Otherwise, I accept the original 
patch.

I'm -1 on issue8514.patch; it is out-of-scope of the issue.

--
resolution:  - accepted

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



[issue3704] cookielib doesn't handle URLs with / in parameters

2010-05-02 Thread Tres Seaver

Tres Seaver tsea...@agendaless.com added the comment:

I can confirm that the patch applies cleanly to the release26-maint
branch, and that the updated test fails without the updated
implementation.

However, the entire approach seems wrong to me:  the patched method
has just called 'request_path', which already cracked the URL using
urlparse.urlparse and put it back together again with
urlparse.urlunparse.

A better fix would be either to call urlparse.urlparse directly, or
else to add an argument to 'request_path' which kept it from doing the
unwanted reassembly.

Attaching a patch which implements the latter strategy.  Greg's new
test passes with this patch applied in place of the part of his patch
which touches Lib/cookielib.py.

--
nosy: +tseaver
Added file: http://bugs.python.org/file17187/issue3704-better_request_path.patch

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



[issue8598] test/support: don't use localhost as IPv6 host name

2010-05-02 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +giampaolo.rodola

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



[issue8596] crypt blowfish 'ignores' salt

2010-05-02 Thread pvo

pvo user+pyt...@localhost.localdomain.org added the comment:

FreeBSD's crypt(3) doesn't explain the 'salt' for Blowfish crypt exactly. 
OpenBSD's crypt(3) says: The Blowfish version of crypt has 128 bits of salt in 
order to make building dictionaries of common passwords space consuming.

I wrote a few lines of C code. Copied the salts from the output above to it and 
cryt()ed test. The result differs:
$2a$05$/Ae.aeamG.O.../52uwMz3Q1WQSyWoWTy6zNndsrkAl2fnTn.

I hope I'll find some useful hints in the near future.

--
status: pending - open

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



[issue8576] test_support.find_unused_port can cause socket conflicts on Windows

2010-05-02 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

 find_unused_port is the wrong approach altogether.  Uses of it should 
 be replaced by bind_port and then find_unused_port should be removed

I agree find_unused_port() is the wrong approach in general, but there are 
certain cases where this is needed. 
See, for example, the test for source_address parameter of 
socket.create_connection() function.

--
nosy: +giampaolo.rodola

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



[issue8576] test_support.find_unused_port can cause socket conflicts on Windows

2010-05-02 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 See, for example, the test for source_address parameter of
 socket.create_connection() function.

Instead of testing the port, you could test the host. For example
by using two different loopback addresses (127.0.0.1 and 127.0.0.2?). Would it 
work on every platform?

--

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



[issue8596] crypt blowfish 'ignores' salt

2010-05-02 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

 FreeBSD's crypt(3) doesn't explain the 'salt' for Blowfish crypt exactly.

Reading:

http://www.freebsd.org/cgi/man.cgi?query=cryptapropos=0sektion=3manpath=FreeBSD+7.2-RELEASEformat=html

and especially the section entitled Modular crypt, it looks like your salt 
should take the form $2$salt$ignored, where there are at most 8 characters of 
salt and the 'ignored' bit is ignored.

So your $2a$ looks wrong to me:  shouldn't it be $2$?  And after that, in the 
examples that you give, the only used portion of the salt is 05, which is the 
same in all the examples, so I'd expect to get the same output in each case.

I can't see any way that Python could be contributing to this:  if you look at 
the implementation (in Modules/cryptmodule.c), you'll see that the crypt 
function (called crypt_crypt in the source) really is a trivial wrapper around 
the system function;  there's no pre- or post-processing of arguments.

Can you attach the C code that's giving the different results?

--
status: open - closed

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



[issue8596] crypt blowfish 'ignores' salt

2010-05-02 Thread pvo

pvo user+pyt...@localhost.localdomain.org added the comment:

$2a$12$saltysalt$ignored
 ^  ^  ^ ^
 |  |  |  \_ignored
 |  |  \_the salt
 |  \_number of rounds (04-31)
 \_ crypt id
 
About the crypt id:
I read too much Blowfish crypt related stuff in the recent both days. Can't 
remember exactly the difference between the IDs '2' and '2a'. The 
/etc/master.passwd on my OpenBSD contains encrypted passwords with the '2a' ID.

The C code is attached.

--
Added file: http://bugs.python.org/file17188/blf_crypt.c

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



[issue8600] test_gdb failures

2010-05-02 Thread Antoine Pitrou

New submission from Antoine Pitrou pit...@free.fr:

All test_gdb tests fail here with both trunk and py3k. The failure is always 
the same so I'm just quoting one of them below:

==
FAIL: test_basic_command (test.test_gdb.PyBtTests)
Verify that the py-bt command works
--
Traceback (most recent call last):
  File /home/antoine/py3k/__svn__/Lib/test/test_gdb.py, line 604, in 
test_basic_command
cmds_after_breakpoint=['py-bt'])
  File /home/antoine/py3k/__svn__/Lib/test/test_gdb.py, line 126, in 
get_stack_trace
self.assertEquals(err, '')
AssertionError: 
- warning: Unable to find libthread_db matching inferior's thread library, 
thread debugging will not be available.
- warning: Unable to find libthread_db matching inferior's thread library, 
thread debugging will not be available.
- warning: Unable to find libthread_db matching inferior's thread library, 
thread debugging will not be available.
- warning: Unable to find libthread_db matching inferior's thread library, 
thread debugging will not be available.
- warning: Unable to find libthread_db matching inferior's thread library, 
thread debugging will not be available.


This is with:

GNU gdb (GDB) 7.1-1mdv2010.1 (Mandriva Linux release 2010.1)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type show copying
and show warranty for details.
This GDB was configured as x86_64-mandriva-linux-gnu.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.

--
assignee: dmalcolm
components: Tests
messages: 104810
nosy: dmalcolm, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: test_gdb failures
type: behavior
versions: Python 2.7, Python 3.2

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



[issue1533] Bug in range() function for large values

2010-05-02 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

Attached patch, issue1533.diff, simplifies reference acrobatics at the expense 
of extra local variables.  For the first time the first compilation did not 
have reference counting errors!

--
Added file: http://bugs.python.org/file17189/issue1533.diff

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



[issue1533] Bug in range() function for large values

2010-05-02 Thread Alexander Belopolsky

Changes by Alexander Belopolsky belopol...@users.sourceforge.net:


Removed file: http://bugs.python.org/file9543/bltinmodule.diff

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



[issue1533] Bug in range() function for large values

2010-05-02 Thread Alexander Belopolsky

Changes by Alexander Belopolsky belopol...@users.sourceforge.net:


Removed file: http://bugs.python.org/file17176/bltinmodule4.diff

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



[issue1533] Bug in range() function for large values

2010-05-02 Thread Alexander Belopolsky

Changes by Alexander Belopolsky belopol...@users.sourceforge.net:


Removed file: http://bugs.python.org/file17171/bltinmodule3.diff

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



[issue1533] Bug in range() function for large values

2010-05-02 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

On Sun, May 2, 2010 at 4:37 AM, Mark Dickinson rep...@bugs.python.org wrote:
..
  - Please could you also add a test for small arguments for each test
   class?

Working on it ...

--

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



[issue1533] Bug in range() function for large values

2010-05-02 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

  - Please could you also add a test for small arguments for each test
   class?

Done.

--
Added file: http://bugs.python.org/file17190/issue1533.diff

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



[issue1533] Bug in range() function for large values

2010-05-02 Thread Alexander Belopolsky

Changes by Alexander Belopolsky belopol...@users.sourceforge.net:


Removed file: http://bugs.python.org/file17189/issue1533.diff

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



[issue1429] FD leak in SocketServer

2010-05-02 Thread Jeff McNeil

Jeff McNeil j...@jmcneil.net added the comment:

I was toying with adding Unix Socket support for one of our internal tools and 
I thought I ran into a leak in my own code. Searched the bug tracker and found 
this.

I tried to reproduce, but wasn't able to. Though, if you look at the 
ThreadingMixIn class, you'll see this:

self.handle_error(request, client_address)
self.close_request(request)

An exception in handle_error, most likely from a subclass, would cause 
close_request to never fire. Though, the socket.accept'd channel would probably 
be shut down implicitly when leaving _handle_request_nonblock.

--
nosy: +mcjeff

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



[issue8583] Hardcoded namespace_separator in the cElementTree.XMLParser

2010-05-02 Thread Dmitry Chichkov

Dmitry Chichkov dchich...@gmail.com added the comment:

I agree that the argument name choice is poor. But it have already been made by 
whoever coded the EXPAT parser which cElementTree.XMLParser wraps. So there is 
not much room here.

As to 'proposed feature have to be used with great care by users' - this s 
already taken care of. If you look - cElementTree.XMLParser class is a rather 
obscure one. As I understand it is only being used by users requiring high 
performance xml parsing for large datasets (10GB - 10TB range) in data-mining 
applications.

--

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



[issue8583] Hardcoded namespace_separator in the cElementTree.XMLParser

2010-05-02 Thread Dmitry Chichkov

Dmitry Chichkov dchich...@gmail.com added the comment:

Interestingly in precisely these applications often you don't care about 
namespaces at all. Often all you need is to extract 'text' or 'name' elements 
irregardless of the namespace.

--

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