[issue6700] inspect.getsource() returns incorrect source lines

2009-08-13 Thread Gabriel Genellina

Changes by Gabriel Genellina :


Added file: http://bugs.python.org/file14717/show_inspect_bug.py

___
Python tracker 

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



[issue6700] inspect.getsource() returns incorrect source lines

2009-08-13 Thread Gabriel Genellina

New submission from Gabriel Genellina :

inspect.getsource(obj) returns incorrect results when obj is a 
traceback or frame object outside any function (that is, at the module 
level).

This demo script shows the problem. The correct output should contain 
all source lines in the module, but it only returns the first two:


D:\temp>type show_inspect_bug.py
def foo(x):
  return y + z

import inspect
frame = inspect.currentframe()
print inspect.getsource(frame)


D:\temp>python show_inspect_bug.py
def foo(x):
  return y + z


The attached patch fixes the problem and adds some missing test cases.
Originally reported by Juanjo Conti at the local Python group.

--
components: Library (Lib)
files: inspect.diff
keywords: patch
messages: 91541
nosy: gagenellina
severity: normal
status: open
title: inspect.getsource() returns incorrect source lines
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file14716/inspect.diff

___
Python tracker 

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



[issue6681] email.parser clips trailing \n of multipart/mixed part if part ends in \r\n

2009-08-13 Thread R. David Murray

R. David Murray  added the comment:

Looks like it is a regular expression issue.  The code is trying to
delete the last linend before the boundary, which belongs to the
boundary according to the RFC, but it does so with the following RE:

(\r\n|\r|\n)$

This RE matches '\r\n' in '\r\n\n', which is what Guido's message had. 
The code then deletes the number of characters equal to the length of
the match.  So yes, it is a mixed line ending problem.

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



[issue5689] please support lzma compression as an extension and in the tarfile module

2009-08-13 Thread Nikolaus Rath

Changes by Nikolaus Rath :


--
nosy: +Nikratio

___
Python tracker 

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



[issue812750] OSA support for properties broken

2009-08-13 Thread Sye van der Veen

Sye van der Veen  added the comment:

I've attached a patch to remove "a replacement is expected for Python 
2.5".

--
keywords: +patch
nosy: +syeberman
status: pending -> open
Added file: http://bugs.python.org/file14715/Issue812750.diff

___
Python tracker 

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



[issue1721083] Add File - Reload

2009-08-13 Thread Guilherme Polo

Guilherme Polo  added the comment:

Kurt, there is now a patch on issue 6699 which adds your suggested feature:

"Adding a warning when saving that the file has changed on disk is a
good emacs feature which has saved my bacon a number of times.  That
would be a good feature to add to IDLE, but that's a different request".

--

___
Python tracker 

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



[issue6699] IDLE: Warn user about overwriting a file that has a newer version on filesystem

2009-08-13 Thread Guilherme Polo

New submission from Guilherme Polo :

Creating this issue to address a suggestion of a new IDLE feature
pointed out on issue 1721083.

The feature in question is about warning the user about a newer version
of the file before overwriting it.

--
components: IDLE
files: check_stmtime.diff
keywords: patch
messages: 91537
nosy: gpolo
severity: normal
status: open
title: IDLE: Warn user about overwriting a file that has a newer version on 
filesystem
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file14714/check_stmtime.diff

___
Python tracker 

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



[issue6698] IDLE no longer opens only an edit window when configured to do so

2009-08-13 Thread Guilherme Polo

New submission from Guilherme Polo :

If someone configure IDLE to start a edit window by default, I believe
it should open only an edit window without starting shell window. This
has been the behaviour in previous version, but it is acting different now.

I looked into r71126 and I think this behaviour was changed there
unintentionally. Its log message doesn't seem to mention this change,
that is why I'm thinking this.

--
components: IDLE
messages: 91536
nosy: gpolo
severity: normal
status: open
title: IDLE no longer opens only an edit window when configured to do so
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



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

2009-08-13 Thread Alex Willmer

Alex Willmer  added the comment:

I've made an installable package of Matthew Barnett's patch. It may get
this to a wider audience. 

http://pypi.python.org/pypi/regex

Next I'll look at incorporating Andrew Kuchling's suggestion of the re
tests from CPython.

--

___
Python tracker 

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



[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-13 Thread R. David Murray

Changes by R. David Murray :


--
stage: test needed -> needs patch

___
Python tracker 

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



[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-13 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


Added file: 
http://bugs.python.org/file14713/invalid_utf8_characters_from_command_line.py

___
Python tracker 

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



[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-13 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


Removed file: 
http://bugs.python.org/file14712/invalid_utf8_characters_from_command_line.py

___
Python tracker 

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



[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-13 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis  added the comment:

I'm attaching crashers/invalid_utf8_characters_from_command_line.py.

--
Added file: 
http://bugs.python.org/file14712/invalid_utf8_characters_from_command_line.py

___
Python tracker 

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



[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-13 Thread R. David Murray

Changes by R. David Murray :


--
components: +Interpreter Core

___
Python tracker 

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



[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-13 Thread R. David Murray

Changes by R. David Murray :


--
priority:  -> high
stage:  -> test needed
type:  -> crash

___
Python tracker 

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



[issue6697] Python 3.1 segfaults when invalid UTF-8 characters are passed from command line

2009-08-13 Thread Arfrever Frehtes Taifersar Arahesis

New submission from Arfrever Frehtes Taifersar Arahesis 
:

Python 3.1 segfaults when invalid UTF-8 characters are passed from
command line.

In BASH shell you can run:
$ python3.1 -c $'print("\x80")'
Segmentation fault

In other POSIX-compatible shells you can save the attached test.py
files in current directory and run:
$ python3.1 -c "$(http://bugs.python.org/file14711/test.py

___
Python tracker 

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



[issue1628205] socket.readline() interface doesn't handle EINTR properly

2009-08-13 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

fixed in trunk r74426.  socket.socket.sendall() and all
socket._fileobject methods (read/readline/write/flush) now properly
handle EINTR internally.

sendall will allow a python signal handler to raise an exception
aborting it in unknown state, otherwise it handles EINTR as it should
and continues sending.

I'm leaving this issue open until it is merged into py3k and considered
for 2.6 and/or 3.1 release backporting.

--

___
Python tracker 

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



[issue3392] subprocess fails in select when descriptors are large

2009-08-13 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

I will retag 3.1.1rc then...

--

___
Python tracker 

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



[issue4015] [patch] make installed scripts executable on windows

2009-08-13 Thread sorin

sorin  added the comment:

I totally agree that we must create batch files for commands but not by
including python code inside them.

--
nosy: +sorin

___
Python tracker 

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



[issue3392] subprocess fails in select when descriptors are large

2009-08-13 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

merged into release31-maint in r74425.

reopen the issue if this doesn't fix the problem.

--
status: open -> closed
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



[issue5150] IDLE to support reindent.py

2009-08-13 Thread Guilherme Polo

Guilherme Polo  added the comment:

This has been closed but why not promote reindent.py to a module and add
an option on IDLE to allow a complete reindent.py run ?

--

___
Python tracker 

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



[issue3158] Doctest fails to find doctests in extension modules

2009-08-13 Thread Alexey Shamrin

Alexey Shamrin  added the comment:

I've added Tim Peters to the nosy list. Is there anyone else who should
be considered as doctest maintainer? I've also checked further Python
versions - a quick a look at latest doctest source shows that the
problem is still there.

There are some details (and a workaround) in Cython FAQ:
http://wiki.cython.org/FAQ#HowcanIrundoctestsinCythoncode.28pyxfiles.29.3F

--
nosy: +ash, tim_one
versions: +Python 2.6, 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



[issue6695] PyXXX_ClearFreeList for dict, set, and list

2009-08-13 Thread Skip Montanaro

Skip Montanaro  added the comment:

Instead of expanding the C API for each type which supports a free
list perhaps there should be a single call, say, PyObject_ClearFreeList,
which takes a pointer to the appropriate type object as an argument.
PyTypeObject can then grow a tp_free_list slot through which the
function calls a type-specific free list clearing function.

Skip

--
nosy: +skip.montanaro

___
Python tracker 

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



[issue3392] subprocess fails in select when descriptors are large

2009-08-13 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

r73916 appears to fix this?

--

___
Python tracker 

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



[issue3392] subprocess fails in select when descriptors are large

2009-08-13 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Unfortunately, this change has broken windows support of the subprocess
module, which now reports, on "import subprocess".

>>> import subprocess
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\loewis\31\python\lib\subprocess.py", line 390, in 
_PIPE_BUF = getattr(select, 'PIPE_BUF', 512)
NameError: name 'select' is not defined

As a consequence, even building Python on Windows now fails, so setting
the priority to "release blocker". One solution would be to move the
"import select" to being top-level.

--
nosy: +benjamin.peterson, loewis
priority: normal -> release blocker

___
Python tracker 

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



[issue6695] PyXXX_ClearFreeList for dict, set, and list

2009-08-13 Thread Matthias Troffaes

Matthias Troffaes  added the comment:

I'm also attaching a test script to check the effect of the two patches
on gc.collect(). If many objects are allocated, space savings appear to
be relevant.



Before applying the patch (debug build on linux 64 bit):

Memory used (begin): 121Mb

memtest 200 int

Memory used (peak): 297Mb
Memory used (end): 122Mb
Unfreed memory: 1Mb

memtest 200 str

Memory used (peak): 455Mb
Memory used (end): 123Mb
Unfreed memory: 2Mb

memtest 200 float

Memory used (peak): 236Mb
Memory used (end): 127Mb
Unfreed memory: 6Mb

memtest 200 int

Memory used (peak): 313Mb
Memory used (end): 123Mb
Unfreed memory: 2Mb

memtest 200 Test

Memory used (peak): 372Mb
Memory used (end): 123Mb
Unfreed memory: 2Mb

memtest 200 Test2

Memory used (peak): 361Mb
Memory used (end): 123Mb
Unfreed memory: 2Mb

memtest 200 _tuple

Memory used (peak): 529Mb
Memory used (end): 123Mb
Unfreed memory: 2Mb

memtest 200 _set

Memory used (peak): 846Mb
Memory used (end): 765Mb
Unfreed memory: 644Mb

memtest 200 _dict

Memory used (peak): 1241Mb
Memory used (end): 1241Mb
Unfreed memory: 1120Mb

memtest 200 Test3

Memory used (peak): 1241Mb
Memory used (end): 765Mb
Unfreed memory: 644Mb
[40720 refs]



After applying the patch (same build system):

Memory used (begin): 121Mb

memtest 200 int

Memory used (peak): 298Mb
Memory used (end): 121Mb
Unfreed memory: 0Mb

memtest 200 str

Memory used (peak): 455Mb
Memory used (end): 123Mb
Unfreed memory: 2Mb

memtest 200 float

Memory used (peak): 236Mb
Memory used (end): 127Mb
Unfreed memory: 6Mb

memtest 200 int

Memory used (peak): 312Mb
Memory used (end): 123Mb
Unfreed memory: 2Mb

memtest 200 Test

Memory used (peak): 374Mb
Memory used (end): 123Mb
Unfreed memory: 2Mb

memtest 200 Test2

Memory used (peak): 361Mb
Memory used (end): 123Mb
Unfreed memory: 2Mb

memtest 200 _tuple

Memory used (peak): 528Mb
Memory used (end): 123Mb
Unfreed memory: 2Mb

memtest 200 _set

Memory used (peak): 846Mb
Memory used (end): 123Mb
Unfreed memory: 2Mb

memtest 200 _dict

Memory used (peak): 1240Mb
Memory used (end): 123Mb
Unfreed memory: 2Mb

memtest 200 Test3

Memory used (peak): 999Mb
Memory used (end): 123Mb
Unfreed memory: 2Mb
[40740 refs]

--
Added file: http://bugs.python.org/file14710/py3k-freelist_test.py

___
Python tracker 

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



[issue6696] Profile objects should be documented

2009-08-13 Thread Alexander Myodov

New submission from Alexander Myodov :

Seems like a minor documentation issue in 2.x became more significant 
one in 3.x.

In Python 2.6 (and lower), the documentation on Profile objects 
discussed them as a part of hotshot module, while omitting the fact 
that any profiler module, either of profile/cProfile/hotshot, supports 
them (though in fact, hotshot Profile objects have an api a bit 
different from profile/cProfile Profile objects). Note http://
docs.python.org/2.6/library/hotshot.html#profile-objects - there is no 
separate documentation of non-hotshot Profile objects, though they are 
largely similar. This is a minor issue which could probably be fixed in 
2.7 as a separate problem - otherwise it is pretty unclear from the 
documentation, what methods do cProfile Profile objects support (eg, 
they support enable()/disable() and runcall() methods, which is pretty 
useful for profiling, but impossible to find in documentation).

In Python 3.1, looks like everything related to hotshot was removed 
from the documents, including the documentation on Profile objects - 
which should not have been. This means, that now the documentation on 
profilers does not cover any Profile classes at all - see http://
docs.python.org/3.1/library/profile.html . For example, the official 
documentation doesn't say any way to profile a function passing 
arguments to it and receiving its result - while profile/cProfile 
Profile objects still do support runcall() method.

--
assignee: georg.brandl
components: Documentation
messages: 91522
nosy: georg.brandl, honeyman
severity: normal
status: open
title: Profile objects should be documented
versions: Python 3.1

___
Python tracker 

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



[issue6695] PyXXX_ClearFreeList for dict, set, and list

2009-08-13 Thread Matthias Troffaes

Matthias Troffaes  added the comment:

I attach a second patch which also calls the new PyXXX_ClearFreeList
functions on garbage collection, during gc.collect().

--
Added file: http://bugs.python.org/file14709/py3k-clearfreelist-gc_collect.patch

___
Python tracker 

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



[issue6695] PyXXX_ClearFreeList for dict, set, and list

2009-08-13 Thread Matthias Troffaes

New submission from Matthias Troffaes :

The Python C API provides PyXXX_ClearFreeList functions to allow the
float, int, etc... freelists to be freed, potentially releasing memory
to the OS earlier. Currently, there is no such API for the dict, set,
and list freelists.

The attached patch adds PyXXX_ClearFreeList functions to the C API, so
the dict, set, and list freelists can be freed as well.

--
components: Interpreter Core
files: py3k-clearfreelist-dict_set_list.patch
keywords: patch
messages: 91520
nosy: matthiastroffaes
severity: normal
status: open
title: PyXXX_ClearFreeList for dict, set, and list
type: behavior
versions: Python 3.2
Added file: 
http://bugs.python.org/file14708/py3k-clearfreelist-dict_set_list.patch

___
Python tracker 

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



[issue6694] itertools documentation still contains references to ifilterfalse and izip_longest

2009-08-13 Thread Georg Brandl

Georg Brandl  added the comment:

Thanks, fixed in r74398.

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

___
Python tracker 

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



[issue6694] itertools documentation still contains references to ifilterfalse and izip_longest

2009-08-13 Thread Alex Morega

New submission from Alex Morega :

The pages http://docs.python.org/dev/py3k/library/itertools.html and 
http://docs.python.org/3.1/library/itertools.html contain the names 
"ifilterfalse" and "izip_longest" in code examples for the "filterfalse" 
and "zip_longest" functions.

--
assignee: georg.brandl
components: Documentation
messages: 91518
nosy: alex.morega, georg.brandl
severity: normal
status: open
title: itertools documentation still contains references to ifilterfalse and 
izip_longest
versions: 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



[issue6693] New functions in site.py to get user/global site packages paths

2009-08-13 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Two things:

 * The globals should get a comment explaining what their purpose is and
where they are being initialized.

 * The get*() functions should only initialize the globals if they are
set to None. In the patch, they are initialized every time the functions
are called.

--
nosy: +lemburg

___
Python tracker 

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



[issue6693] New functions in site.py to get user/global site packages paths

2009-08-13 Thread Tarek Ziadé

New submission from Tarek Ziadé :

As discussed in Distutils-SIG.

Here's a patch for site.py that adds:

- getsitepackages : Returns a list containing all global site-packages
directories (and possibly site-python).

- getusersitepackages: Returns the user-specific site-packages directory
path.

- getuserbase: Returns the `user base` directory path.

--
assignee: tarek
components: Library (Lib)
files: site.patch
keywords: patch
messages: 91516
nosy: tarek
priority: normal
severity: normal
status: open
title: New functions in site.py to get user/global site packages paths
type: feature request
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file14707/site.patch

___
Python tracker 

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



[issue6126] Python 3 pdb: shows internal code, breakpoints don't work

2009-08-13 Thread Georg Brandl

Georg Brandl  added the comment:

Fixed in r74366, and merged back to 3.1 branch in r74367.

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

___
Python tracker 

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



[issue6679] obsolete paragraph in re doc for re.sub

2009-08-13 Thread Georg Brandl

Georg Brandl  added the comment:

Thanks, fixed in r74365.

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

___
Python tracker 

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