[issue11818] tempfile.TemporaryFile example in docs doesnt work

2011-04-10 Thread eduardo

New submission from eduardo schettin...@gmail.com:

From the example:
 http://docs.python.org/py3k/library/tempfile.html#examples

The error message is weird... but I guess the problem is the default mode 'w+b'.


Python 3.3a0 (default:78a66c98288d, Apr  9 2011, 16:13:31) 
[GCC 4.4.5] on linux2
Type help, copyright, credits or license for more information.
 import tempfile
 fp = tempfile.TemporaryFile()
 fp.write('hello')
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: 'str' does not support the buffer interface
 fp2 = tempfile.TemporaryFile('w+')
 fp2.write('hello')
5


--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 133447
nosy: docs@python, schettino72
priority: normal
severity: normal
status: open
title: tempfile.TemporaryFile example in docs doesnt work
versions: Python 3.2

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



[issue11810] _socket fails to build on OpenIndiana

2011-04-10 Thread Carl Brewer

Carl Brewer c...@bl.echidna.id.au added the comment:

I know this is closed etc... but Plone (the CMS I use) is tied to various 
versions of Python, in particular 2.6 at this time.  Having it not build on 
Open[Solaris/Indiana] means I can't install current versions of Plone/Zope on 
this platform.  Any chance it could be fixed?

--
nosy: +Bleve

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



[issue11819] 'unittest -m' should not pretend it works on Python 2.5/2.6

2011-04-10 Thread anatoly techtonik

New submission from anatoly techtonik techto...@gmail.com:

The following command is broken on Python 2.5/2.6
  python -m unittest test_file
It outputs

--
Ran 0 tests in 0.000s

OK

But in Python 2.7 the same command works

--
Ran 1 tests in 0.000s

OK

It is even more confusing with test class method on command line:
  python26 -m unittest test_file.SomeTest
Traceback (most recent call last):
  ...
  File C:\~env\Python26\lib\unittest.py, line 598, in loadTestsFromName
test = obj()
  File C:\~env\Python26\lib\unittest.py, line 216, in __init__
(self.__class__, methodName)
ValueError: no such test method in class 'test_file.SomeTest': runTest


--- 
I know that our ... policy denies backporting such fixes to Python 2.5/2.6, 
but such things that make an illusion that they work while in fact they never 
did - see #6514, make Python really suxx. I can feel user frustration while 
trying to maintain 2.6 compatibility and wasting time trying to run test suite. 
I wouldn't mind if `-m unittest` won't work in non-supported versions, but it 
should at least point to bug report.

(if I'll ever switch to Ruby - this one will definitely be in the list reasons)

--
components: Tests
messages: 133449
nosy: techtonik
priority: normal
severity: normal
status: open
title: 'unittest -m' should not pretend it works on Python 2.5/2.6
type: behavior
versions: Python 2.5, Python 2.6

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



[issue11819] 'unittest -m' should not pretend it works on Python 2.5/2.6

2011-04-10 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti, michael.foord

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



[issue11818] tempfile.TemporaryFile example in docs doesnt work

2011-04-10 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 87d89f767b23 by Ross Lagerwall in branch '3.2':
Issue #11818: Fix tempfile examples for Python 3.
http://hg.python.org/cpython/rev/87d89f767b23

--
nosy: +python-dev

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



[issue11818] tempfile.TemporaryFile example in docs doesnt work

2011-04-10 Thread Ross Lagerwall

Ross Lagerwall rosslagerw...@gmail.com added the comment:

Fixed the examples for Python 3.

It writes and reads bytes now. Also fixed the old Python 2 print statement.

--
assignee: docs@python - rosslagerwall
nosy: +rosslagerwall
resolution:  - fixed
status: open - closed
versions: +Python 3.3

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



[issue11820] idle3 shell os.system swallows shell command output

2011-04-10 Thread kent

New submission from kent fuzzba...@comcast.net:

attempting to run an os.system command under the idle 3 shell swallows the out 
put.
Idle 3 is running on a 32 bit kde mandriva linux.

 import os
 os.system('ls')
0
 os.system('pwd')
0


as you can see it returns a 0 indicating successful completion, but no output. 
However os.getcwd works perfectly.

 os.getcwd()
'/home/kent/Documents' 

running the same code from python in an xwindow terminal works fine.

apparently the idle shell does not echo the the standard output or error output 
as the python interpreter does.

--
components: IDLE
messages: 133452
nosy: Thekent
priority: normal
severity: normal
status: open
title: idle3 shell os.system swallows shell command output
type: behavior
versions: Python 3.1

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



[issue11820] idle3 shell os.system swallows shell command output

2011-04-10 Thread kent

kent fuzzba...@comcast.net added the comment:

running it as a file from idle gives the same result.
import os
print (os.system('pwd'))

0

--

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



[issue11810] _socket fails to build on OpenIndiana

2011-04-10 Thread Antoine Pitrou

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

 I know this is closed etc... but Plone (the CMS I use) is tied to
 various versions of Python, in particular 2.6 at this time.  Having it
 not build on Open[Solaris/Indiana] means I can't install current
 versions of Plone/Zope on this platform.  Any chance it could be
 fixed?

I would be surprised if Plone/Zope didn't work on 2.7 by the time.
Perhaps you want to ask their mailing-lists.

--

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



[issue11810] _socket fails to build on OpenIndiana

2011-04-10 Thread Carl Brewer

Carl Brewer c...@bl.echidna.id.au added the comment:

Plone ships with a universal installer which expects particular versions of 
python (and PIL etc etc) which makes it easy to build on, for example, many 
Linux distros, but it's just not working on Open[Solaris|Indiana] and also 
NetBSD (pkgsrc's python2.6 is broken too, but we're working on that).  The only 
time the installer gets bumped is when new versions of Plone get released, 
which means that only the bleeding edge might work.  This is a problem for many 
integrators who are tied to older versions of Plone|Zope that are unlikely to 
get migrated to more recent releases in any sort of a reasonable timeframe.

Is it really not possible to fix up python2.6 to solve this issue?

--

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



[issue11810] _socket fails to build on OpenIndiana

2011-04-10 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +barry

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



[issue11819] 'unittest -m' should not pretend it works on Python 2.5/2.6

2011-04-10 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

Isn't this an exact duplicate of issue6514? Or do you suggest something else?

--
nosy: +amaury.forgeotdarc

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




[issue11821] smtplib should provide a means to validate a remote server ssl certificate(s)

2011-04-10 Thread david

New submission from david db.pub.m...@gmail.com:

(This is similar to http://bugs.python.org/issue10274)
The smtplib module should provide a means to validate a remote server ssl 
certificate(s). 

It would be 'nice' if smtplib.SMTP_SSL  smtplib.starttls took in arguments to 
validate the remote SMTP's ssl certificate has been signed by a trusted 
certificate authority(and the common name matches what it should etc.).

--
messages: 133457
nosy: db
priority: normal
severity: normal
status: open
title: smtplib should provide a means to validate a remote server ssl 
certificate(s)

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



[issue8809] smtplib should support SSL contexts

2011-04-10 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
title: smptlib should support SSL contexts - smtplib should support SSL 
contexts

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



[issue11821] smtplib should provide a means to validate a remote server ssl certificate(s)

2011-04-10 Thread Antoine Pitrou

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

Duplicate of issue11821.

--
nosy: +pitrou
resolution:  - duplicate
status: open - closed
superseder:  - smtplib should provide a means to validate a remote server ssl 
certificate(s)

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



[issue11821] smtplib should provide a means to validate a remote server ssl certificate(s)

2011-04-10 Thread Antoine Pitrou

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

Oops, I meant issue8809.

--
superseder: smtplib should provide a means to validate a remote server ssl 
certificate(s) - smtplib should support SSL contexts

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



[issue6514] python -m unittest testmodule does not run any tests

2011-04-10 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

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



[issue11819] 'unittest -m' should not pretend it works on Python 2.5/2.6

2011-04-10 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Yes, this is a duplicate.

--
nosy: +georg.brandl
resolution:  - duplicate
status: open - closed
superseder:  - python -m unittest testmodule does not run any tests

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



[issue2650] re.escape should not escape underscore

2011-04-10 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset dda33191f7f5 by Ezio Melotti in branch 'default':
#2650: re.escape() no longer escapes the _.
http://hg.python.org/cpython/rev/dda33191f7f5

--

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



[issue2650] re.escape should not escape underscore

2011-04-10 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


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

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



[issue8809] smtplib should support SSL contexts

2011-04-10 Thread david

Changes by david db.pub.m...@gmail.com:


--
nosy: +db

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



[issue8428] buildbot: test_multiprocessing timeout (test_notify_all? test_pool_worker_lifetime?)

2011-04-10 Thread Charles-Francois Natali

Charles-Francois Natali neolo...@free.fr added the comment:

I think those lockups are due to a race in the Pool shutdown code.
In Lib/multiprocessing/pool.py:

def close(self):
debug('closing pool')
if self._state == RUN:
self._state = CLOSE
self._worker_handler._state = CLOSE
self._taskqueue.put(None) 

We set the current state to CLOSE, and send None to the taskqueue, so that 
task_handler detects that we want to shut down the queue and sends None 
(sentinel) to the inqueue for each worker process.
When a worker process receives this sentinel, it exists, and when Pool's join 
method is called, each process is joined successfully.
Now, there's a problem, because of the worker_hanler thread.
This thread constantly starts new threads if existing one exited after having 
completed their work:

def _handle_workers(pool):
while pool._worker_handler._state == RUN and pool._state == RUN:
pool._maintain_pool()
time.sleep(0.1)
debug('worker handler exiting')

where 

def _maintain_pool(self):
Clean up any exited workers and start replacements for them.

if self._join_exited_workers():
self._repopulate_pool()

Imagine the following happens:

worker_handler checks that the pool is still running (state == RUN), but before 
calling maintain_pool, it's preempted (releasal of the GIL), and Pool's close() 
methode is called :
state is set to CLOSE, None is put to taskqueue, and worker threads exit.
Then, Pool's join is called:

def join(self):
debug('joining pool')
assert self._state in (CLOSE, TERMINATE)
self._worker_handler.join()
self._task_handler.join()
self._result_handler.join()
for p in self._pool:
p.join()


this blocks until worker_handler exits. This thread sooner or later resumes and 
calls maintain_pool.
maintain_pool calls repopulate_pool, which recreates new worker 
threads/processes.
Then, worker_handler checks the current state, sees CLOSE, and exists.
Then, Pool's join blocks  there:
for p in self._pool:
p.join()

since the newly created processes never receive the sentinels (already consumed 
by the previous worker processes)...

This race can be reproduced almost every time by just adding:


def _handle_workers(pool):
while pool._worker_handler._state == RUN and pool._state == RUN:
+time.sleep(1)
pool._maintain_pool()
time.sleep(0.1)
debug('worker handler exiting')

Then something as simple as this will block:

p = multiprocessing.Pool(3)
p.close()
p.join()

I still have to think of a clean way to solve this.

--
nosy: +neologix

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



[issue8809] smtplib should support SSL contexts

2011-04-10 Thread Thomas Scrace

Thomas Scrace t...@scrace.org added the comment:

Is anybody working on this issue? If not, I think it looks like it might be a 
nice one for me to tackle. I'll go ahead unless there are any objections.

--
nosy: +thomas.scrace

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



[issue11816] Add functions to return disassembly as string

2011-04-10 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

I really like the idea of adding some lower level infrastructure to dis to make 
it generator based, making the disassembly more amenable to programmatic 
manipulation.

Consider if, for each line disassemble() currently prints, we had an underlying 
iterator that yielded a named tuple consisting of (index, opcode, oparg, 
linestart, details). I've created a proof-of-concept for that in my sandbox 
(http://hg.python.org/sandbox/ncoghlan/file/get_opinfo/Lib/dis.py) which adds a 
get_opinfo() function that does exactly. With disassemble() rewritten to use 
that, test_dis and test_peepholer still pass as currently written.

Near-term, test_peepholer could easily continue to do what it does now (i.e. 
use the higher level dis() function and redirect sys.stdout). Longer term, it 
could be written to analyse the opcode stream instead of doing string 
comparisons.

--
hgrepos: +17

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



[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

2011-04-10 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Changed issue title to cover ideas like get_opinfo().

--
title: Add functions to return disassembly as string - Refactor the dis module 
to provide better building blocks for bytecode analysis

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



[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

2011-04-10 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Oops, I forgot to edit my comment to match the OpInfo definition I used in the 
proof-of-concept:

OpInfo = collections.namedtuple(OpInfo,
opindex opcode opname oparg details starts_line is_jump_target)

--

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



[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

2011-04-10 Thread Eugene Toder

Eugene Toder elto...@gmail.com added the comment:

So in the near term, dis-based tests should continue to copy/paste sys.stdout 
redirection code?

--

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



[issue11817] berkeley db 5.1 support

2011-04-10 Thread R. David Murray

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

Python 2.7 is closed for new features, I afraid.  And Berkeley DB is not 
included in the Python3 stdlib.  It has reverted to being maintained entirely 
as a third party package.

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

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



[issue11802] filecmp.cmp needs a documented way to clear cache

2011-04-10 Thread Nadeem Vawda

Nadeem Vawda nadeem.va...@gmail.com added the comment:

Georg? Benjamin? Do you think this fix should be backported?

--
nosy: +benjamin.peterson, georg.brandl

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



[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

2011-04-10 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

If we decide our long term goal is the use of the opcode stream for 
programmatic access, then yes.

--

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



[issue11807] Documentation of add_subparsers lacks information about parametres

2011-04-10 Thread Filip Gruszczyński

Filip Gruszczyński grusz...@gmail.com added the comment:

Here is a patch for this. I am not much of technical writer, so please be 
patient with me. I tried to provide all the information about parameters, that 
can be inferred from the code and experimenting. I have left out one parameter 
- action - because I don't see any use of it for a potential user and potential 
description seemed very complicated. I'll be happy to work further on the 
patch, if someone is willing to tutor me a little.

--
keywords: +patch
Added file: http://bugs.python.org/file21604/11807.patch

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



[issue11610] Improving property to accept abstract methods

2011-04-10 Thread Darren Dale

Darren Dale dsdal...@gmail.com added the comment:

So, are there objections to this patch, or can it be merged?

--

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



[issue11772] email header wrapping edge case failure

2011-04-10 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
resolution:  - duplicate
stage: needs patch - committed/rejected
status: open - closed
superseder:  - email.header.Header doesn't fold headers correctly

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



[issue8809] smtplib should support SSL contexts

2011-04-10 Thread Antoine Pitrou

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

 Is anybody working on this issue? If not, I think it looks like it
 might be a nice one for me to tackle. I'll go ahead unless there are
 any objections.

Nobody is working on it AFAIK. Feel free to give it a try :)

--

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



[issue11650] Faulty RESTART/EINTR handling in Parser/myreadline.c

2011-04-10 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso sdao...@googlemail.com added the comment:

On Sat, Apr 09, 2011 at 02:18:01PM +, STINNER Victor wrote:
 I noticied a strange behaviour:

Still fun, but this one could even make it except for termios
flags, multibyte and the real problem, signal handling.
Hm.

--
Added file: http://bugs.python.org/file21605/11650.termios-1.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11650
___diff --git a/Parser/myreadline.c b/Parser/myreadline.c
--- a/Parser/myreadline.c
+++ b/Parser/myreadline.c
@@ -10,6 +10,10 @@
 */
 
 #include Python.h
+#ifdef Py_PYPORT_H
+# define __USE_TERMIOS
+# include signal.h
+#endif
 #ifdef MS_WINDOWS
 #define WIN32_LEAN_AND_MEAN
 #include windows.h
@@ -19,6 +23,18 @@
 extern char* vms__StdioReadline(FILE *sys_stdin, FILE *sys_stdout, char 
*prompt);
 #endif
 
+typedef struct Args {
+char*input;
+FILE*fp;
+int tios_fd;
+int tios_is_init;
+#ifdef __USE_TERMIOS
+int tios_is_set;
+int __align;
+struct termios  tios_old;
+struct termios  tios_new;
+#endif
+} Args;
 
 PyThreadState* _PyOS_ReadlineTState;
 
@@ -29,117 +45,230 @@
 
 int (*PyOS_InputHook)(void) = NULL;
 
-/* This function restarts a fgets() after an EINTR error occurred
-   except if PyOS_InterruptOccurred() returns true. */
+/* This function restarts a fgetc() after an EINTR error occurred
+ * except if PyOS_InterruptOccurred() returns true */
+static int  my_fgets(Args *args);
+#ifdef __USE_TERMIOS
+static void termios_resume(Args *args);
+static void termios_suspend(Args *args);
+#endif
+
+#ifdef __USE_TERMIOS
+static void
+termios_resume(Args *args)
+{
+if (!args-tios_is_init) {
+args-tios_is_init = 1;
+
+while (tcgetattr(args-tios_fd, args-tios_old) != 0)
+if (errno != EINTR) {
+args-tios_fd = -1;
+goto jleave;
+}
+
+memcpy(args-tios_new, args-tios_old, sizeof(args-tios_old));
+args-tios_new.c_lflag = ~(/*ECHOCTL |*/ ICANON);
+args-tios_new.c_cc[VMIN] = 1;
+}
+
+if (args-tios_fd  0)
+goto jleave;
+
+while (tcsetattr(args-tios_fd, TCSAFLUSH, args-tios_new) != 0)
+;
+args-tios_is_set = 1;
+
+jleave:
+return;
+}
+
+static void
+termios_suspend(Args *args)
+{
+if (args-tios_is_init  args-tios_is_set) {
+while (tcsetattr(args-tios_fd, TCSANOW, args-tios_old) != 0)
+;
+args-tios_is_set = 0;
+}
+return;
+}
+#endif
 
 static int
-my_fgets(char *buf, int len, FILE *fp)
+my_fgets(Args *args)
 {
-char *p;
+int estat;
+char *buf, *cursor;
+size_t buf_len;
+
+buf = (char*)PyMem_MALLOC(2*80);
+estat = 1;
+if (buf == NULL)
+goto jreturn;
+
+cursor = buf;
+buf_len = 2*80 - 2;
+jrestart_input:
+estat = 0;
+
+if (PyOS_InputHook != NULL)
+(void)(PyOS_InputHook)();
+#ifdef __USE_TERMIOS
+termios_resume(args);
+#endif
+
+/* Fetch bytes until error or newline */
+errno = 0;
 while (1) {
-if (PyOS_InputHook != NULL)
-(void)(PyOS_InputHook)();
-errno = 0;
-p = fgets(buf, len, fp);
-if (p != NULL)
-return 0; /* No error */
+int c = fgetc(args-fp);
+#ifdef __USE_TERMIOS
+if (!isprint(c))
+switch (c) {
+case '\x04':
+c = EOF;
+/* FALLTHROUGH */
+default:
+break;
+case '\x03':
+estat = SIGINT;
+goto j_sigit;
+case '\x1A':
+estat = SIGTSTP;
+goto j_sigit;
+case '\x1C':
+estat = SIGQUIT;
+/* FALLTHROUGH */
+j_sigit:termios_suspend(args);
+kill(getpid(), estat);
+errno = EINTR;
+goto jcheck_fail;
+}
+#endif
+if (c == EOF)
+goto jcheck_fail;
+*(cursor++) = (char)c;
+if (c == '\n')
+break;
+
+if ((size_t)(cursor-buf) = buf_len) {
+buf_len += 2+32;
+cursor = buf = (char*)PyMem_REALLOC(buf, buf_len);
+if (buf == NULL) {
+estat = 1;
+goto jreturn;
+}
+buf_len -= 2+32;
+cursor += buf_len;
+buf_len += 32;
+}
+}
+
+*cursor = '\0';
+args-input = buf;
+jreturn:
+#ifdef __USE_TERMIOS
+termios_suspend(args);
+#endif
+return estat;
+
+jcheck_fail:
 #ifdef MS_WINDOWS
-/* In the case of a Ctrl+C or some other external event
-   interrupting the operation:
-   Win2k/NT: ERROR_OPERATION_ABORTED is the most recent Win32
-   error code (and feof() returns TRUE).
-   Win9x: Ctrl+C seems to have no effect on 

[issue11700] mailbox.py proxy updates

2011-04-10 Thread Steffen Daode Nurpmeso

Steffen Daode Nurpmeso sdao...@googlemail.com added the comment:

I reviewed this.
And moved a _PartialFile-only _read() case to _PartialFile where
it belongs (*this* _ProxyFile will never be extended to stand
alone so i shouldn't have moved that the other direction at all).

--
Added file: http://bugs.python.org/file21606/11700.yeah-review.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11700
___diff --git a/Lib/mailbox.py b/Lib/mailbox.py
--- a/Lib/mailbox.py
+++ b/Lib/mailbox.py
@@ -1864,97 +1864,142 @@
 Message with MMDF-specific properties.
 
 
-class _ProxyFile:
-A read-only wrapper of a file.
+class _ProxyFile(io.BufferedIOBase):
+A io.BufferedIOBase inheriting read-only wrapper for a seekable file.
+It supports __iter__() and the context-manager protocol.
+
+def __init__(self, file, pos=None):
+io.BufferedIOBase.__init__(self)
+self._file = file
+self._pos = file.tell() if pos is None else pos
+self._close = True
+self._is_open = True
 
-def __init__(self, f, pos=None):
-Initialize a _ProxyFile.
-self._file = f
-if pos is None:
-self._pos = f.tell()
+def _set_noclose(self):
+Subclass hook - use to avoid closing internal file object.
+self._close = False
+
+def _closed_check(self):
+Raise ValueError if not open.
+if not self._is_open:
+raise ValueError('I/O operation on closed file')
+
+def close(self):
+if self._close:
+self._close = False
+self._file.close()
+del self._file
+self._is_open = False
+
+@property
+def closed(self):
+return not self._is_open
+
+def flush(self):
+# Not possible because it gets falsely called (issue 11700)
+#raise io.UnsupportedOperation('flush')
+pass
+
+def _read(self, size, read_method, readinto_arg=None):
+if size is None or size  0:
+size = -1
+self._file.seek(self._pos)
+if not readinto_arg:
+result = read_method(size)
 else:
-self._pos = pos
+result = read_method(readinto_arg)
+if result  len(readinto_arg):
+del readinto_arg[result:]
+self._pos = self._file.tell()
+return result
 
-def read(self, size=None):
-Read bytes.
+def readable(self):
+self._closed_check()
+return True
+
+def read(self, size=-1):
+self._closed_check()
+if size is None or size  0:
+return self.readall()
 return self._read(size, self._file.read)
 
-def read1(self, size=None):
-Read bytes.
+def read1(self, size=-1):
+self._closed_check()
+if size is None or size  0:
+return b''
 return self._read(size, self._file.read1)
 
-def readline(self, size=None):
-Read a line.
+def readinto(self, by_arr):
+self._closed_check()
+return self._read(len(by_arr), self._file.readinto, by_arr)
+
+def readall(self):
+self._closed_check()
+self._file.seek(self._pos)
+if hasattr(self._file, 'readall'):
+result = self._file.readall()
+else:
+dl = []
+while 1:
+i = self._file.read(8192)
+if len(i) == 0:
+break
+dl.append(i)
+result = b''.join(dl)
+self._pos = self._file.tell()
+return result
+
+def readline(self, size=-1):
+self._closed_check()
 return self._read(size, self._file.readline)
 
-def readlines(self, sizehint=None):
-Read multiple lines.
+def readlines(self, sizehint=-1):
 result = []
 for line in self:
 result.append(line)
-if sizehint is not None:
+if sizehint = 0:
 sizehint -= len(line)
 if sizehint = 0:
 break
 return result
 
+def seekable(self):
+self._closed_check()
+return True
+
+def seek(self, offset, whence=0):
+self._closed_check()
+if whence == 1:
+self._file.seek(self._pos)
+self._pos = self._file.seek(offset, whence)
+return self._pos
+
+def tell(self):
+self._closed_check()
+return self._pos
+
+def writable(self):
+self._closed_check()
+return False
+
+def writelines(self, lines):
+raise io.UnsupportedOperation('writelines')
+
+def write(self, b):
+raise io.UnsupportedOperation('write')
+
 def __iter__(self):
-Iterate over lines.
 while True:
 line = self.readline()
 if not line:
 raise StopIteration
 yield line
 
-def tell(self):
- 

[issue11492] email.header.Header doesn't fold headers correctly

2011-04-10 Thread R. David Murray

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

This was quite the adventure.  The more I worked on fixing the tests, the more 
if/else cases the existing splitting algorithm grew.  When I reached the point 
where fixing one test broke two others, I thought maybe it was time to try a 
different approach.

Based on the knowledge gathered by banging my head on the old algorithm, I 
developed a new one.  This one is more RFC2822/RFC5322 compliant, I believe.  
It breaks only at FWS, but still gives preference to breaking after commas or 
semicolons by default.

I had to adjust several tests that tested broken behavior: the folded lines 
were longer than maxlen even though there were suitable fold points.

I'm very happy with this patch because there are 70 fewer lines of code but the 
module passes more tests.

Even though the code changes are extensive, I plan to apply this to 3.2.  It 
fixes bugs, and the new code is at least somewhat easier to understand than the 
old code (if only because there is less of it!)  I don't plan to apply it to 
3.1 because one older test fails if the patch is applied and I don't understand 
why (it appears to have nothing to do with line wrapping, and the same test 
works fine in 3.2).

--
stage: needs patch - patch review
versions:  -Python 3.1
Added file: http://bugs.python.org/file21607/better_header_spliter.patch

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



[issue11822] Improve disassembly to show embedded code objects

2011-04-10 Thread Raymond Hettinger

New submission from Raymond Hettinger raymond.hettin...@gmail.com:

Now that list comprehensions mask run their internals in code objects (the same 
way that genexps do), it is getting harder to use dis() to see what code is 
generated.  For example, the pow() call isn't shown in the following 
disassembly:

 dis('[x**2 for x in range(3)]')
  1   0 LOAD_CONST   0 (code object listcomp at 
0x1005d1e88, file dis, line 1) 
  3 MAKE_FUNCTION0 
  6 LOAD_NAME0 (range) 
  9 LOAD_CONST   1 (3) 
 12 CALL_FUNCTION1 
 15 GET_ITER 
 16 CALL_FUNCTION1 
 19 RETURN_VALUE

I propose that dis() build-up a queue undisplayed code objects and then 
disassemble each of those after the main disassembly is done (effectively 
making it recursive and displaying code objects in the order that they are 
first seen in the disassembly).  For example, the output shown above would be 
followed by a disassembly of its internal code object:

code object listcomp at 0x1005d1e88, file dis, line 1:
  1   0 BUILD_LIST   0 
  3 LOAD_FAST0 (.0) 
6 FOR_ITER16 (to 25) 
  9 STORE_FAST   1 (x) 
 12 LOAD_FAST1 (x) 
 15 LOAD_CONST   0 (2) 
 18 BINARY_POWER 
 19 LIST_APPEND  2 
 22 JUMP_ABSOLUTE6 
   25 RETURN_VALUE

--
components: Library (Lib)
messages: 133478
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Improve disassembly to show embedded code objects
type: feature request
versions: Python 3.3

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



[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

2011-04-10 Thread Alex Gaynor

Alex Gaynor alex.gay...@gmail.com added the comment:

FWIW in PyPy we have 
https://bitbucket.org/pypy/pypy/src/default/lib_pypy/disassembler.py which we 
use for some of our tools.

--
nosy: +alex

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



[issue11492] email.header.Header doesn't fold headers correctly

2011-04-10 Thread R. David Murray

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

Note that this fix solves issue 11772, so I've closed that one as a duplicate.

--

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



[issue1602] windows console doesn't print or input Unicode

2011-04-10 Thread pyloz

Changes by pyloz merlinschindlb...@googlemail.com:


--
nosy: +smerlin

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



[issue11823] disassembly needs to argument counts on calls with keyword args

2011-04-10 Thread Raymond Hettinger

New submission from Raymond Hettinger raymond.hettin...@gmail.com:

The argument to CALL_FUNCTION is overloaded to show both the number of 
positional arguments and keyword arguments (shifted by 8-bits):

 dis(foo(10, opt=True))
  1   0 LOAD_NAME0 (foo) 
  3 LOAD_CONST   0 (10) 
  6 LOAD_CONST   1 ('opt') 
  9 LOAD_CONST   2 (True) 
 12 CALL_FUNCTION  257 
 15 RETURN_VALUE 

It is not obvious that the 257 argument causes three stack arguments to be 
popped.

The disassembly should add a parenthetical to explain the composition:

 dis(foo(10, opt=True))
  1   0 LOAD_NAME0 (foo) 
  3 LOAD_CONST   0 (10) 
  6 LOAD_CONST   1 ('opt') 
  9 LOAD_CONST   2 (True) 
 12 CALL_FUNCTION  257 (1 positional, 1 keyword pair)
 15 RETURN_VALUE

--
components: Library (Lib)
messages: 133481
nosy: rhettinger
priority: normal
severity: normal
status: open
title: disassembly needs to argument counts on calls with keyword args
type: feature request
versions: Python 3.3

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



[issue11823] disassembly needs to argument counts on calls with keyword args

2011-04-10 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
keywords: +easy
stage:  - needs patch

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



[issue9325] Add an option to pdb/trace/profile to run library module as a script

2011-04-10 Thread Greg Słodkowicz

Greg Słodkowicz jerg...@gmail.com added the comment:

Following Nick's advice, I extended runpy.run_module to accept an extra 
parameter to be used as replacement __main__ namespace.

Having this, I can make this temporary __main__ accessible in main() in modules 
like trace/profile/pdb even if module execution fails with an exception. The 
problem is that it's visible only in the calling function but not in the global 
namespace. One way to make it accessible for post mortem debugging would be to 
create the replacement __main__ module in the global namespace and then pass as 
a parameter to main(), but this seems clumsy.

So maybe the way to go is to have runpy store last used __main__, 
sys.exc_info() style. In this case, would this be the correct way to store it 
in runpy:

try:
import threading
except ImportError:
temp_main = None
else:
local_storage = threading.local()
local_storage.temp_main = None
temp_main = local_storage.temp_main

?

--

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



[issue11823] disassembly needs to argument counts on calls with keyword args

2011-04-10 Thread Daniel Urban

Changes by Daniel Urban urban.dani...@gmail.com:


--
nosy: +durban

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



[issue8428] buildbot: test_multiprocessing timeout (test_notify_all? test_pool_worker_lifetime?)

2011-04-10 Thread Charles-Francois Natali

Charles-Francois Natali neolo...@free.fr added the comment:

Attached is a patch fixing this race, and a similar one in Pool's terminate.

--
keywords: +patch
Added file: http://bugs.python.org/file21608/pool_shutdown_race.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8428
___diff -r bbfc65d05588 Lib/multiprocessing/pool.py
--- a/Lib/multiprocessing/pool.py   Thu Apr 07 10:48:29 2011 -0400
+++ b/Lib/multiprocessing/pool.py   Sun Apr 10 23:52:22 2011 +0200
@@ -322,6 +322,8 @@
 while pool._worker_handler._state == RUN and pool._state == RUN:
 pool._maintain_pool()
 time.sleep(0.1)
+# send sentinel to stop workers
+pool._taskqueue.put(None)
 debug('worker handler exiting')
 
 @staticmethod
@@ -440,7 +442,6 @@
 if self._state == RUN:
 self._state = CLOSE
 self._worker_handler._state = CLOSE
-self._taskqueue.put(None)
 
 def terminate(self):
 debug('terminating pool')
@@ -474,7 +475,6 @@
 
 worker_handler._state = TERMINATE
 task_handler._state = TERMINATE
-taskqueue.put(None) # sentinel
 
 debug('helping task handler/workers to finish')
 cls._help_stuff_finish(inqueue, task_handler, len(pool))
@@ -484,6 +484,11 @@
 result_handler._state = TERMINATE
 outqueue.put(None)  # sentinel
 
+# we must wait for the worker handler to exit before terminating
+# workers because we don't want workers to be restarted behind our 
back 
+debug('joining worker handler')
+worker_handler.join()
+
 # Terminate workers which haven't already finished.
 if pool and hasattr(pool[0], 'terminate'):
 debug('terminating workers')
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8428] buildbot: test_multiprocessing timeout (test_notify_all? test_pool_worker_lifetime?)

2011-04-10 Thread Antoine Pitrou

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

Nice! See also issue11814.

--
nosy: +pitrou

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



[issue8428] buildbot: test_multiprocessing timeout (test_notify_all? test_pool_worker_lifetime?)

2011-04-10 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset d5e43afeede6 by Antoine Pitrou in branch '3.2':
Issue #8428: Fix a race condition in multiprocessing.Pool when terminating
http://hg.python.org/cpython/rev/d5e43afeede6

--
nosy: +python-dev

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



[issue11814] possible typo in multiprocessing.Pool._terminate

2011-04-10 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset c046b7e1087b by Antoine Pitrou in branch '3.2':
Issue #11814: Fix likely typo in multiprocessing.Pool._terminate().
http://hg.python.org/cpython/rev/c046b7e1087b

New changeset 76a3fc180ce0 by Antoine Pitrou in branch 'default':
Merge from 3.2 (issue #11814, issue #8428)
http://hg.python.org/cpython/rev/76a3fc180ce0

--
nosy: +python-dev

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



[issue8428] buildbot: test_multiprocessing timeout (test_notify_all? test_pool_worker_lifetime?)

2011-04-10 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset dfc61dc14f59 by Antoine Pitrou in branch '2.7':
Issue #8428: Fix a race condition in multiprocessing.Pool when terminating
http://hg.python.org/cpython/rev/dfc61dc14f59

--

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



[issue8428] buildbot: test_multiprocessing timeout (test_notify_all? test_pool_worker_lifetime?)

2011-04-10 Thread Antoine Pitrou

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

Should be fixed now, thank you Charles-François.
As for the TestCondition failure, there's a separate issue11790 open.
(Victor, please don't file many bugs in a single issue!)

--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
versions: +Python 3.3

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



[issue11814] possible typo in multiprocessing.Pool._terminate

2011-04-10 Thread Antoine Pitrou

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

Fixed. The _terminate() issue has been fixed separately in issue8428.

--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue11816] Refactor the dis module to provide better building blocks for bytecode analysis

2011-04-10 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
assignee:  - rhettinger

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



[issue11747] unified_diff function product incorrect range information

2011-04-10 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 36648097fcd4 by Raymond Hettinger in branch '3.2':
Cleanup and modernize code prior to working on Issue 11747.
http://hg.python.org/cpython/rev/36648097fcd4

New changeset 58a3bfcc70f7 by Raymond Hettinger in branch 'default':
Cleanup and modernize code prior to working on Issue 11747.
http://hg.python.org/cpython/rev/58a3bfcc70f7

--
nosy: +python-dev

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



[issue4877] xml.parsers.expat ParseFile() causes segmentation fault when passed a closed file object

2011-04-10 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 28705a7987c5 by Ezio Melotti in branch '2.7':
#4877: Fix a segfault in xml.parsers.expat while attempting to parse a closed 
file.
http://hg.python.org/cpython/rev/28705a7987c5

--
nosy: +python-dev

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



[issue4877] xml.parsers.expat ParseFile() causes segmentation fault when passed a closed file object

2011-04-10 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

This is now fixed in 2.7, I also removed the unnecessary call to PyErr_Clear in 
ba699cf9bdbb (2.7), 6b4467e71872 (3.2), and 2d1d9759d3a4 (3.3).

--
assignee:  - ezio.melotti
resolution:  - fixed
stage: commit review - committed/rejected
status: open - closed

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



[issue11820] idle3 shell os.system swallows shell command output

2011-04-10 Thread kent

kent fuzzba...@comcast.net added the comment:

When starting idle from a terminal the output from the command is sent to the 
terminal.  When starting idle from the desktop, the output disappears except  
for the exit status.  Same behavior with 2.65

--

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



[issue1028] Tkinter binding involving Control-spacebar raises unicode error

2011-04-10 Thread R. David Murray

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

Nudge: report on the Ubuntu bug tracker that this is still an issue with 3.2:

https://bugs.launchpad.net/bugs/517552

--
nosy: +r.david.murray
versions: +Python 3.2, Python 3.3

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



[issue985064] plistlib crashes too easily on bad files

2011-04-10 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
assignee: jvr - 

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



[issue11824] freeze.py broken due to ABI flags

2011-04-10 Thread Andreas Stührk

New submission from Andreas Stührk andy-pyt...@hammerhartes.de:

The recent addition of ABI flags broke the freeze tool as it doesn't construct 
the paths to required files correctly any longer. The attached patch fixes the 
issue for me, but I'm not too sure that I used the right config values.

--
components: Demos and Tools
files: freeze.patch
keywords: patch
messages: 133495
nosy: Trundle
priority: normal
severity: normal
status: open
title: freeze.py broken due to ABI flags
type: behavior
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file21609/freeze.patch

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



[issue5673] Add timeout option to subprocess.Popen

2011-04-10 Thread Reid Kleckner

Reid Kleckner r...@mit.edu added the comment:

Thanks for fixing the negative timeout issue.  I assumed incorrectly that a 
negative timeout would cause it to check and return immediately if it would 
otherwise block.

As for the docs, the 3.2/3.3 issue was fixed in [[72e49cb7fcf5]].

I just added a Misc/NEWS entry for 3.3's What's New in [[9140f2363623]].

--
status: open - closed

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



[issue11757] test_subprocess.test_communicate_timeout_large_ouput failure on select(): negative timeout?

2011-04-10 Thread Reid Kleckner

Reid Kleckner r...@mit.edu added the comment:

I think the best behavior would be to go ahead and check one last time before 
raising the exception, so _remaining_time should turn a negative value into 0 
(assuming that a timeout value of zero does the right thing for our use case).

If people don't feel that is best, refactoring _remaining_time to incorporate 
the check in _check_timeout would also be good.

--

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



[issue985064] plistlib crashes too easily on bad files

2011-04-10 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

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



[issue775321] plistlib error handling

2011-04-10 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

Note that this behavior is documented[0]:

The XML data is parsed using the Expat parser from xml.parsers.expat – see its 
documentation for possible exceptions on ill-formed XML. Unknown elements will 
simply be ignored by the plist parser.


Since this is documented and expat only has an exception type 
(xml.parsers.expat.ExpatError) I don't think is necessary to do anything here.
Unless you think that the doc should be rephrased, this can be closed again.

[0]: http://docs.python.org/library/plistlib.html#plistlib.readPlist

--
assignee: jvr - 
nosy: +ezio.melotti

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



[issue775321] plistlib error handling

2011-04-10 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

I agree.  If it were important to make plistlib error handling more useful, 
using a different parser would be the way to go, I think.  In any case, Apple 
has deprecated the use of XML plists and moved to a binary plist format that 
plistlib does not recognize or handle.

--
resolution:  - wont fix
stage:  - committed/rejected
status: open - closed

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