[issue15348] IDLE - shell becomes unresponsive if debugger windows is closed while active.

2012-10-08 Thread Roger Serwy

Roger Serwy added the comment:

Attached is a patch against 3.4 to solve the issue.

The debugger was originally written for running IDLE without a subprocess. As a 
result, calls to idb.run() from Debugger.py would block until completed.  If 
.interacting == 1 then clicking "X" would not close the debugger window. Once 
the debugger finishes, the .interacting flag would reset to 0, which then 
allows for the Debugger.close() method to destroy the debugger window. Clicking 
"Quit" is one way to have the debugger finish.

When running *with* a subprocess, the idb.run() returns immediately, since it 
is using the IdbProxy object instead. As a consequence, the .interacting flag 
is also reset to 0 immediately despite the debugger still being active. Thus, 
clicking "X" would allow the debugger to close without properly stopping the 
debugger via clicking "Quit".

A useful side-effect of the interactive debugger being active is that the 
PyShell.executing flag is set to true. When the debugger stops, the call to 
PyShell.endexecuting() from poll_subprocess() resets the .executing flag. The 
patch checks if PyShell's executing is true in order to prevent the Debugger 
Window from being closed by clicking "X". This makes the behavior is consistent 
with running the IDLE debugger without a subprocess.


When running IDLE without a subprocess is fully removed (see issue16123), then 
maintaining the Debugger code will become simpler. Until then, testing against 
both code paths is necessary.

--
keywords: +patch
nosy: +asvetlov, terry.reedy
Added file: http://bugs.python.org/file27482/issue15348.patch

___
Python tracker 

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



[issue15833] most failures to write byte-compiled file no longer suppressed

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

Charles-François Natali added the comment:

> Yes .
> Charles, lest assume that all other issues with build system, are resolved 
> and source tree is ready for use. So in this situation I could run python , I 
> could build all and I could run tests with an additional patch TEMPDIR is 
> relative to build tree (patch 0014-* from recent archive uploaded to issue 
> #3754) . Note without you patch.
>
> In my build environment test_imp fail on test_source.
> So what is result with you patch on this test ?

Sorry, I'm not a native English speaker, and I don't understand what
you're talking about.
The issue at hand is that bytecode creation only catches EPERM and
EEXIST, but other errors can be raised on a read-only filesystem
(EROFS, EIO in some strange cases).

--

___
Python tracker 

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



[issue11245] Implementation of IMAP IDLE in imaplib?

2012-10-08 Thread Gereon Kremer

Gereon Kremer added the comment:

I got the confirmation for my agreement.

I'm not quite sure about the tests, as I'm not really familiar with the way 
this is done in cpython. The test_imaplib.py seems to cover all ways to connect 
to some server, but none of the actual imap commands. The patch only implements 
another commands (whose behaviour is highly/only dependent of other events on 
the server).

Hence, I don't see a way to create a meaningfull test case other than just 
calling the command...

--

___
Python tracker 

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



[issue16115] test that executable arg to Popen() takes precedence over args

2012-10-08 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Proposed patch attached.

I verified that the tests included in the patch pass on 2.7, 3.2, 3.3, and 
default (replacing FileNotFoundError with OSError as necessary).  I also 
verified that the tests pass on Windows for default.

The patch also includes improvements to the parts of Popen()'s documentation 
that relate to the added tests.  The improvements simplify the documentation by 
more clearly separating the argument-specific documentation from the 
default/general behavior.  Previously, certain general information was under 
various argument-specific paragraphs which made the documentation less clear.

--
versions: +Python 2.7, Python 3.2
Added file: http://bugs.python.org/file27483/issue-16115-1.patch

___
Python tracker 

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



[issue14900] cProfile does not take its result headers as sort arguments

2012-10-08 Thread Arne Babenhauserheide

Changes by Arne Babenhauserheide :


Added file: http://bugs.python.org/file27484/profile-docs-3.2.diff

___
Python tracker 

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



[issue14900] cProfile does not take its result headers as sort arguments

2012-10-08 Thread Arne Babenhauserheide

Changes by Arne Babenhauserheide :


Added file: http://bugs.python.org/file27485/profile-docs-2.7.diff

___
Python tracker 

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



[issue16161] broken link to Visual Studio 2008 in devguide

2012-10-08 Thread Chris Jerdonek

New submission from Chris Jerdonek:

The link to Visual Studio 2008 in the devguide doesn't seem to work:

http://docs.python.org/devguide/setup.html#windows
https://www.microsoft.com/visualstudio/en-us/products/2008-editions/express

This seems to be a better link:

http://www.microsoft.com/en-us/download/details.aspx?id=14597

--
components: Devguide
keywords: easy
messages: 172367
nosy: chris.jerdonek, ezio.melotti
priority: normal
severity: normal
stage: needs patch
status: open
title: broken link to Visual Studio 2008 in devguide
type: behavior

___
Python tracker 

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



[issue12947] doctest directive examples in library/doctest.html lack the flags

2012-10-08 Thread Nick Coghlan

Nick Coghlan added the comment:

Ah, I see the other examples Chris is talking about now. Yes, the workaround 
should be applied in those cases as well.

--

___
Python tracker 

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



[issue16161] broken link to Visual Studio 2008 in devguide

2012-10-08 Thread Chris Jerdonek

Chris Jerdonek added the comment:

It might also be good to say that "vcsetup.exe" is the file you're supposed to 
download (as opposed to, say, "vcssetup.exe").  Strangely, the files aren't 
labeled, and they're listed in a different order from the text below.

--

___
Python tracker 

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



[issue16115] test that executable arg to Popen() takes precedence over args

2012-10-08 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I also checked the tests in the patch on Windows for 2.7.

--

___
Python tracker 

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



[issue14900] cProfile does not take its result headers as sort arguments

2012-10-08 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Looks like you missed *sort* parameter for ".. function:: run(command, 
filename=None, sort=-1)"
Also it will be nice to insert link to Stats.sort_stats in doc text for run 
functions.

--

___
Python tracker 

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



[issue15278] UnicodeDecodeError when readline in codecs.py

2012-10-08 Thread Marcus Gröber

Marcus Gröber added the comment:

I came across this today as well. A short way of summarizing this error seems 
to be:

Reading a file using readline (or "for line in file") fails, if the following 
two conditions are true:

•   A codec (e.g. UTF-8) for a multi-byte encoding is used, and
•   The first line of the file is at least 73 bytes long, and contains a 
multi-byte-sequence that starts before offset 72, and ends after offset 72

At least for UTF-8 input files, it may be possible to work around this by 
opening the input file without a codec, and then applying decode("utf-8") to 
each line.

--
nosy: +Marcus.Gröber

___
Python tracker 

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



[issue16162] Py_FileSystemDefaultEncoding should be updated on locale.setlocale()

2012-10-08 Thread Michael Vogt

New submission from Michael Vogt:

The Py_FileSystemDefaultEncoding is very static right now and only set on 
interpreter statup AFAICT. There appears to be no way to switch that later.

I think that Py_FileSystemDefaultEncoding should get updated when 
locale.setlocale() is run automatically and attach a proof-of-concept patch for 
this. 

The reason is that if a python application is started without a environment 
(dbus activation will do that for example) its impossible to work with utf8 
encoded filenames. The only workaround is to setup a environment and then 
os.execv() which seems not ideal.

--
components: Unicode
files: alllow-chaning-of-Py_FileSystemDefaultEncoding.diff
keywords: patch
messages: 172373
nosy: ezio.melotti, mvo
priority: normal
severity: normal
status: open
title: Py_FileSystemDefaultEncoding should be updated on locale.setlocale()
versions: Python 3.2
Added file: 
http://bugs.python.org/file27486/alllow-chaning-of-Py_FileSystemDefaultEncoding.diff

___
Python tracker 

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



[issue16163] Wrong name in Lib/pkgutil.py:iter_importers

2012-10-08 Thread Berker Peksag

New submission from Berker Peksag:

Name "pkg" is not defined.

Related changeset: http://hg.python.org/cpython/rev/3987667bf98f#l2.89

--
components: Library (Lib)
files: pkgutil-name.diff
keywords: patch
messages: 172374
nosy: berker.peksag
priority: normal
severity: normal
status: open
title: Wrong name in Lib/pkgutil.py:iter_importers
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file27487/pkgutil-name.diff

___
Python tracker 

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



[issue16164] there is no easy way to force unittest.main to use stdout rather than stderr

2012-10-08 Thread Alexander Belchenko

New submission from Alexander Belchenko:

Why by default unittest.main (which uses unittest.TextTestRunner) prints 
everything to stderr. What the reason behind this behavior?
It makes very inconvenient to run big test suite with less, i.e.

python test.py | less 

or

python test.py > test.log

does not show me failed tests. They all go to stderr. Why?

Another thing: there is no easy way to override this. I have to subclass either 
TestProgram or TextTestRunner and force sys.stdout rather than sys.stderr. E.g.

class TestProgram(unittest.TestProgram):

def runTests(self):
if self.testRunner is None:
self.testRunner = unittest.TextTestRunner(stream=sys.stdout, 
verbosity=self.verbosity)
result = self.testRunner.run(self.test)
sys.exit(not result.wasSuccessful())

if __name__ == '__main__':
TestProgram()

Although it works for me I feel there is something wrong. Am I the only person 
who needs test output on stdout?

--
components: Library (Lib)
messages: 172375
nosy: bialix
priority: normal
severity: normal
status: open
title: there is no easy way to force unittest.main to use stdout rather than 
stderr
type: behavior
versions: Python 2.6

___
Python tracker 

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



[issue16165] sched.scheduler.run() blocks scheduler

2012-10-08 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

sched.scheduler.run() blocks scheduler and prevents the addition of new events 
until all events added before start will not be processed. Canceling does not 
work too.

Here is test script which reproduces the behavior differences.

Output in Python 3.2:

Adding
adding 0
added 0
adding 1
added 1
adding 2
added 2
event 0
event 1
start event
event 2
Canceling

Output in Python 3.3:

Adding
adding 0
start event
added 0
adding 1
added 1
adding 2
added 2
Canceling
event 0
event 1
event 2
Traceback (most recent call last):
  File "schedtest.py", line 20, in 
s.cancel(e)
  File "/home/serhiy/py/cpython/Lib/sched.py", line 93, in cancel
self._queue.remove(event)
ValueError: list.remove(x): x not in list

--
components: Library (Lib)
files: schedtest.py
keywords: 3.3regression
messages: 172376
nosy: giampaolo.rodola, pitrou, serhiy.storchaka
priority: normal
severity: normal
status: open
title: sched.scheduler.run() blocks scheduler
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file27488/schedtest.py

___
Python tracker 

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



[issue13451] sched.py: speedup cancel() method

2012-10-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In principle this is the right approach. But the time of enter() is increased 
by 20%. Here is updated and slightly optimized patch that restores enter() 
performance (but a little slow down cancel()). Because enter() is executed for 
each event and cancel() is not, and enter's gain greater cancel's loss, I think 
it is a very profitable exchange.

--
nosy: +serhiy.storchaka
Added file: http://bugs.python.org/file27489/cancel_2.patch

___
Python tracker 

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



[issue16161] broken link to Visual Studio 2008 in devguide

2012-10-08 Thread Christian Heimes

Christian Heimes added the comment:

Meh, MS likes to invalidate or alter the meaning of an URL.

Have you verified that vcsetup.exe is the right thing? I *guess* that vcsetup 
stands for "Visual C++ setup" and vcssetup for "Visual C Sharp Setup" but I'm 
not sure about it.

--
assignee:  -> docs@python
nosy: +christian.heimes, docs@python
versions: +Python 2.7, Python 3.2

___
Python tracker 

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



[issue16165] sched.scheduler.run() blocks scheduler

2012-10-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch that releases lock for other threads.

--
keywords: +patch
Added file: http://bugs.python.org/file27490/sched_unblock.patch

___
Python tracker 

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



[issue16115] test that executable arg to Popen() takes precedence over args

2012-10-08 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Hmm, I dislike "Normally, *args* should be a sequence."
>From my perspective better to say something like:
*args* should be a sequence if *shell* is *False* or string of *shell* is 
*True* 
or something like this.
I would to directly recommend reader to follow that schema, see also 
http://bugs.python.org/issue7839

--

___
Python tracker 

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



[issue16166] Add PY_BYTE_ORDER macro to get endianess of platform

2012-10-08 Thread Christian Heimes

New submission from Christian Heimes:

I propose the addition of three new macros in pyport.h

#define PY_LITTLE_ENDIAN 1234
#define PY_BIG_ENDIAN 4321
#define PY_BYTE_ORDER 

that are either set by a configure test or implemented like brg_endian.h. 
pyconfig.h has WORDS_BIGENDIAN which just checks for __BIG_ENDIAN__. The 
sysmodule has its own C code that checks the first byte of a long to detect the 
endianess.

http://hg.python.org/cpython/file/dd5e98ddcd39/Modules/_sha3/keccak/brg_endian.h

I'd like to remove Keccak's brg_endian.h (#16113 SHA-3 module) for something 
more official and useful to other code. I had to re-add the file because the 
tests were failing on a big endian Solaris (Sparc) machine.

--
components: Build
messages: 172381
nosy: christian.heimes
priority: normal
severity: normal
stage: needs patch
status: open
title: Add PY_BYTE_ORDER macro to get endianess of platform
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue16166] Add PY_BYTE_ORDER macro to get endianess of platform

2012-10-08 Thread Christian Heimes

Changes by Christian Heimes :


--
dependencies: +Add SHA-3 (Keccak) support
nosy: +pitrou

___
Python tracker 

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



[issue14900] cProfile does not take its result headers as sort arguments

2012-10-08 Thread Arne Babenhauserheide

Changes by Arne Babenhauserheide :


Added file: http://bugs.python.org/file27491/sort-argument-2.7.diff

___
Python tracker 

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



[issue14900] cProfile does not take its result headers as sort arguments

2012-10-08 Thread Arne Babenhauserheide

Changes by Arne Babenhauserheide :


Added file: http://bugs.python.org/file27492/sort-argument-3.2.diff

___
Python tracker 

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



[issue14900] cProfile does not take its result headers as sort arguments

2012-10-08 Thread Arne Babenhauserheide

Arne Babenhauserheide added the comment:

Jepp, I missed that. I hope the added patches clear that up.

--

___
Python tracker 

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



[issue14900] cProfile does not take its result headers as sort arguments

2012-10-08 Thread Arne Babenhauserheide

Changes by Arne Babenhauserheide :


Removed file: http://bugs.python.org/file27492/sort-argument-3.2.diff

___
Python tracker 

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



[issue14900] cProfile does not take its result headers as sort arguments

2012-10-08 Thread Arne Babenhauserheide

Changes by Arne Babenhauserheide :


Added file: http://bugs.python.org/file27493/sort-argument-3.2.diff

___
Python tracker 

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



[issue14900] cProfile does not take its result headers as sort arguments

2012-10-08 Thread Arne Babenhauserheide

Changes by Arne Babenhauserheide :


Removed file: http://bugs.python.org/file27491/sort-argument-2.7.diff

___
Python tracker 

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



[issue14900] cProfile does not take its result headers as sort arguments

2012-10-08 Thread Arne Babenhauserheide

Changes by Arne Babenhauserheide :


Added file: http://bugs.python.org/file27494/sort-argument-2.7.diff

___
Python tracker 

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



[issue11245] Implementation of IMAP IDLE in imaplib?

2012-10-08 Thread R. David Murray

R. David Murray added the comment:

Yeah writing a good test case for this is a bit tricky, since we'll need some 
infrastructure (an Event?) so we can prove that the call has blocked without 
delaying the test for very long.

I'm not sure when I'll be able to get to this...I'm not going to check it in 
without a test, so I'll have to find enough time to be able to write the tests.

--

___
Python tracker 

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



[issue16162] Py_FileSystemDefaultEncoding should be updated on locale.setlocale()

2012-10-08 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +haypo, pitrou

___
Python tracker 

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



[issue16163] Wrong name in Lib/pkgutil.py:iter_importers

2012-10-08 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue16164] there is no easy way to force unittest.main to use stdout rather than stderr

2012-10-08 Thread R. David Murray

R. David Murray added the comment:

I think the reason is that this enables you to easily see if the tests generate 
any output to stdout.  This was important when unittest was introduced into 
python, because some of our tests at that time were still written to check the 
stdout output against "known good" output, and in the process of converting 
them we would make sure that stdout was empty after the unittest run.  Those 
tests have all been converted a fairly long time ago now.

It is an interesting question whether this decision could be revisited.  The 
problem is that there may well be other people depending on the current 
behavior, which many people may view as the correct behavior.  I myself am 
neutral on the question, though I have experienced the annoyance of having to 
run unittest twice when I forget that the output goes to stderr...the second 
time to do the equivalent of 'python test.py 2>&1 | less'.

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



[issue14900] cProfile does not take its result headers as sort arguments

2012-10-08 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Sorry, I cannot figure out what hg repo version should I use to apply 
sort-argument* patches.
Can you prepare 2 cumulative patches for 2.7 and 3.2 which can be applied to 
current repo state?
It's CPython team policy to send patches which can be applied to pure repo if 
no other rule explicitly specified.
Thanks.

--

___
Python tracker 

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



[issue16164] there is no easy way to force unittest.main to use stdout rather than stderr

2012-10-08 Thread R. David Murray

R. David Murray added the comment:

I'm pretty sure this should be closed as "won't fix" or "invalid", but I'll 
leave that to Michael, who is the current maintainer of unittest.

--
nosy: +michael.foord

___
Python tracker 

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



[issue16163] Wrong name in Lib/pkgutil.py:iter_importers

2012-10-08 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Thanks for the report and patch.  Can you also provide a test that fails using 
the current code (and that passes with the patch applied)?

--
nosy: +chris.jerdonek

___
Python tracker 

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



[issue16161] broken link to Visual Studio 2008 in devguide

2012-10-08 Thread Chris Jerdonek

Chris Jerdonek added the comment:

> Have you verified that vcsetup.exe is the right thing?  I *guess* that 
> vcsetup stands for "Visual C++ setup" and vcssetup for "Visual C Sharp Setup" 
> but I'm not sure about it.

Yes, after choosing wrong the first time (based partly on the ordering relative 
to the accompanying text).  And yes, your guess is correct.

Incidentally, it was also odd that the VS executable wasn't obvious to locate.  
After installing, only the "VS 2008 Remote Debugger" showed up in the Start 
menu.  The VS executable I found only in 
"Microsoft Visual Studio 9.0\Common7\IDE\VCExpress.exe" and not in the 
"Microsoft Visual Studio 9.0\Microsoft Visual C++ 2008 Express Edition..." 
folder.

--

___
Python tracker 

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



[issue16162] Py_FileSystemDefaultEncoding should be updated on locale.setlocale()

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

Martin v. Löwis added the comment:

It actually *is* possible to work with UTF-8-encoded file names even in an 
ASCII locale. It should work automatically, using the PEP 383 mechanism.

I'm -0 on allowing changes to the file system encoding. It may lead to 
mojibake, if some file names were read from the file system before the locale 
was changed, and then accessed later.

I don't understand why you think that it is, in some cases, impossible to pass 
environment variables. In case of dbus activiation, it is surely possible to 
pass environment variables somehow. The easiest solution should be to put

#!/bin/sh
s=
LANG=en_US.UTF-8 exec /usr/bin/python $0 "$@"
'''

into the beginning of the script.

--
nosy: +loewis

___
Python tracker 

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



[issue16162] Py_FileSystemDefaultEncoding should be updated on locale.setlocale()

2012-10-08 Thread STINNER Victor

STINNER Victor added the comment:

> I think that Py_FileSystemDefaultEncoding should get updated when 
> locale.setlocale() is run automatically

This is not a good idea. The two following expressions must be True on UNIX:
os.fsencode(os.fsdecode(name)) == name
os.fsdecode(os.fsencode(name)) == name

Said differently: if you change the filesystem encoding, you cannot
encode or decode (depending on the type, str or bytes) back the
filename.

For example, sys.path is a list of filenames filled in an early stage
of Python initialization. If you change the filesystem encoding after
this list is filled, you may fail to import modules.

See also this thread:
http://mail.python.org/pipermail/python-dev/2010-October/104509.html

--

If you want to change the locale encoding, please do it outside Python
(before running Python), and then don't change it again! Example on
Ubuntu:

$ LC_CTYPE=fr_FR.iso885915@euro python -c 'import sys;
print(sys.getfilesystemencoding())'
ISO-8859-15

--

___
Python tracker 

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



[issue15278] UnicodeDecodeError when readline in codecs.py

2012-10-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This error happens due to the fact that utf16* decoders do not properly partial 
decode truncated data. Exception raised if input data truncated on the second 
surrogate in the surrogate pair. For example 
codecs.utf_16_le_decode(b'\x00\xd8\x00') should return ('', 0), but raises 
UnicodeDecodeError.

--
components: +Unicode -Library (Lib)
nosy: +ezio.melotti, serhiy.storchaka
versions: +Python 3.3, Python 3.4 -Python 2.6, Python 3.1

___
Python tracker 

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



[issue15278] UnicodeDecodeError when readline in codecs.py

2012-10-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here are the patches.

--
keywords: +patch
Added file: http://bugs.python.org/file27495/utf16_partial_decode-3.3.patch
Added file: http://bugs.python.org/file27496/utf16_partial_decode-3.2.patch
Added file: http://bugs.python.org/file27497/utf16_partial_decode-2.7.patch

___
Python tracker 

___diff -r 0d41a1b4c4fe Lib/test/test_codecs.py
--- a/Lib/test/test_codecs.py   Mon Oct 08 07:46:11 2012 +0200
+++ b/Lib/test/test_codecs.py   Mon Oct 08 18:26:34 2012 +0300
@@ -330,7 +330,7 @@
 
 def test_partial(self):
 self.check_partial(
-"\x00\xff\u0100\u",
+"\x00\xff\u0100\u\U0001",
 [
 "", # first byte of BOM read
 "", # second byte of BOM read
@@ -352,6 +352,10 @@
 "\x00\xff\u0100",
 "\x00\xff\u0100",
 "\x00\xff\u0100\u",
+"\x00\xff\u0100\u",
+"\x00\xff\u0100\u",
+"\x00\xff\u0100\u",
+"\x00\xff\u0100\u\U0001",
 ]
 )
 
@@ -386,7 +390,7 @@
 
 def test_partial(self):
 self.check_partial(
-"\x00\xff\u0100\u",
+"\x00\xff\u0100\u\U0001",
 [
 "",
 "",
@@ -404,6 +408,10 @@
 "\x00\xff\u0100",
 "\x00\xff\u0100",
 "\x00\xff\u0100\u",
+"\x00\xff\u0100\u",
+"\x00\xff\u0100\u",
+"\x00\xff\u0100\u",
+"\x00\xff\u0100\u\U0001",
 ]
 )
 
@@ -426,7 +434,7 @@
 
 def test_partial(self):
 self.check_partial(
-"\x00\xff\u0100\u",
+"\x00\xff\u0100\u\U0001",
 [
 "",
 "",
@@ -444,6 +452,10 @@
 "\x00\xff\u0100",
 "\x00\xff\u0100",
 "\x00\xff\u0100\u",
+"\x00\xff\u0100\u",
+"\x00\xff\u0100\u",
+"\x00\xff\u0100\u",
+"\x00\xff\u0100\u\U0001",
 ]
 )
 
@@ -494,7 +506,7 @@
 
 def test_partial(self):
 self.check_partial(
-"\x00\xff\u0100\u",
+"\x00\xff\u0100\u\U0001",
 [
 "", # first byte of BOM read
 "", # second byte of BOM read => byteorder known
@@ -506,6 +518,10 @@
 "\x00\xff\u0100",
 "\x00\xff\u0100",
 "\x00\xff\u0100\u",
+"\x00\xff\u0100\u",
+"\x00\xff\u0100\u",
+"\x00\xff\u0100\u",
+"\x00\xff\u0100\u\U0001",
 ]
 )
 
@@ -543,7 +559,7 @@
 
 def test_partial(self):
 self.check_partial(
-"\x00\xff\u0100\u",
+"\x00\xff\u0100\u\U0001",
 [
 "",
 "\x00",
@@ -553,6 +569,10 @@
 "\x00\xff\u0100",
 "\x00\xff\u0100",
 "\x00\xff\u0100\u",
+"\x00\xff\u0100\u",
+"\x00\xff\u0100\u",
+"\x00\xff\u0100\u",
+"\x00\xff\u0100\u\U0001",
 ]
 )
 
@@ -582,7 +602,7 @@
 
 def test_partial(self):
 self.check_partial(
-"\x00\xff\u0100\u",
+"\x00\xff\u0100\u\U0001",
 [
 "",
 "\x00",
@@ -592,6 +612,10 @@
 "\x00\xff\u0100",
 "\x00\xff\u0100",
 "\x00\xff\u0100\u",
+"\x00\xff\u0100\u",
+"\x00\xff\u0100\u",
+"\x00\xff\u0100\u",
+"\x00\xff\u0100\u\U0001",
 ]
 )
 
@@ -621,7 +645,7 @@
 
 def test_partial(self):
 self.check_partial(
-"\x00\xff\u07ff\u0800\u",
+"\x00\xff\u07ff\u0800\u\U0001",
 [
 "\x00",
 "\x00",
@@ -634,6 +658,10 @@
 "\x00\xff\u07ff\u0800",
 "\x00\xff\u07ff\u0800",
 "\x00\xff\u07ff\u0800\u",
+"\x00\xff\u07ff\u0800\u",
+"\x00\xff\u07ff\u0800\u",
+"\x00\xff\u07ff\u0800\u",
+"\x00\xff\u07ff\u0800\u\U0001",
 ]
 )
 
@@ -812,7 +840,7 @@
 
 def test_partial(self):
 self.check_partial(
-"\ufeff\x00\xff\u07ff\u0800\u",
+"\ufeff\x00\xff\u07ff\u0800\u\U0001",
 [
 "",
 "",
@@ -831,6 +859,10 @@
 "\ufeff\x00\xff\u07f

[issue16115] test that executable arg to Popen() takes precedence over args

2012-10-08 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Thanks for the good suggestion and pointer to the relevant discussion, Andrew.

I agree re: the sentence beginning with "normally."  Incidentally, that was 
existing language that I had preserved.

I'm attaching an updated patch that incorporates your suggestion.

--
stage: test needed -> patch review
Added file: http://bugs.python.org/file27498/issue-16115-2.patch

___
Python tracker 

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



[issue16115] test that executable arg to Popen() takes precedence over args

2012-10-08 Thread Andrew Svetlov

Andrew Svetlov added the comment:

LGTM. Thanks, Chris.

--

___
Python tracker 

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



[issue16162] Py_FileSystemDefaultEncoding should be updated on locale.setlocale()

2012-10-08 Thread R. David Murray

Changes by R. David Murray :


--
resolution:  -> invalid
stage:  -> 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



[issue16166] Add PY_BYTE_ORDER macro to get endianess of platform

2012-10-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I agree, it is worth bring order to work with endianess. We can get rod of 
BYTEORDER_IS_BIG_ENDIAN and BYTEORDER_IS_LITTLE_ENDIAN in 
Objects/unicodeobject.c, IS_LITTLE_ENDIAN in Objects/longobject.c, tests in 
other modules. I don't see the necessity in new macros. WORDS_BIGENDIAN is 
enough.

If something failing on a big endian Solaris, build script should just define 
WORDS_BIGENDIAN.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue16167] Allow printing of str-derived classes

2012-10-08 Thread Radu Dan

New submission from Radu Dan:

Classes that extend the builtin 'str' cannot be printed as is, and are 
automatically converted to string.

#!/bin/env python
class newstring(str):
def __str__(self):
return self

a = newstring("hello world")
print a

Running this returns:

Traceback (most recent call last):
  File "./test.py", line 7, in 
print a
RuntimeError: print recursion

Given that instances of 'str' are immutable, I see no reason why this should 
not work.

--
components: Library (Lib)
messages: 172396
nosy: Radu.Dan
priority: normal
severity: normal
status: open
title: Allow printing of str-derived classes
type: behavior
versions: Python 2.6

___
Python tracker 

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



[issue16166] Add PY_BYTE_ORDER macro to get endianess of platform

2012-10-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch which removes some unnecessary defines and tests.

--
keywords: +patch
Added file: http://bugs.python.org/file27499/endianess_cleanup.patch

___
Python tracker 

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



[issue16161] broken link to Visual Studio 2008 in devguide

2012-10-08 Thread Chris Jerdonek

Chris Jerdonek added the comment:

> Incidentally, it was also odd that the VS executable wasn't obvious to locate.

Scratch this last comment.  A "Visual C++ 2008 Express Edition" folder was 
created under the Start menu.  It just wasn't highlighted as having been newly 
added, as was a separate "Visual Studio 2008" folder (which contained just the 
Remote Debugger application).

--

___
Python tracker 

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



[issue16166] Add PY_BYTE_ORDER macro to get endianess of platform

2012-10-08 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This doesn't depend on #16113 (quite the contrary).

--
dependencies:  -Add SHA-3 (Keccak) support

___
Python tracker 

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



[issue16166] Add PY_BYTE_ORDER macro to get endianess of platform

2012-10-08 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> #define PY_LITTLE_ENDIAN 1234
> #define PY_BIG_ENDIAN 4321
> #define PY_BYTE_ORDER 

Ouch, sounds confusing. I would rather have PY_LITTLE_ENDIAN defined only on 
little-endian machines and PY_BIG_ENDIAN only on big-endian machines.
(and PY_BYTE_ORDER isn't necessary)

--

___
Python tracker 

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



[issue16166] Add PY_BYTE_ORDER macro to get endianess of platform

2012-10-08 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> Ouch, sounds confusing. I would rather have PY_LITTLE_ENDIAN defined only
> on little-endian machines and PY_BIG_ENDIAN only on big-endian machines.
> (and PY_BYTE_ORDER isn't necessary)

Why use two complementary boolean variables for a single boolean value (Python 
does not support mixed endian in any case)? There is WORDS_BIGENDIAN already.

--

___
Python tracker 

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



[issue15991] BaseHTTPServer with ThreadingMixIn serving wrong data sometimes

2012-10-08 Thread Mikhail Afanasyev

Mikhail Afanasyev added the comment:

The bug is not only wget-specific. It was discovered while making APT proxy, so 
at least Debian APT fetcher has the same problem.

--

___
Python tracker 

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



[issue16166] Add PY_BYTE_ORDER macro to get endianess of platform

2012-10-08 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> > Ouch, sounds confusing. I would rather have PY_LITTLE_ENDIAN defined only
> > on little-endian machines and PY_BIG_ENDIAN only on big-endian machines.
> > (and PY_BYTE_ORDER isn't necessary)
> 
> Why use two complementary boolean variables for a single boolean value 
> (Python 
> does not support mixed endian in any case)?

Because it's simply more practical than having to remember which one
exists :-)

> There is WORDS_BIGENDIAN already.

A rather unfortunate IMHO.

--

___
Python tracker 

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



[issue15991] BaseHTTPServer with ThreadingMixIn serving wrong data sometimes

2012-10-08 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> The bug is not only wget-specific. It was discovered while making APT
> proxy, so at least Debian APT fetcher has the same problem.

Well, perhaps it uses wget too?

If you really think this is a bug in Python, you have to diagnose it further 
(for example by using Wireshark and analyzing the bytes exchanged between 
server and client). I've done all the debugging I can.

--

___
Python tracker 

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



[issue15833] most failures to write byte-compiled file no longer suppressed

2012-10-08 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Charles-François's patch looks ok to me. I don't know if this warrants adding a 
test.

--

___
Python tracker 

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



[issue15853] IDLE crashes selecting Preferences menu with OS X ActiveState Tcl/Tk 8.5.12.1

2012-10-08 Thread David Pietz

David Pietz added the comment:

It wasn't right on that page anymore but I poked around and fount the 8.5.11.1 
and IDLE is no longer crashing when I go to preferences or when I cut and paste 
in the edit window (I didn't tell you about that did I ?- well it fixed that, 
too)!!

thanks solo much, Ned

--

___
Python tracker 

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



[issue16167] Allow printing of str-derived classes

2012-10-08 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Python 3.4.0a0 (default:8f048c8c855e, Oct  8 2012, 13:46:48) 
[GCC 4.5.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> class newstring(str):
... def __str__(self):
... return self
... 
>>> type(str(newstring()))


--
nosy: +benjamin.peterson
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue16167] Allow printing of str-derived classes

2012-10-08 Thread Benjamin Peterson

Benjamin Peterson added the comment:

And indeed

>>> print(a)
hello world

--

___
Python tracker 

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



[issue16167] Allow printing of str-derived classes

2012-10-08 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

Radu Dan: Printing of str-derived classes works in Python >=3.0, so you should 
just upgrade to newer version of Python. New features will not be backported to 
Python 2.

--
nosy: +Arfrever
resolution: invalid -> works for me

___
Python tracker 

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



[issue12322] ElementPath 1.3 expressions documentation

2012-10-08 Thread patrick vrijlandt

patrick vrijlandt added the comment:

To be complete: an xpath 'above' the start element returns None

Thanks for the patch!

--

___
Python tracker 

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



[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2012-10-08 Thread Kevin Barry

Kevin Barry added the comment:

I still see the potential cause addressed by my patch in the 2.7, 3.3, and 
"default" branches, so I'm assuming that all versions from 2.6 on have this 
problem.

I also see that I can elect to change the "Status" and "Resolution" of this 
report. Does that mean I need to do something besides wait for someone involved 
in the project to look at my patch?

Kevin Barry

--
versions: +Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 
3.5

___
Python tracker 

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



[issue14900] cProfile does not take its result headers as sort arguments

2012-10-08 Thread Arne Babenhauserheide

Arne Babenhauserheide added the comment:

I’ll create them as soon as I get the time.

It’s not as if that’s really hard - but I still have to do it (need to diff 
against current tip - I already merged, so that should work without problems).

--

___
Python tracker 

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



[issue12322] ElementPath 1.3 expressions documentation

2012-10-08 Thread Mike Hoy

Mike Hoy added the comment:

In response to patrick vrijlandt last comment here's a patch. I also found a 
few None keywords that didn't have `` around them.

--
Added file: http://bugs.python.org/file27500/issue12322_v2.diff

___
Python tracker 

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



[issue15991] BaseHTTPServer with ThreadingMixIn serving wrong data sometimes

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

Charles-François Natali added the comment:

> The bug is not only wget-specific. It was discovered while making APT proxy, 
> so at least Debian APT fetcher has the same problem.

Debian uses wget.

--

___
Python tracker 

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



[issue15991] BaseHTTPServer with ThreadingMixIn serving wrong data sometimes

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

Charles-François Natali added the comment:

>> The bug is not only wget-specific. It was discovered while making APT proxy, 
>> so at least Debian APT fetcher has the same problem.
>
> Debian uses wget.

I meant apt-get uses wget.

--

___
Python tracker 

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



[issue16166] Add PY_BYTE_ORDER macro to get endianess of platform

2012-10-08 Thread Ned Deily

Ned Deily added the comment:

Just a reminder that we support configurations where there are both big-endian 
and little-endinan binaries in the *same* executable file: for example, Mac OS 
X 32-bit-only universal binaries (.so, .dylib, .exe) contain both i386 and ppc 
code in the same file.  So any -endian differences must remain isolated to C 
code or be dynamically tested at execution time in Python code. And ./configure 
time tests can be problematic.  (The proposed patch doesn't have that problem 
but it might be an issue later in tests.)

--
nosy: +ned.deily

___
Python tracker 

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



[issue16163] Wrong name in Lib/pkgutil.py:iter_importers

2012-10-08 Thread Berker Peksag

Berker Peksag added the comment:

> Can you also provide a test that fails using the current code (and
> that passes with the patch applied)?

New patch attached with a test.

--
Added file: http://bugs.python.org/file27501/pkgutil-name-with-test.diff

___
Python tracker 

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



[issue14916] PyRun_InteractiveLoop fails to run interactively when using a Linux pty that's not tied to stdin/stdout

2012-10-08 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +haypo

___
Python tracker 

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



[issue15278] UnicodeDecodeError when readline in codecs.py

2012-10-08 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +haypo

___
Python tracker 

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



[issue16168] SysLogHandler constructor ignores socktype arg when address refers to a Unix Domain Socket

2012-10-08 Thread Vitaly

New submission from Vitaly:

_connect_unixsocket() (see below) does not use socktype value that was passed 
into SysLogHandler.__init__():

def _connect_unixsocket(self, address):
self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
# syslog may require either DGRAM or STREAM sockets
try:
self.socket.connect(address)
except socket.error:
self.socket.close()
self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
self.socket.connect(address)

--
components: Library (Lib)
messages: 172418
nosy: vitaly
priority: normal
severity: normal
status: open
title: SysLogHandler constructor ignores socktype arg when address refers to a 
Unix Domain Socket
versions: Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue16169] ctypes.WinError() confuses errno with winerror

2012-10-08 Thread Richard Oudkerk

New submission from Richard Oudkerk:

ctypes.WinError() is defined as

def WinError(code=None, descr=None):
if code is None:
code = GetLastError()
if descr is None:
descr = FormatError(code).strip()
return WindowsError(code, descr)

Since WindowsError became an alias for OSError, this means that if e is the 
exception raised, e.errno == GetLastError() and e.winerror == None.

I think the last line should be

return WindowsError(None, descr, None, code)

--
messages: 172419
nosy: sbt
priority: normal
severity: normal
stage: needs patch
status: open
title: ctypes.WinError() confuses errno with winerror
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



[issue16168] SysLogHandler constructor ignores socktype arg when address refers to a Unix Domain Socket

2012-10-08 Thread Vitaly

Vitaly added the comment:

SOCK_DGRAM causes log messages larger than about 2000 bytes to be dropped 
altogether on MacOS X 10.7.5 and to be truncated to 2081 bytes on Linux (tested 
with Amazon's linux, which is based on centos). This is quite unfortunate, 
since many exception tracebacks for production apps are larger than 2000 bytes, 
and it's paramount to capture the entire traceback in order to debug the issue. 
This limitation can be overcome if _connect_unixsocket() used the socktype arg 
value that was passed to SysLogHandler constructor.

--

___
Python tracker 

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



[issue16168] SysLogHandler constructor ignores socktype arg when address refers to a Unix Domain Socket

2012-10-08 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue16034] bz2 module appears slower in Python 3.x versus Python 2.x

2012-10-08 Thread Nadeem Vawda

Nadeem Vawda added the comment:

I've released v0.95 of bz2file, which incorporates all the optimizations 
discussed here. The performance should be similar to 2.x's bz2 in most cases.

It is still a lot slower when calling read(10) or read(1), but I hope no-one is 
doing that anywhere where performance is important ;-)

One other note: bz2file's readline() is faster when running on 3.x than on 2.x 
(and in some cases faster than the 2.x stdlib version). This is probably due to 
improvements made to io.BufferedIOBase.readline() since 2.7, but I haven't had 
a chance to investigate this.

Let me know if you have any issues with the new release.

--

___
Python tracker 

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



[issue13477] tarfile module should have a command line

2012-10-08 Thread Berker Peksag

Changes by Berker Peksag :


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



[issue16150] Implement generator interface in itertools.chain.

2012-10-08 Thread Guido van Rossum

Guido van Rossum added the comment:

TBH I don't think that using "yield from" in the docs makes things clearer at 
all -- it just requires readers to understand a rather esoteric feature.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue16150] Implement generator interface in itertools.chain.

2012-10-08 Thread Guido van Rossum

Guido van Rossum added the comment:

I also don't think that this is a desirable feature.

--

___
Python tracker 

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



[issue16115] test that executable arg to Popen() takes precedence over args

2012-10-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 862430c68fec by Chris Jerdonek in branch '3.3':
Issue #16115: Improve testing of the executable argument to subprocess.Popen().
http://hg.python.org/cpython/rev/862430c68fec

New changeset 1b37fc50dc1b by Chris Jerdonek in branch 'default':
Issue #16115: Merge test improvements from 3.3.
http://hg.python.org/cpython/rev/1b37fc50dc1b

--

___
Python tracker 

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



[issue16115] test that executable arg to Popen() takes precedence over args

2012-10-08 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I am pushing the documentation changes separately (which will include 2.7 and 
3.2).

--

___
Python tracker 

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



[issue16168] SysLogHandler constructor ignores socktype arg when address refers to a Unix Domain Socket

2012-10-08 Thread Vinay Sajip

Changes by Vinay Sajip :


--
assignee:  -> vinay.sajip

___
Python tracker 

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



[issue16141] Possible simplification for logging.StreamHandler exception handling

2012-10-08 Thread Vinay Sajip

Changes by Vinay Sajip :


--
assignee:  -> vinay.sajip

___
Python tracker 

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



[issue16115] test that executable arg to Popen() takes precedence over args

2012-10-08 Thread Chris Jerdonek

Chris Jerdonek added the comment:

The test_executable test fails on AMD64 Ubuntu LTS.  For example:

http://buildbot.python.org/all/builders/AMD64%20Ubuntu%20LTS%203.3/builds/38/steps/test/logs/stdio

FAIL: test_executable (test.test_subprocess.ProcessTestCase)
--
Traceback (most recent call last):
  File "/opt/python/3.x.langa-ubuntu/build/Lib/test/test_subprocess.py", line 
205, in test_executable
self._assert_python(["doesnotexist", "-c"], executable=sys.executable)
  File "/opt/python/3.x.langa-ubuntu/build/Lib/test/test_subprocess.py", line 
201, in _assert_python
self.assertEqual(47, p.returncode)
AssertionError: 47 != -6

==
FAIL: test_executable (test.test_subprocess.ProcessTestCaseNoPoll)
--
Traceback (most recent call last):
  File "/opt/python/3.x.langa-ubuntu/build/Lib/test/test_subprocess.py", line 
205, in test_executable
self._assert_python(["doesnotexist", "-c"], executable=sys.executable)
  File "/opt/python/3.x.langa-ubuntu/build/Lib/test/test_subprocess.py", line 
201, in _assert_python
self.assertEqual(47, p.returncode)
AssertionError: 47 != -6

This test passed locally (at least for me) on Mac OS X and Windows.

--

___
Python tracker 

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



[issue16166] Add PY_BYTE_ORDER macro to get endianess of platform

2012-10-08 Thread Christian Heimes

Christian Heimes added the comment:

My proposal mimics the API of endian.h. It defines a BYTE_ORDER macro that is 
either equal to LITTLE_ENDIAN, BIG_ENDIAN or PDB_ENDIAN (aka mixed endian). I 
need it that way for Keccak but I can roll my own definitions if you prefer 
just two macros.

If you prefer two macros instead of three then we should name them 
PY_IS_LITTLE_ENDIAN and PY_IS_BIG_ENDIAN.

Ned:
If I understand you correctly than we can't have a configure definition and 
need macro magic like brg_endian.h.

--

___
Python tracker 

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



[issue16161] broken link to Visual Studio 2008 in devguide

2012-10-08 Thread Christian Heimes

Christian Heimes added the comment:

Thanks for your tests, Chris. :)

--

___
Python tracker 

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



[issue16115] test that executable arg to Popen() takes precedence over args

2012-10-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ef90c5e482f4 by Chris Jerdonek in branch '3.3':
Issue #16115: Skip a newly added subprocess.Popen() test on Linux.
http://hg.python.org/cpython/rev/ef90c5e482f4

New changeset 96b8eb3d3208 by Chris Jerdonek in branch 'default':
Issue #16115: Merge test skip from 3.3.
http://hg.python.org/cpython/rev/96b8eb3d3208

--

___
Python tracker 

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



[issue16115] test that executable arg to Popen() takes precedence over args

2012-10-08 Thread Chris Jerdonek

Chris Jerdonek added the comment:

More information on the failure above (from the same buildbot link):

test_executable (test.test_subprocess.ProcessTestCase) ... Could not find 
platform independent libraries 
Could not find platform dependent libraries 
Consider setting $PYTHONHOME to [:]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
FAIL

--

___
Python tracker 

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



[issue16166] Add PY_BYTE_ORDER macro to get endianess of platform

2012-10-08 Thread Ned Deily

Ned Deily added the comment:

Christian: That's right because there is only one configure execution in the OS 
X universal builds and only compiler call per module just like a normal 
single-architecture unix build.  Under the covers, the Apple compiler driver 
transparently makes multiple compiler calls, one for each architecture, and 
then use lipo to combine the binaries into one .o file etc.

--

___
Python tracker 

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



[issue16170] remove Linux skip from test_subprocess's test_executable() test

2012-10-08 Thread Chris Jerdonek

New submission from Chris Jerdonek:

This issue is to make whatever changes are necessary to remove the skip from 
test_subprocess's test_executable() test (currently skipping machines that are 
neither Windows nor Mac):

http://hg.python.org/cpython/file/ef90c5e482f4/Lib/test/test_subprocess.py#l203

The test currently fails on several Linux buildbots, but the test succeeds on 
Mac and Windows.  Perhaps this points to a different, underlying issue that 
needs to be fixed.

Either way, we should be able to test Popen()'s executable argument on Linux 
machines.  This issue seems closely related to closed issue #7774.

Below is more information from a buildbot about the failure (the AMD64 Ubuntu 
LTS buildbot):

http://buildbot.python.org/all/builders/AMD64%20Ubuntu%20LTS%203.3/builds/38/steps/test/logs/stdio

FAIL: test_executable (test.test_subprocess.ProcessTestCase)
--
Traceback (most recent call last):
  File "/opt/python/3.x.langa-ubuntu/build/Lib/test/test_subprocess.py", line 
205, in test_executable
self._assert_python(["doesnotexist", "-c"], executable=sys.executable)
  File "/opt/python/3.x.langa-ubuntu/build/Lib/test/test_subprocess.py", line 
201, in _assert_python
self.assertEqual(47, p.returncode)
AssertionError: 47 != -6

==
FAIL: test_executable (test.test_subprocess.ProcessTestCaseNoPoll)
--
Traceback (most recent call last):
  File "/opt/python/3.x.langa-ubuntu/build/Lib/test/test_subprocess.py", line 
205, in test_executable
self._assert_python(["doesnotexist", "-c"], executable=sys.executable)
  File "/opt/python/3.x.langa-ubuntu/build/Lib/test/test_subprocess.py", line 
201, in _assert_python
self.assertEqual(47, p.returncode)
AssertionError: 47 != -6

test_executable (test.test_subprocess.ProcessTestCase) ... Could not find 
platform independent libraries 
Could not find platform dependent libraries 
Consider setting $PYTHONHOME to [:]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
FAIL

--
components: Library (Lib), Tests
keywords: buildbot
messages: 172432
nosy: chris.jerdonek
priority: normal
severity: normal
status: open
title: remove Linux skip from test_subprocess's test_executable() test
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



[issue16115] test that executable arg to Popen() takes precedence over args

2012-10-08 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I created issue 16170 to track fixing the Linux-skip for the test_executable() 
test.

--

___
Python tracker 

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



[issue7774] sys.executable: wrong location if zeroth command argument is modified.

2012-10-08 Thread Chris Jerdonek

Chris Jerdonek added the comment:

I just created issue 16170 about a newly-added subprocess.Popen() test that 
succeeds on Windows and Mac but fails on Linux.  It seems closely related to 
the issue discussed here.

Perhaps it signals an underlying issue that needs to be fixed.

--
nosy: +chris.jerdonek

___
Python tracker 

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



[issue16170] remove Linux skip from test_subprocess's test_executable() test

2012-10-08 Thread Chris Jerdonek

Chris Jerdonek added the comment:

For future reference, this issue resulted from the tests committed for issue 
16115.

--

___
Python tracker 

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



[issue16150] Implement generator interface in itertools.chain.

2012-10-08 Thread Guido van Rossum

Guido van Rossum added the comment:

I am going to reject this unless at least one other core developer supports it. 
 Extensive discussion on python-ideas has found very few supporters besides 
Serhiy Storchaka.

--

___
Python tracker 

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



[issue16150] Implement generator interface in itertools.chain.

2012-10-08 Thread Nick Coghlan

Nick Coghlan added the comment:

As discussed on python-ideas: the iterator interface is narrower than the 
generator interface. Tools for working with iterators are *expected* to lose 
the generator specific details, just as for loops do, especially when they deal 
with multiple iterators.

When Greg Ewing's PEP 3152 about cofunctions was discussed in the past, the 
possibility of a C level API to allow other objects to behave like generators 
was brought up - if such an API is ever adopted, then it *may* make sense to 
use it in itertools.

In the meantime, it's simpler if itertools is consistent about ignoring the 
.send(), .throw() and return value semantics of generators-as-coroutines.

--
resolution:  -> rejected
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



[issue16150] Implement generator interface in itertools.chain.

2012-10-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

In the python-ideas thread, "Propagating StopIteration value",
Guido further elaborated "But that just seems to perpetuate the idea that you 
have, which IMO is wrongheaded. Itertools is for iterators, and all the extra 
generator features make no sense for it." I agree with this completely.

Given Raymond's consistent rejection of attempts to complexify itertools, I am 
90% sure he would reject this also. (If he disagrees, it is easy to re-open.)

You and Serhiy seem to miss that the simplicity of the iterator interface as a 
lowest common denominator is a feature. It works for its intended purpose. It 
was fixed in 2.2 and so far not subject to change. And it can effectively be 
mixed in to other classes to produce iterator + whatever classes. Files are one 
example -- they are iterators, context managers, and io method objects. 
Generators, with its additions, are another example of augmented iterator.

"I think it would be useful to chain multiple generators and still get a 
generator, not an iterator." A generator is an instance of the generator class. 
As I understand the patch, chain would still produce chain objects, not 
generator objects, and hence would fail isinstance tests.

I suggested on the thread above that gentools should be a separate module, 
initially released on pypi. Unless it is easier than I think to produce 
generator instances in C, it should be coded in Python. That would be good 
anyway while developing the interface and behavior. Start with your generator 
chain function.

Perhaps it would help you to understand my viewpoint by considering the 
analogous statement "I think it would be useful to chain multiple files and 
still get a file, not an iterator.". Or substitute any other augmented iterator 
class for 'file'.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue15348] IDLE - shell becomes unresponsive if debugger windows is closed while active.

2012-10-08 Thread Roger Serwy

Roger Serwy added the comment:

While trying to address #15347, I discovered one too many corner cases where 
the debugger breaks IDLE. The stable_idle_debugger.diff against 3.4 contains 
necessary changes to make IDLE more reliable while debugging. Since the IDLE 
debugger is not documented these changes should not be controversial.

Here are all the cases the patch fixes:
1) Closing the debugger while debugging causes the shell to not respond to new 
commands when using a subprocess.
2) Pressing F5 in an editor several times with an active debugger causes IDLE 
to become unresponsive. 
2.1) When not using the subprocess, the patch fixes an AttributeError in 
runcode in PyShell.py, since .interp is not an attribute of the interpreter.
3) Closing the shell window while the debugger is debugging prevents IDLE from 
terminating if no editors are open. #15347
4) Closing the shell with an idle debugger causes a traceback in the shell 
(with no subprocess).

The patch creates the following behavior:

1) The debugger cannot be closed by clicking "X" while it is debugging. 
Instead, the "Quit" button gets flashed as a reminder to stop the debugger 
before closing.
2) Pressing F5 in the editor window while the debugger is debugging brings 
focus to the debugger window.
3) Closing the shell will close the debugger properly. The .close() method of 
Debugger.py quits the nested eventloop in .interaction() if needed.

I tested these issues and solutions on Linux. Can someone review the patch for 
Windows and Mac?

--
stage:  -> patch review
Added file: http://bugs.python.org/file27502/stable_idle_debugger.diff

___
Python tracker 

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



[issue15348] IDLE - shell becomes unresponsive if debugger windows is closed while active.

2012-10-08 Thread jimbo1qaz

jimbo1qaz added the comment:

Is it possible to make the X button quit the debugger if enabled?

--

___
Python tracker 

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



[issue15348] IDLE - shell becomes unresponsive if debugger windows is closed while active.

2012-10-08 Thread Roger Serwy

Roger Serwy added the comment:

Clicking "X" while the debugger is enabled, but not actively debugging a 
program, will close the debugger window.

--

___
Python tracker 

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



[issue15348] IDLE - shell becomes unresponsive if debugger windows is closed while active.

2012-10-08 Thread jimbo1qaz

jimbo1qaz added the comment:

What's the intended behavior? stop debugging and quit the program? stop 
debugging and continue freerunning? I'm using 3.3, can you make the patch stop 
debugging the active running program when you click the X?

--

___
Python tracker 

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



[issue15348] IDLE - shell becomes unresponsive if debugger windows is closed while active.

2012-10-08 Thread Roger Serwy

Roger Serwy added the comment:

If the debugger is active, then clicking "X" will flash the "Quit" button. You 
must click the quit button first before closing the debugger window.

--

___
Python tracker 

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



[issue15348] IDLE - shell becomes unresponsive if debugger windows is closed while active.

2012-10-08 Thread jimbo1qaz

jimbo1qaz added the comment:

Then frigging change it!

--

___
Python tracker 

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



  1   2   >