[issue15777] test_capi refleak

2012-08-24 Thread Ross Lagerwall

Changes by Ross Lagerwall :


--
resolution:  -> fixed
stage: needs patch -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue15731] Mechanism for inheriting docstrings and signatures

2012-08-24 Thread Chris Rebert

Changes by Chris Rebert :


--
nosy: +cvrebert

___
Python tracker 

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



[issue634412] RFC 2387 in email package

2012-08-24 Thread R. David Murray

R. David Murray added the comment:

http://tools.ietf.org/html/rfc2387 has obsoleted 2112.

--
title: RFC 2112 in email package -> RFC 2387 in email package
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue14649] doctest.DocTestSuite error misleading when module has no docstrings

2012-08-24 Thread R. David Murray

R. David Murray added the comment:

Personally I prefer to have the test case create the file(s) used in the test 
dynamically, writing them to the temporary working directory.  Since these are 
Python modules, you could use the helpers from script_helpers for this.

Otherwise I think your patch is OK.  I don't think we have a doc convention for 
"unfortunate implementation detail" :(  We have in the past put notes in the 
doc that say "this may change in the future", though that is usually about 
desired enhancements.  But perhaps it could apply here as well.

--

___
Python tracker 

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



[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Looks to me like python grabs an outgoing port number via unrandom means

Python does not grab an outgoing port number, its lets the OS choose one (via 
connect()). The only thing to watch out for would be whether you let many 
connections open (perhaps there's a per-process limit that is reached).

> Which, if I'm understanding the code correctly, returns the source
> address used to make the connection in this instance.

getaddrinfo() does not do that. It is simply a wrapper around the C runtime 
library's getaddrinfo(), for which you can find information on the Web (for 
both the Windows and POSIX versions of it).

> If windows is responsible for giving the bad port number, I would argue
> that Python still needs to account for the problem since this is obviously 
> a major issue if it happens to someone.

It might be a major issue for whoever encounters the issue but, as Martin said, 
Python cannot do anything else than bubble up the exception for you to handle.

Since this seems to be a fairly involved Windows issue (rather than a Python 
bug), I suggest you ask for help on a help forum with Windows experts.

--
status: open -> closed

___
Python tracker 

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



[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread James Hutchison

Changes by James Hutchison :


--
components: +Windows

___
Python tracker 

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



[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread James Hutchison

James Hutchison added the comment:

Looks to me like python grabs an outgoing port number via unrandom means and if 
it happens to map to a port taken by a service that demands exclusive access, 
then it returns the WSAEACCESS error instead of WSAEADDRINUSE. Because this is 
a fairly new "feature" in windows (NT 4.0 w/ SP3), Python does not properly 
account for it by simply trying another port like it would if it got 
WSAEADDRINUSE

Arguably this would affect all aspects of Python that uses sockets.

The function in question seems to be:

getaddrinfo(host, port, 0, SOCK_STREAM)

Which, if I'm understanding the code correctly, returns the source address used 
to make the connection in this instance. Unfortunately, that function is in a 
compiled binary so I don't know how it works.

If windows is responsible for giving the bad port number, I would argue that 
Python still needs to account for the problem since this is obviously a major 
issue if it happens to someone. The fact that you mentioned that the cause is 
the fact WSAEADDRINUSE isn't the error, then that seems to imply Python is 
doing the selection.

If python is using a windows library to get outgoing port, it is also possible 
that maybe that library is outdated and it needs to use a newer one.

--

___
Python tracker 

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



[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread Brian Curtin

Changes by Brian Curtin :


--
nosy:  -brian.curtin

___
Python tracker 

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



[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread James Hutchison

Changes by James Hutchison :


--
status: closed -> open

___
Python tracker 

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



[issue14455] plistlib unable to read json and binary plist files

2012-08-24 Thread Mark Grandi

Mark Grandi added the comment:

are any more changes needed to the code that is already posted as a patch in 
this bug report? or are the changes you wanted to see happen in msg157669 not 
happen yet?

--

___
Python tracker 

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



[issue14649] doctest.DocTestSuite error misleading when module has no docstrings

2012-08-24 Thread Chris Jerdonek

Changes by Chris Jerdonek :


Added file: http://bugs.python.org/file26991/issue-14649-3.patch

___
Python tracker 

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



[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread Martin v . Löwis

Martin v. Löwis added the comment:

The Python API maps nearly 1:1 to the winsock API. So the Python code literally 
translates to the equivalent C code (with *very* minor deviations e.g. 
involving the conversion of string addresses in numeric addresses).

Please leave the issue closed unless you can provide substantial evidence that 
there is a bug in Python.

I disagree that the issue needs to be understood. This is only an acceptable 
request if you can provide a reproducible test cases, which you (currently) 
cannot. Anybody wanting to understand the issue might need physical access to 
your system, which is not feasible.

--
status: open -> closed

___
Python tracker 

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



[issue13370] test_ctypes fails when building python with clang

2012-08-24 Thread Ned Deily

Ned Deily added the comment:

Bah, I just noticed that you built --with-pydebug enabled.  That hides the 
problem.  I was fooled myself there.  But I've since verified that the failure 
still exists when built on 10.7 with Xcode 4.4.1 so the patch should go in.

--

___
Python tracker 

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



[issue14649] doctest.DocTestSuite error misleading when module has no docstrings

2012-08-24 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Here is an updated patch for review (just for the default branch for now).

The main change from the previous patch is that the ValueError exception is now 
documented.

A few additional comments/questions:

Is there a better way to signify in the documentation that certain behavior is 
an unfixable bug as opposed to desired behavior?  Would that be appropriate 
here?

I created a new folder inside Lib/test for supporting test files specific to 
doctest.  In addition to the two new files this patch adds, I would also like 
to move the eight existing support files into this new directory:

doctest_aliases.py
test_doctest.txt
test_doctest3.txt
sample_doctest.py
test_doctest2.py
test_doctest4.txt
test_doctest.py
test_doctest2.txt

Can that be done as a separate change after the patch for this issue, or should 
it be done before?

Assuming people are okay with keeping this ValueError behavior the same in the 
maintenance releases (i.e. not handling this as a bug fix), would people be 
open to changing the behavior in future versions, or should we keep the 
behavior the same in future versions as well?

--
Added file: http://bugs.python.org/file26990/issue-14649-2.patch

___
Python tracker 

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



[issue15316] runpy swallows ImportError information with relative imports

2012-08-24 Thread Brett Cannon

Changes by Brett Cannon :


--
resolution:  -> fixed
stage: test needed -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue15316] runpy swallows ImportError information with relative imports

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ca4bf8e10bc0 by Brett Cannon in branch 'default':
Issue #15316: Let exceptions raised during imports triggered by the
http://hg.python.org/cpython/rev/ca4bf8e10bc0

--
nosy: +python-dev

___
Python tracker 

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



[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread James Hutchison

James Hutchison added the comment:

I can connect to all of the IPs for my server without issue.

Found this:

Another possible reason for the WSAEACCES error is that when the bind function 
is called (on Windows NT 4.0 with SP4 and later), another application, service, 
or kernel mode driver is bound to the same address with exclusive access. Such 
exclusive access is a new feature of Windows NT 4.0 with SP4 and later, and is 
implemented by using the SO_EXCLUSIVEADDRUSE option.

So that explains why you may see either WSAEADDRINUSE or WSAEACCESS

So at this point, I think the question is - how does python choose an outgoing 
port?

--

___
Python tracker 

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



[issue13370] test_ctypes fails when building python with clang

2012-08-24 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I noticed earlier today that test_ctypes passes for Python 3.3 both with and 
without my patch. This is on OSX 10.8.1 with an up-to-date Xcode.

Configure arguments:

'--enable-framework' '--with-pydebug' 
'--enable-universalsdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk'
 '--with-universal-archs=intel' '--with-framework-name=PythonDev' 
'MACOSX_DEPLOYMENT_TARGET=10.8' 'CC=clang' 'CXX=clang++'

That's why I haven't commited the patch yet. I'm installing Xcode in a OSX 10.7 
VM to check if the patch is necessary on that platform.

--

___
Python tracker 

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



[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

By the way, please check the return value of getaddrinfo() for your SMTP server:

>>> socket.getaddrinfo("www.gmail.com", 25, 0, socket.SOCK_STREAM)
[(2, 1, 6, '', ('74.125.230.213', 25)), (2, 1, 6, '', ('74.125.230.214', 25)), 
(10, 1, 6, '', ('2a00:1450:4007:802::1016', 25, 0, 0))]

and then try to connect() to each of the addresses. If one of the addresses 
gives WSAEACCES when connecting, you've got the explanation.

--

___
Python tracker 

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



[issue15316] runpy swallows ImportError information with relative imports

2012-08-24 Thread Brett Cannon

Brett Cannon added the comment:

I am running the test suite now using the "secret" attribute on ImportError. I 
tried to pass a flag, but locking became a bit messy/complicated. And I also 
realized that if I didn't do this then using different implementation of 
import_ in importlib wouldn't work because I would be hard-coding in what 
import implementation was used which would bypass the accelerated code in 
import.c. Plus with the compatibility issues I have had in the passed, I didn't 
want to skip a step of import that someone was probably relying on.

Once Python 3.4 comes out I will create a new exception that is raised when no 
module is found and catch that class specifically to avoid this hack.

--

___
Python tracker 

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



[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread James Hutchison

James Hutchison added the comment:

The firewall is disabled for my machine.

So the options are:
1. Port was in-use: possible except that is normally a different error
2. Port was firewalled: firewall was disabled
3. Port mis-use: not likely because this wouldn't be random
4. Port was in restricted port range for some reason: admin privileges did not 
resolve

#1 seems the most plausible so far

--

___
Python tracker 

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



[issue15136] Decimal accepting Fraction

2012-08-24 Thread Zachary Ware

Zachary Ware added the comment:

(Mark:)
>To the patch:  It looks fine, as far as it goes.  It needs tests.  

I remembered tests about 5 minutes after I submitted the initial patch :P. 
Here's a patch with some tests.  Note that I've never really done tests, so 
please let me know if there need to be more/less/different tests.

>To avoid the repetition of the division code, I'd suggest doing something like:
>
>if context is None:
>context = getcontext()

(Stefan:)
>If this goes in, I'd prefer that as_decimal() always uses a localcontext().
>As the patch stands, using as_decimal() pollutes the global context flags, 
>which can be quite unexpected

My first attempt was simply:

   def as_decimal(self, context=None):
   with localcontext(context):
   return Decimal(self.numerator) / Decimal(self.denominator)

Looking through decimal.py, it looks like that should work (and in fact it does 
in 3.2.3), but it seems that _decimal will only accept a context as the 
argument to localcontext(), not None.  Is that expected, or does that need an 
issue?

I didn't catch that the patch pollutes the global context flags, that is indeed 
ugly and unacceptable.

>If the function takes a context argument, it might be better to move it
>into the decimal module as Decimal.from_fraction(context).

Perhaps both?  Implement Decimal.from_fraction(f, context) to do the real work, 
and then Fraction.to_decimal() as:

   def to_decimal(self):
   return Decimal.from_fraction(self, None)

Those who really care about the context (Decimal users working with a Fraction) 
can get what they want, and those who don't (Fraction users who want to see a 
Decimal representation) don't have to bother, and fractions.py isn't polluted 
with stuff about contexts.

--
Added file: http://bugs.python.org/file26989/issue15136_with_tests.patch

___
Python tracker 

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



[issue13370] test_ctypes fails when building python with clang

2012-08-24 Thread Ronald Oussoren

Ronald Oussoren added the comment:

That's not code duplication, but a way to silence a compiler warning. I added 
it while trying to get pyobjc to compile without any warnings.

--

___
Python tracker 

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



[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Oh, a random Google search brought the following comment from the chromium 
source code (it seems):
“connect fails with WSAEACCES when Windows Firewall blocks the connection”.

This sounds like a likelier explanation than the previous one.

--

___
Python tracker 

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



[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

According to the MSDN doc for connect():

WSAEACCES: An attempt to connect a datagram socket to broadcast address failed 
because setsockopt option SO_BROADCAST is not enabled.

However, this implies that `getaddrinfo(host, port, 0, SOCK_STREAM)` (in 
socket.create_connection) returned parameters for a datagram socket...

--

___
Python tracker 

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



[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread James Hutchison

James Hutchison added the comment:

It's from the example.

http://docs.python.org/library/socket.html#example

--

___
Python tracker 

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



[issue15573] Support unknown formats in memoryview comparisons

2012-08-24 Thread Georg Brandl

Georg Brandl added the comment:

I'm not very keen to hold up the release for long times again, especially for a 
patch of this size and lots of potential breakage.

--

___
Python tracker 

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



[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> s.bind(('',50007))

How did you find out 50007? Is it just a random number you chose?

--
nosy: +brian.curtin, pitrou, tim.golden

___
Python tracker 

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



[issue15780] IDLE (windows) with PYTHONPATH and multiple python versions

2012-08-24 Thread R. David Murray

R. David Murray added the comment:

I'm guessing that 'batch file' version of this request is answered by the new 
'py' launcher command in Python3, which can also be used with other versions of 
Python.  The obscurity of configuring things on Windows isn't directly a Python 
problem, but perhaps there are docs we could add somewhere?

--
nosy: +r.david.murray, terry.reedy

___
Python tracker 

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



[issue15780] IDLE (windows) with PYTHONPATH and multiple python versions

2012-08-24 Thread James Hutchison

New submission from James Hutchison:

One issue I've encountered is someone else's software setting PYTHONPATH to 
their install directory of python. We have some old software that installs and 
uses python 2.3 scripts and unfortunately this prevents the IDLE shortcuts for 
newer versions of python from working correctly on the system. This could be 
remedied with -E being added to the shortcut, but windows doesn't allow me to 
directly edit the IDLE shortcut, and it hides how IDLE is being launched via 
Python in the first place, making it a challenge to create my own. I'd remove 
PYTHONPATH from the system environment variables except I don't know why it's 
set in the first place.

Suggestion: IDLE safe-mode which runs with -E OR include a batch file for IDLE 
so that I can easily append my own command line arguments and create my own 
shortcuts.

--
components: IDLE
messages: 169082
nosy: Jimbofbx
priority: normal
severity: normal
status: open
title: IDLE (windows) with PYTHONPATH and multiple python versions
type: enhancement
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread James Hutchison

James Hutchison added the comment:

That makes no sense. Why does:

s = socket.socket()
s.bind(('',50007))
s.listen(1);
s.close();

fix the issue then?

Re-opening, this issue should be understood because having such an operation 
randomly fail is unacceptable for a production system. How does python choose a 
port to open a connection on? If windows reports the wrong error then shouldn't 
python try a different port number anyways (considering I have no control over 
what port Python chooses to open a connection on)?

--
status: closed -> open

___
Python tracker 

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



[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread Martin v . Löwis

Martin v. Löwis added the comment:

It's very easy to see why it survives a reboot. If there is a collision with 
some other process, that process restarts, recreating the collision. Things may 
depend on timing, so it may happen on some reboots and not on others (e.g. if 
the colliding process has picked some other port).

Closing this as "works for me".

--
resolution:  -> works for me
status: open -> closed

___
Python tracker 

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



[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread James Hutchison

James Hutchison added the comment:

This is the traceback I was getting where it was just a script that simply made 
an SMTP connection then closed it. This fails before it attempts to connect to 
the server.

Traceback (most recent call last):
  File "C:\tmp\manysmtptest.py", line 8, in 
main();
  File "C:\tmp\manysmtptest.py", line 4, in main
a = SMTP(myserver);
  File "C:\Python32\lib\smtplib.py", line 259, in __init__
(code, msg) = self.connect(host, port)
  File "C:\Python32\lib\smtplib.py", line 319, in connect
self.sock = self._get_socket(host, port, self.timeout)
  File "C:\Python32\lib\smtplib.py", line 294, in _get_socket
return socket.create_connection((host, port), timeout)
  File "C:\Python32\lib\socket.py", line 404, in create_connection
raise err
  File "C:\Python32\lib\socket.py", line 395, in create_connection
sock.connect(sa)
socket.error: [Errno 10013] An attempt was made to access a socket in a way 
forbidden by its access permissions

What I don't get is why rebooting didn't fix the problem. You'd think Python or 
Windows issue, things would resolve themselves after a reboot. All the other 
programs I was using seemed to work fine.

--

___
Python tracker 

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



[issue14521] math.copysign(1., float('nan')) returns -1.

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 121cb9596e7d by Mark Dickinson in branch '3.2':
Remove overeager test (don't depend on the sign of a nan;  cf. issue #14521)
http://hg.python.org/cpython/rev/121cb9596e7d

--

___
Python tracker 

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



[issue15710] logging module crashes in Python 2.7.3 for handler.setLevel(long)

2012-08-24 Thread Vinay Sajip

Vinay Sajip added the comment:

It's not that big a deal, and doesn't matter for 3.x anyway. It just doesn't 
seem quite right, so I'll make the change soon.

--

___
Python tracker 

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



[issue14521] math.copysign(1., float('nan')) returns -1.

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 31a7ff299698 by Mark Dickinson in branch '2.7':
Remove overeager test (don't depend on the sign of a nan;  cf. issue #14521)
http://hg.python.org/cpython/rev/31a7ff299698

--

___
Python tracker 

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



[issue15544] math.isnan fails with some Decimal NaNs

2012-08-24 Thread Mark Dickinson

Mark Dickinson added the comment:

Fixed.  (I managed to mess up the commit to 3.2 and break all the buildbots 
:-(.  I think it's okay now.)

Thanks Steven for the report and patch!  (And thanks Stefan for reviewing.)

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

___
Python tracker 

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



[issue15710] logging module crashes in Python 2.7.3 for handler.setLevel(long)

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> type(-2**31) is long for 2.5 and 2.6 as well as 2.7. The check was
> added as a response to #6314, to catch incorrect values being passed
> as levels.

Well, what is an incorrect value and why would you bother refusing long?
And how about small long values (e.g. long(0))?

--

___
Python tracker 

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



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Vinay Sajip

Vinay Sajip added the comment:

Reverted.

--
assignee:  -> vinay.sajip
components: +Library (Lib) -None
type: behavior -> enhancement
versions:  -Python 3.3

___
Python tracker 

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



[issue15544] math.isnan fails with some Decimal NaNs

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5dd5f824428c by Mark Dickinson in branch '2.7':
Issue #15544: Fix Decimal.__float__ to work with payload-carrying NaNs.
http://hg.python.org/cpython/rev/5dd5f824428c

--

___
Python tracker 

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



[issue13370] test_ctypes fails when building python with clang

2012-08-24 Thread Ned Deily

Ned Deily added the comment:

Sorry, I meant this part of the patch:

diff --git a/Modules/_ctypes/libffi_osx/x86/x86-ffi_darwin.c 
b/Modules/_ctypes/libffi_osx/
--- a/Modules/_ctypes/libffi_osx/x86/x86-ffi_darwin.c
+++ b/Modules/_ctypes/libffi_osx/x86/x86-ffi_darwin.c
@@ -35,6 +35,8 @@
 /* ffi_prep_args is called by the assembly routine once stack space
  has been allocated for the function's arguments */
 
+void ffi_prep_args(char *stack, extended_cif *ecif);
+
 void ffi_prep_args(char *stack, extended_cif *ecif)
 {
 register unsigned int i;

--

___
Python tracker 

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



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Le vendredi 24 août 2012 à 18:47 +, Éric Araujo a écrit :
> Éric Araujo added the comment:
> 
> > Well, changing it to do that means changing functionality, which is
> disallowed at this point in the release process.
> I think people used to “virtualenv .” can see this as a regression
> between virtualenv and pyvenv, but if the PEP did not list that use
> case then it’s too late.  I’d suggest we even back out the “pyvenv
> --clear .” commit, which did not address the needs of the
> “virtualenv .” users.

Agreed with Eric. The feature could be added correctly in 3.4.

--

___
Python tracker 

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



[issue15710] logging module crashes in Python 2.7.3 for handler.setLevel(long)

2012-08-24 Thread Vinay Sajip

Vinay Sajip added the comment:

type(-2**31) is long for 2.5 and 2.6 as well as 2.7. The check was added as a 
response to #6314, to catch incorrect values being passed as levels.

It could be argued that -2**31 is not a sensible log level. While int and long 
are supposed to be interchangeable for most purposes, isn't this a reasonable 
case where you shouldn't need to support long? If you feel not, what scenarios 
do you believe lie outside the "most purposes"?

--

___
Python tracker 

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



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Éric Araujo

Éric Araujo added the comment:

> Well, changing it to do that means changing functionality, which is 
> disallowed at this point in the release process.
I think people used to “virtualenv .” can see this as a regression between 
virtualenv and pyvenv, but if the PEP did not list that use case then it’s too 
late.  I’d suggest we even back out the “pyvenv --clear .” commit, which did 
not address the needs of the “virtualenv .” users.

--

___
Python tracker 

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



[issue15544] math.isnan fails with some Decimal NaNs

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a931e44ffbe1 by Mark Dickinson in branch '3.2':
Issue #15544: Fix Decimal.__float__ to work with payload-carrying NaNs.
http://hg.python.org/cpython/rev/a931e44ffbe1

--

___
Python tracker 

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



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Stefan Holek

Stefan Holek added the comment:

Sorry for being late. I'll make a feature request for 3.4 then.

--

___
Python tracker 

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



[issue13072] Getting a buffer from a Unicode array uses invalid format

2012-08-24 Thread Stefan Krah

Stefan Krah added the comment:

Good, I think this can be closed then.

--
resolution:  -> fixed
stage: needs patch -> committed/rejected
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Vinay Sajip

Vinay Sajip added the comment:

> I used to create venvs in the project top-level directory (typically a 
> Mercurial clone root), using “virtualenv .”

I've used option 2 for this, using e.g. "virtualenv env" in the project 
directory.

--

___
Python tracker 

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



[issue13072] Getting a buffer from a Unicode array uses invalid format

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9c7515e29219 by Stefan Krah in branch 'default':
Issue #13072: The array module's 'u' format code is now deprecated and
http://hg.python.org/cpython/rev/9c7515e29219

--

___
Python tracker 

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



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Vinay Sajip

Vinay Sajip added the comment:

> This is how I use virtualenv at the moment and I'd rather not lose that 
> ability. Thanks.

Well, changing it to do that means changing functionality, which is disallowed 
at this point in the release process.

--

___
Python tracker 

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



[issue11225] getcwd fix for NetBSD to handle ERANGE errno

2012-08-24 Thread Charles-François Natali

Changes by Charles-François Natali :


--
resolution:  -> duplicate
status: open -> closed
superseder:  -> test_getcwd_long_pathnames (in test_posix) kills NetBSD

___
Python tracker 

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



[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread Martin v . Löwis

Martin v. Löwis added the comment:

As this is an error reported by Windows, it *very* unlikely is an issue with 
Python. Instead, it's a reaction that Windows produced to some sequence of 
events.

My guess is that another process had the address in use, apparently, Windows 
then reports WSAEACCESS in certain cases instead of the expected WSAEADDRINUSE.

What specific socket operation was the one that failed?

--
nosy: +loewis

___
Python tracker 

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



[issue14674] Link to & explain deviations from RFC 4627 in json module docs

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ok, thank you Chris!

--
resolution:  -> fixed
stage: commit review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue15544] math.isnan fails with some Decimal NaNs

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 49014c59b31f by Mark Dickinson in branch 'default':
Issue #15544: Fix Decimal.__float__ to work with payload-carrying NaNs.
http://hg.python.org/cpython/rev/49014c59b31f

--
nosy: +python-dev

___
Python tracker 

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



[issue14674] Link to & explain deviations from RFC 4627 in json module docs

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 132886ef135d by Antoine Pitrou in branch '3.2':
Issue #14674: Add a discussion of the json module's standard compliance.
http://hg.python.org/cpython/rev/132886ef135d

New changeset 16c0e26fc9cd by Antoine Pitrou in branch 'default':
Issue #14674: Add a discussion of the json module's standard compliance.
http://hg.python.org/cpython/rev/16c0e26fc9cd

New changeset d413b36dbee5 by Antoine Pitrou in branch '2.7':
Issue #14674: Add a discussion of the json module's standard compliance.
http://hg.python.org/cpython/rev/d413b36dbee5

--
nosy: +python-dev

___
Python tracker 

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



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Stefan Holek

Stefan Holek added the comment:

Hm. What I am actually after is to "bless" an existing directory – source files 
and all – with a virtualenv (or pyvenv). I am not interested in the command 
deleting anything from anywhere, why thank you.

Workflow:

$ git clone g...@github.com:stefanholek/foo
$ cd foo
$ virtualenv .
$ ./bin/python setup.py develop
$ ./bin/python setup.py -q test

This is how I use virtualenv at the moment and I'd rather not lose that 
ability. Thanks.

--

___
Python tracker 

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



[issue2051] PYO file permission problem

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0c661c5632e0 by Brett Cannon in branch 'default':
Issue #2051: Tweak last commit for this issue to pass in mode instead
http://hg.python.org/cpython/rev/0c661c5632e0

--

___
Python tracker 

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



[issue15779] socket error [Errno 10013] when creating SMTP object

2012-08-24 Thread James Hutchison

New submission from James Hutchison:

Windows 7 64-bit, Python 3.2.3

This is a very odd issue and I haven't figured out what caused it. I have a 
python script that runs continuously. When it receives a request to do a task, 
it creates a new thread (not a new process), does the task, then sends out an 
e-mail to indicate it was done. It doesn't do this a lot (maybe 10 - 30 times a 
day). This is all the script does.

Well today, it randomly broke. It was working fine, then suddenly I was getting 
the following error when it would create an SMTP object:

socket.error: [Errno 10013] An attempt was made to access a socket in a way 
forbidden by its access permissions

What I found was, even after trying a different script that did nothing but 
create a simple SMTP connection to localhost, running with admin privileges, 
and even after rebooting the machine, I was getting this error. I checked my 
firewall and didn't see any changes (I share a group policy so I do not have 
full control). I also tried the script on a different machine and found no 
issue. The issue also persisted between IDLE and simply running python.exe

When I tried to debug the issue, I discovered the following piece of code made 
the issue go away:

s = socket.socket()
s.bind(('',50007))
s.listen(1);
s.close();

And it hasn't come back since. I've tried to reproduce the circumstances that 
my script was running by creating SMTP instances in a loop but haven't been 
able to recreate the error. Checking my log, there isn't anything abnormal that 
occurred just before this issue (like attempting to do the task several times 
at once or something).

--
components: Library (Lib)
messages: 169055
nosy: Jimbofbx
priority: normal
severity: normal
status: open
title: socket error [Errno 10013] when creating SMTP object
type: behavior
versions: Python 3.2

___
Python tracker 

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



[issue2051] PYO file permission problem

2012-08-24 Thread Brett Cannon

Brett Cannon added the comment:

I agree with Eric: set_data() is meant to be generic so as to allow writing 
arbitrary data, not just bytecode files. So while accepting a mode argument 
makes sense and I'm fine with in terms of possible API change (in the future), 
having a source_path argument I'm not comfortable with. So I'm going to just 
take Eric's idea and commit the change. I'm also making the argument _mode just 
to make sure no one relies on it until we can discuss API changes in the 
context of Python 3.4 sine we will need to clean up the loader APIs to have 
abstract source/bytecode stuff that can play nicely with file-based APIs to 
allow for reading generic file assets once we have all of these little bugs 
worked out.

And as for why set_data() is not part of FileLoader, that's because it isn't 
necessary to load files. =) It's in SourceFileLoader purely to facilitate 
writing bytecode files, but set_data() is not used at all in terms of the 
actual loading of source code (or bytecode files for that matter).

--

___
Python tracker 

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



[issue14674] Link to & explain deviations from RFC 4627 in json module docs

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Chris, I'm gonna take a look if nobody beats me to it.

--
nosy: +pitrou

___
Python tracker 

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



[issue9374] urlparse should parse query and fragment for arbitrary schemes

2012-08-24 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Oops. I had not seen Eric and Mattiahs comment to this issue, which
pointed out to the problem. Sorry for not acting on this.

Thanks Georg for adding those module attributes back.

On Fri, Aug 24, 2012 at 9:17 AM, Roundup Robot  wrote:
>
> Roundup Robot added the comment:
>
> New changeset a0b3cb52816e by Georg Brandl in branch '3.2':
> Closes #9374: add back now-unused module attributes; removing them is a 
> backward compatibility issue, since they have a public-seeming name.
> http://hg.python.org/cpython/rev/a0b3cb52816e
>
> New changeset c93fbc2caba5 by Georg Brandl in branch 'default':
> Closes #9374: merge with 3.2
> http://hg.python.org/cpython/rev/c93fbc2caba5
>
> New changeset a43481210964 by Georg Brandl in branch '2.7':
> Closes #9374: add back now-unused module attributes; removing them is a 
> backward compatibility issue, since they have a public-seeming name.
> http://hg.python.org/cpython/rev/a43481210964
>
> --
> resolution: remind -> fixed
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Brett Cannon

Changes by Brett Cannon :


--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 91909962d7f5 by Brett Cannon in branch 'default':
Issue #15778: Coerce ImportError.args to a string when it isn't
http://hg.python.org/cpython/rev/91909962d7f5

--
nosy: +python-dev

___
Python tracker 

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



[issue2051] PYO file permission problem

2012-08-24 Thread Eric Snow

Eric Snow added the comment:

My patch was very similar.  _cache_bytecode() is a good addition.  Good point 
about the cache, too.

I'm not convinced that source_path is the right thing to add to the API (even 
just for SourceFileLoader).  I would have thought mode would have been more 
appropriate:

  def set_data(self, path, data, *, mode=0o666):

Then the "mode = _os.stat(source_path).st_mode" bit would get moved to 
_cache_bytecode().

My reasoning is that set_data() is useful to write any data relative to the 
Loader.  The concrete use case in the stdlib is for writing the .pyc files.  
Otherwise I'm not certain why the idea of "source_path" should be associated 
with set_data().  On the other hand, the idea of "mode" likewise may not be 
univeral enough to enshrine in the API, but I'd think it's more so than 
source_path.

I was going to ask about backward compatability, but then I realized that 
SourceFileLoader is new in 3.3 (SourceLoader is new in 3.2).  I'm also 
wondering why set_data() is not a part of the FileLoader API, but that's a 
question for another time (and version).  :)

--

___
Python tracker 

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



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee:  -> brett.cannon

___
Python tracker 

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



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Éric Araujo

Éric Araujo added the comment:

> Two common patterns are:
>
> 1. Use a single place for all venvs (virtualenvwrapper does this)
> 2. Use a venv in a subdirectory of a project directory

I’m a recent virtualenv user, but before I became a virtualenvwrapper fan I 
used to create venvs in the project top-level directory (typically a Mercurial 
clone root), using “virtualenv .”.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy: +brian.curtin

___
Python tracker 

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



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Dave Malcolm

Dave Malcolm added the comment:

(patch added)

--
stage:  -> patch review

___
Python tracker 

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



[issue15758] FileIO.readall() has worst case O(n^2) complexity

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> For this benchmark the call overhead does not seem to be noticeable,
> and using larger or adaptive read buffers does not seem to help
> either.  (I have tried both on Linux.)

Ok, thank you.

> > By the way, not every non-Windows OS is Linux, so the patch is wrong.
> 
> Wrong in the sense of not necessarily optimal for unknown platforms?
> Well, the patch retains the old (intended) behaviour on other
> platforms, so I would call that conservative rather than wrong.

Hmm, you are right, there is no regression indeed.
I guess I don't like very much the idea of switching code paths based on
the platform for pure optimization reasons, but in this case it seems
useful (and simple enough).

> Are you suggesting switching behaviour depending on whether some macro
> is defined?

No, that would definitely be overkill.

--

___
Python tracker 

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



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Dave Malcolm

Changes by Dave Malcolm :


--
keywords: +patch
Added file: http://bugs.python.org/file26988/fix-str-of-bogus-ImportError.patch

___
Python tracker 

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



[issue12623] "universal newlines" subprocess support broken with select- and poll-based communicate()

2012-08-24 Thread Andrew Svetlov

Andrew Svetlov added the comment:

I like to leave fixes to 3.4.
Any change can produce side-effects, which can be nightmare for upcoming 
release candidate.
Sure, Georg will share my opinion.
Though absence '\n' -> '\r\n' for input if OS is Windows and 
universal_newlines=True is not good.

--

___
Python tracker 

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



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Dave Malcolm

Dave Malcolm added the comment:

Sorry, it's 6825fd9b00ed

--

___
Python tracker 

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



[issue15758] FileIO.readall() has worst case O(n^2) complexity

2012-08-24 Thread Richard Oudkerk

Richard Oudkerk added the comment:

> What about the method call overhead in RawIO.readall(), and the
> different progression of buffer sizes? (the realloc scheme uses larger
> and larger read() sizes, while RawIO.readall() uses a constant read()
> size).

For this benchmark the call overhead does not seem to be noticeable, and using 
larger or adaptive read buffers does not seem to help either.  (I have tried 
both on Linux.)

> By the way, not every non-Windows OS is Linux, so the patch is wrong.

Wrong in the sense of not necessarily optimal for unknown platforms?  Well, the 
patch retains the old (intended) behaviour on other platforms, so I would call 
that conservative rather than wrong.  Are you suggesting switching behaviour 
depending on whether some macro is defined?


64-bit Linux with current patch (and using new benchmark):
amount = 1 MB; time taken = 0.003 secs; rate = 317.22 MB/s
amount = 2 MB; time taken = 0.007 secs; rate = 283.74 MB/s
amount = 4 MB; time taken = 0.011 secs; rate = 359.58 MB/s
amount = 8 MB; time taken = 0.020 secs; rate = 395.58 MB/s
amount = 16 MB; time taken = 0.030 secs; rate = 528.18 MB/s
amount = 32 MB; time taken = 0.051 secs; rate = 627.72 MB/s
amount = 64 MB; time taken = 0.088 secs; rate = 726.36 MB/s
amount = 128 MB; time taken = 0.133 secs; rate = 960.23 MB/s
amount = 256 MB; time taken = 0.258 secs; rate = 992.32 MB/s
amount = 512 MB; time taken = 0.482 secs; rate = 1062.30 MB/s

On 64-bit Linux with previous patch:
amount = 1 MB; time taken = 0.006 secs; rate = 158.07 MB/s
amount = 2 MB; time taken = 0.011 secs; rate = 177.23 MB/s
amount = 4 MB; time taken = 0.024 secs; rate = 169.32 MB/s
amount = 8 MB; time taken = 0.047 secs; rate = 170.39 MB/s
amount = 16 MB; time taken = 0.098 secs; rate = 163.65 MB/s
amount = 32 MB; time taken = 0.220 secs; rate = 145.19 MB/s
amount = 64 MB; time taken = 0.253 secs; rate = 253.32 MB/s
amount = 128 MB; time taken = 0.724 secs; rate = 176.80 MB/s
amount = 256 MB; time taken = 0.874 secs; rate = 293.02 MB/s
amount = 512 MB; time taken = 2.292 secs; rate = 223.38 MB/s

--

___
Python tracker 

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



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> This appears to be due to commit 76272.

Could you give the changeset id? Revision numbers are not portable from one 
repository clone to another.

--
nosy: +pitrou

___
Python tracker 

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



[issue15778] str(ImportError(b'foo')) fails

2012-08-24 Thread Dave Malcolm

New submission from Dave Malcolm:

In Python 3.2 and earlier:
>>> str(ImportError(b'foo'))
"b'foo'"

In Python 3.3:
>>> str(ImportError(b'foo'))
Traceback (most recent call last):
  File "", line 1, in 
TypeError: __str__ returned non-string (type bytes)

This appears to be due to commit 76272.

I'm attaching a patch which fixes it, though perhaps ImportError should 
type-check the arguments

Motivation:
This leads to a failure of the test suite for "docutils" when run under Python 
3.3 betas, specifically:

==
ERROR: test_unicode (test_error_reporting.ErrorStringTests)
--
Traceback (most recent call last):
File 
"/home/david/coding/python3.3/docutils/trunk/docutils/test3/test_error_reporting.py",
 line 154, in test_unicode
str(ErrorString(ImportError(self.bs
File 
"/home/david/coding/python3.3/docutils/trunk/docutils/build/lib/docutils/utils/error_reporting.py",
 line 124, in __str__
super(ErrorString, self).__str__())
File 
"/home/david/coding/python3.3/docutils/trunk/docutils/build/lib/docutils/utils/error_reporting.py",
 line 74, in __str__
return str(self.data)
TypeError: __str__ returned non-string (type bytes)

See 
http://docutils.svn.sourceforge.net/viewvc/docutils/trunk/docutils/test/test_error_reporting.py?revision=7464&view=markup
 for the test code.  Arguably docutils could just pick a different exception 
subclass.

--
messages: 169042
nosy: brett.cannon, dmalcolm
priority: normal
severity: normal
status: open
title: str(ImportError(b'foo')) fails
type: behavior
versions: Python 3.3, Python 3.4

___
Python tracker 

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



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Good point.
I will prepare the patch to fix this.

--

___
Python tracker 

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



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Georg Brandl

Georg Brandl added the comment:

Another *perfect* example how even the most innocuous-seeming patch can be 
wrong.

--

___
Python tracker 

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



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Georg Brandl

Changes by Georg Brandl :


--
priority: normal -> release blocker

___
Python tracker 

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



[issue9374] urlparse should parse query and fragment for arbitrary schemes

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a0b3cb52816e by Georg Brandl in branch '3.2':
Closes #9374: add back now-unused module attributes; removing them is a 
backward compatibility issue, since they have a public-seeming name.
http://hg.python.org/cpython/rev/a0b3cb52816e

New changeset c93fbc2caba5 by Georg Brandl in branch 'default':
Closes #9374: merge with 3.2
http://hg.python.org/cpython/rev/c93fbc2caba5

New changeset a43481210964 by Georg Brandl in branch '2.7':
Closes #9374: add back now-unused module attributes; removing them is a 
backward compatibility issue, since they have a public-seeming name.
http://hg.python.org/cpython/rev/a43481210964

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

___
Python tracker 

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



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> It is bug in shutil.rmtree, right?

Read the documentation:

 shutil.rmtree(path, ignore_errors=False, onerror=None)

Delete an entire directory tree; path must point to a directory (but
not a symbolic link to a directory)

--

___
Python tracker 

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



[issue9374] urlparse should parse query and fragment for arbitrary schemes

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Senthil, either the module globals should be re-added for compatibility, or the 
commits should be reverted, IMO.

--
nosy: +pitrou

___
Python tracker 

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



[issue15316] runpy swallows ImportError information with relative imports

2012-08-24 Thread Brett Cannon

Brett Cannon added the comment:

It will get fixed today.

--

___
Python tracker 

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



[issue15136] Decimal accepting Fraction

2012-08-24 Thread Stefan Krah

Stefan Krah added the comment:

I agree with Mark's arguments. Yesterday I tried to use as_decimal() in
a small program and it did not feel natural to me. I'll probably continue
to use Decimal(f.numerator) / f.denominator.

If this goes in, I'd prefer that as_decimal() always uses a localcontext().
As the patch stands, using as_decimal() pollutes the global context flags, 
which can be quite unexpected:

>>> from fractions import Fraction as F
>>> F(1, 3).as_decimal()
Decimal('0.')
>>>
>>> import decimal
>>> decimal.getcontext()
Context(prec=28, rounding=ROUND_HALF_EVEN, Emin=-99, Emax=99, 
capitals=1, clamp=0, flags=[Inexact, Rounded], traps=[InvalidOperation, 
DivisionByZero, Overflow])
>>>


If the function takes a context argument, it might be better to move it
into the decimal module as Decimal.from_fraction(context).


So I'm -1/7 on as_decimal(), but +1 for the __format__() method.

--

___
Python tracker 

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



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Andrew Svetlov

Andrew Svetlov added the comment:

It is bug in shutil.rmtree, right?

--

___
Python tracker 

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



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 0668fc196ce5 by Andrew Svetlov in branch 'default':
Issue #15776: Allow pyvenv to work in existing directory with --clean.
http://hg.python.org/cpython/rev/0668fc196ce5

--
nosy: +python-dev

___
Python tracker 

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



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

os.path.isdir("foo") will return True if "foo" is a symlink to a directory, and 
then shutil.rmtree("foo") will fail:

>>> os.path.isdir("foo")
True
>>> os.path.islink("foo")
True
>>> shutil.rmtree("foo")
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/antoine/opt/lib/python3.3/shutil.py", line 456, in rmtree
"Not a directory: '{}'".format(path))
NotADirectoryError: [Errno 20] Not a directory: 'foo'

--
nosy: +pitrou

___
Python tracker 

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



[issue15316] runpy swallows ImportError information with relative imports

2012-08-24 Thread Georg Brandl

Georg Brandl added the comment:

I don't agree that this is a blocker; would be nice to fix it, of course.

--
priority: release blocker -> critical

___
Python tracker 

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



[issue15776] Allow pyvenv to work in existing directory

2012-08-24 Thread Georg Brandl

Georg Brandl added the comment:

LGTM, please apply.

--

___
Python tracker 

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



[issue15249] email.generator.BytesGenerator doesn't mangle "From " lines when non-ASCII bytes are present

2012-08-24 Thread R. David Murray

R. David Murray added the comment:

Thanks, LittleQ.  And Petri.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue15249] email.generator.BytesGenerator doesn't mangle "From " lines when non-ASCII bytes are present

2012-08-24 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 119c645f310e by R David Murray in branch '3.2':
#15249: Mangle From lines correctly when body contains invalid bytes.
http://hg.python.org/cpython/rev/119c645f310e

New changeset b6ee4e8c7a77 by R David Murray in branch 'default':
Merge #15249: Mangle From lines correctly when body contains invalid bytes.
http://hg.python.org/cpython/rev/b6ee4e8c7a77

--
nosy: +python-dev

___
Python tracker 

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



[issue15765] test_getcwd_long_pathnames (in test_posix) kills NetBSD

2012-08-24 Thread Trent Nelson

Trent Nelson added the comment:

Looks like this is a duplicate of issue 9185.  The fix used for that just needs 
to be extended to cover NetBSD as well.  See proposed patch.  I'll commit this 
to 2.7 in a day or two if there are no objections.

Antoine: added you as nosy as you were involved with the original patch.

--
keywords: +patch
resolution:  -> duplicate
Added file: http://bugs.python.org/file26987/getcwd_netbsd.patch

___
Python tracker 

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



[issue13072] Getting a buffer from a Unicode array uses invalid format

2012-08-24 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Stefan, your patch array_deprecate_u.diff is fine. If you get to it, please 
also rephrase the clause "Python's unicode type"; not sure what the convention 
is to refer to Py_UNICODE now (perhaps "historical unicode type").

--

___
Python tracker 

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



[issue15037] curses.unget_wch and test_curses fail when linked with ncurses 5.7 and earlier

2012-08-24 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Why is this blocking the release? It looks like a problem that can be solved in 
a bug fix release, or else by requiring that Python 3.3 users use a recent 
ncurses release.

--
nosy: +loewis
priority: release blocker -> normal

___
Python tracker 

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



[issue15442] Expand the list of default dirs filecmp.dircmp ignores

2012-08-24 Thread R. David Murray

R. David Murray added the comment:

moijes12, thanks for the patch.  Since this is a new feature we'll need to wait 
until the 3.3 RC1 repo is branched before applying it.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue15573] Support unknown formats in memoryview comparisons

2012-08-24 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Is this still blocking the release? If so, it should be resolved within the 
next twelve hours, or else it may block the release until September.

--

___
Python tracker 

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



[issue15758] FileIO.readall() has worst case O(n^2) complexity

2012-08-24 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> After playing with the patch on Linux it seems that Linux much prefers
> the realloc() scheme to the list-of-chunks scheme.

What about the method call overhead in RawIO.readall(), and the
different progression of buffer sizes? (the realloc scheme uses larger
and larger read() sizes, while RawIO.readall() uses a constant read()
size).

By the way, not every non-Windows OS is Linux, so the patch is wrong.

--

___
Python tracker 

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



[issue15758] FileIO.readall() has worst case O(n^2) complexity

2012-08-24 Thread Richard Oudkerk

Changes by Richard Oudkerk :


Removed file: http://bugs.python.org/file26970/readall-combined.patch

___
Python tracker 

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



[issue15758] FileIO.readall() has worst case O(n^2) complexity

2012-08-24 Thread Richard Oudkerk

Changes by Richard Oudkerk :


Removed file: http://bugs.python.org/file26952/push-thru-cat.py

___
Python tracker 

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



[issue15758] FileIO.readall() has worst case O(n^2) complexity

2012-08-24 Thread Richard Oudkerk

Richard Oudkerk added the comment:

Attached is an alternative benchmark program which does not use subprocess.

--
Added file: http://bugs.python.org/file26986/readall-benchmark.py

___
Python tracker 

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



[issue15758] FileIO.readall() has worst case O(n^2) complexity

2012-08-24 Thread Richard Oudkerk

Richard Oudkerk added the comment:

After playing with the patch on Linux it seems that Linux much prefers the 
realloc() scheme to the list-of-chunks scheme.

This new patch only does list-of-chunks on Windows.

--
Added file: http://bugs.python.org/file26985/readall-combined.patch

___
Python tracker 

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



  1   2   >