[issue5750] weird seg fault

2009-04-14 Thread Peter Lonjers

Peter Lonjers  added the comment:

Hmm I just remembered I was using psyco with this code. With out it.
There is a recursion depth exception not a segfault. Changing the bug to
be in Extension modules. If that is the right place.

--
components: +Extension Modules -Interpreter Core

___
Python tracker 

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



[issue5751] Typo in documentation of print function parameters

2009-04-14 Thread Nicolas Goutte

New submission from Nicolas Goutte :

In http://docs.python.org/library/functions.html#print the print function 
is documented to have a parameter named end with a default 'n'. However 
the default should be '\n' as documented in Python 3 ( 
http://docs.python.org/3.0/library/functions.html#print )

--
assignee: georg.brandl
components: Documentation
messages: 85962
nosy: georg.brandl, nicolasg
severity: normal
status: open
title: Typo in documentation of print function parameters
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



[issue5750] weird seg fault

2009-04-14 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Closing as invalid, for two reasons:
- Psyco is not a supported extension module.
- This problem is already listed in Psyco's Known Bugs:
http://psyco.sourceforge.net/psycoguide/bugs.html

--
nosy: +amaury.forgeotdarc
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



[issue5752] xml.dom.minidom does not handle newline characters in attribute values

2009-04-14 Thread Tomalak

New submission from Tomalak :

Current behavior upon toxml() is:



Upon reading the document again, the new line is normalized and
collapsed into a space (according to the XML spec, section 3.3.3), which
means that it is lost.

Better behavior would be something like this (within attribute values only):



--
components: XML
messages: 85964
nosy: Tomalak
severity: normal
status: open
title: xml.dom.minidom does not handle newline characters in attribute values
versions: Python 2.4, Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1

___
Python tracker 

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



[issue5752] xml.dom.minidom does not handle newline characters in attribute values

2009-04-14 Thread Tomalak

Changes by Tomalak :


--
type:  -> behavior

___
Python tracker 

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



[issue5753] CVE-2008-5983 python: untrusted python modules search path

2009-04-14 Thread Jan Lieskovsky

New submission from Jan Lieskovsky :

Common Vulnerabilities and Exposures assigned an identifier
CVE-2008-5983 (and related CVE ids) to the following vulnerability:

Untrusted search path vulnerability in the PySys_SetArgv API function in
Python 2.6 and earlier, and possibly later versions, prepends an empty
string to sys.path when the argv[0] argument does not contain a path
separator, which might allow local users to execute arbitrary code via a
Trojan horse Python file in the current working directory. 

References:
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5983
https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2008-5983
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5984
https://bugzilla.redhat.com/show_bug.cgi?id=481551
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5985
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5986
https://bugzilla.redhat.com/show_bug.cgi?id=481550
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5987
https://bugzilla.redhat.com/show_bug.cgi?id=481553
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-0314
http://bugzilla.gnome.org/show_bug.cgi?id=569214
https://bugzilla.redhat.com/show_bug.cgi?id=481556
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-0315 
https://bugzilla.redhat.com/show_bug.cgi?id=481560
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-0316
https://bugzilla.redhat.com/show_bug.cgi?id=481565
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-0317
https://bugzilla.redhat.com/show_bug.cgi?id=481570
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-0318
https://bugzilla.redhat.com/show_bug.cgi?id=481572

--
components: Interpreter Core
files: python-CVE-2009-5983.patch
keywords: patch
messages: 85965
nosy: iankko
severity: normal
status: open
title: CVE-2008-5983 python: untrusted python modules search path
type: security
versions: Python 3.1
Added file: http://bugs.python.org/file13685/python-CVE-2009-5983.patch

___
Python tracker 

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



[issue5753] CVE-2008-5983 python: untrusted python modules search path

2009-04-14 Thread Jan Lieskovsky

Jan Lieskovsky  added the comment:

To sum up the behavior, the following table displays whether
modules are read from the current working directory for various
ways how the python scripts can be launched (unfixed/fixed version):

unfixed   fixed   run as
~~~
yes   no  python test.py
yes   no  python ./test.py
yes   no  python /tmp/396/test.py
yes   no  /bin/env python test.py

yes   yes test.py
yes   yes ./test.py
yes   yes /tmp/396/test.py
yes   yes /usr/bin/python test.py
yes   yes /usr/bin/python ./test.py
yes   yes /usr/bin/python /tmp/396/test.py

nono  test-in-different-dir.py
nono  ./bin/test-in-different-dir.py
nono  python ./bin/test-in-different-dir.py

--

___
Python tracker 

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



[issue5753] CVE-2008-5983 python: untrusted python modules search path

2009-04-14 Thread Jan Lieskovsky

Jan Lieskovsky  added the comment:

As no longer work of "python ./foo.py" after patch utilization may
cause, the update won't be acceptable, could you guys review the
above patch and potentially provide an another one?

--

___
Python tracker 

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



[issue1006238] cross compile patch

2009-04-14 Thread Thomas Heller

Changes by Thomas Heller :


--
nosy: +theller

___
Python tracker 

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



[issue5753] CVE-2008-5983 python: untrusted python modules search path

2009-04-14 Thread Petr Splichal

Changes by Petr Splichal :


--
nosy: +psss

___
Python tracker 

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



[issue5753] CVE-2008-5983 python: untrusted python modules search path

2009-04-14 Thread Jan Lieskovsky

Jan Lieskovsky  added the comment:

Just drop into /tmp and run (you will need the zenity package installed):

python3.1 ./test.py 

or

gedit# unfixed gedit

in that directory.

--
Added file: http://bugs.python.org/file13686/py_umspath_test.tar.gz

___
Python tracker 

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



[issue2588] PyOS_vsnprintf() underflow leads to memory corruption

2009-04-14 Thread Petr Splichal

Petr Splichal  added the comment:

Justin, is there any reproducer available for this issue?
Thanks!

--
nosy: +psss

___
Python tracker 

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



[issue2587] PyString_FromStringAndSize() to be considered unsafe

2009-04-14 Thread Petr Splichal

Petr Splichal  added the comment:

Justin, is there any reproducer available for this issue?
Thanks!

--
nosy: +psss

___
Python tracker 

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



[issue5754] Shelve module writeback parameter does not act as advertised

2009-04-14 Thread Jorge Herskovic

New submission from Jorge Herskovic :

The shelve module documentation states that "by default, mutations to
persistent-dictionary mutable entries are not automatically written
back. If the optional writeback parameter is set to True, all entries
accessed are cached in memory, and written back at close time..."
however the implementation's __setitem__ is the following:
def __setitem__(self, key, value):
if self.writeback:
self.cache[key] = value
f = StringIO()
p = Pickler(f, self._protocol)
p.dump(value)
self.dict[key] = f.getvalue()

which maintains the cache correctly but writes back to the disk on every
operation, violating the writeback documentation. Changing it to 
def __setitem__(self, key, value):
if self.writeback:
self.cache[key] = value
else:
f = StringIO()
p = Pickler(f, self._protocol)
p.dump(value)
self.dict[key] = f.getvalue()

seems to match the documentation's intent.

(First report, sorry for any formatting/style issues!)

--
components: Extension Modules
messages: 85971
nosy: jherskovic
severity: normal
status: open
title: Shelve module writeback parameter does not act as advertised
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



[issue5755] "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++"

2009-04-14 Thread Zooko O'Whielacronx

New submission from Zooko O'Whielacronx :

A user of the Tahoe-LAFS project submitted a bug report to us, saying:

"""
I get lots of "cc1plus: warning: command line option "-Wstrict-
prototypes" is valid for Ada/C/ObjC but not for C++" when compiling
"""

A little googling shows that this gets reported frequently to other 
Python projects that have C++ code:

http://trac.sagemath.org/sage_trac/ticket/425
http://www.mail-archive.com/matplotlib-
us...@lists.sourceforge.net/msg03947.html

Those other projects seem to think that this is distutils's problem, but 
I don't see evidence that any of them opened a ticket for distutils yet.

--
assignee: tarek
components: Distutils
messages: 85972
nosy: tarek, zooko
severity: normal
status: open
title: "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++"

___
Python tracker 

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



[issue5154] OSX broken poll testing doesn't work

2009-04-14 Thread Nicolas Dumazet

Changes by Nicolas Dumazet :


--
nosy: +nicdumz

___
Python tracker 

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



[issue5756] idle pydoc et al removed from 3.1 without versioned replacements

2009-04-14 Thread Ned Deily

New submission from Ned Deily :

RELEASE BLOCKER

r71400 and r71401 changed py3k setup.py to comment out the installation 
of the scripts for pydoc, idle, 2to5, and smtpd.py.  This was in 
response to issue1590 noting that python3 should not overwrite python2 
versions of the scripts.  However, unless I'm missing something, this 
now means that *no* versions of these scripts are ever installed for 
python3; that's not a solution.  (Note, this breaks Mac installer builds 
and probably breaks downstream unix packages as well.)

As hinted at in issue1590, the most consistent option would be to 
install each of the scripts with a version number as is done with python 
itself.

Whatever solution is chosen, some additional work will likely be needed 
in the Mac Makefile to do the right thing in the framework bin directory 
and in the Mac BuildScript/build-installer.py for the /usr/local/bin 
links. No idea about the effects on other platform builds.

This also seems to be a change worthy of a NEWS item and doc changes.

--
components: Build
messages: 85973
nosy: nad
severity: normal
status: open
title: idle pydoc et al removed from 3.1 without versioned replacements
type: behavior
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



[issue5756] idle pydoc et al removed from 3.1 without versioned replacements

2009-04-14 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +benjamin.peterson, ronaldoussoren

___
Python tracker 

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



[issue1590] "make altinstall" installs pydoc, idle, smtpd.py

2009-04-14 Thread Ned Deily

Ned Deily  added the comment:

r71400 breaks installer builds.  See issue5756.

--
nosy: +nad

___
Python tracker 

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



[issue5735] Segfault when loading not recompiled module

2009-04-14 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Normally, modules compiled with incompatible settings should generate a 
link-time error (like: Undefined symbol PyModule_Create).
This used to work with 2.x, but a typo in a macro broke this for 3.x.

Patch attached.

--
keywords: +needs review, patch
nosy: +amaury.forgeotdarc
Added file: http://bugs.python.org/file13687/module_create.patch

___
Python tracker 

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



[issue5756] idle pydoc et al removed from 3.1 without versioned replacements

2009-04-14 Thread David Ripton

David Ripton  added the comment:

issue1590 was only supposed to fix "make altinstall", which is a
secondary install target intended specifically to not break the primary
Python on a system.  I agree with Ned that if it changed the behavior of
"make install" then the change was broken.

--
nosy: +dripton

___
Python tracker 

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



[issue5754] Shelve module writeback parameter does not act as advertised

2009-04-14 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> aleax
nosy: +aleax

___
Python tracker 

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



[issue5757] Documentation error for Condition.notify()

2009-04-14 Thread Piet van Oostrum

New submission from Piet van Oostrum :

The documentation for Condition.notify() in module threading (Library
Reference) contains an error:
The second sentence (Wait until notified or until a timeout occurs.)
shouldn't be there. Apparently it was copied and pasted from wait().

--
assignee: georg.brandl
components: Documentation
messages: 85977
nosy: georg.brandl, pietvo
severity: normal
status: open
title: Documentation error for Condition.notify()
versions: Python 2.6, Python 3.0

___
Python tracker 

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



[issue5758] fileinput.hook_compressed returning bytes from gz file

2009-04-14 Thread Michael Newman

New submission from Michael Newman :

The attached ZIP file contains "test.bat" which runs "test.py" with
Python 2.6 and Python 3.0.

Python 2.6 behaves as expected (see "py26.out"), since it returns
strings from both "mike.txt" and "mike.txt.gz". However, the same test
with Python 3.0 returns bytes from "mike.txt.gz", as shown in "py30.out":
Output: Hello from Mike.
Output: This is the second line.
Output: Why did the robot cross the road?
Output: b'Hello from Mike.'
Output: b'This is the second line.'
Output: b'Why did the robot cross the road?'

For reference, I tested this on Python versions:
Python 2.6.1 (r261:67517, Dec  4 2008, 16:51:00) [MSC v.1500 32 bit
(Intel)] on win32
Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit
(Intel)] on win32

--
components: Library (Lib)
files: example.zip
messages: 85978
nosy: mnewman
severity: normal
status: open
title: fileinput.hook_compressed returning bytes from gz file
type: behavior
versions: Python 3.0
Added file: http://bugs.python.org/file13688/example.zip

___
Python tracker 

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



[issue5759] Do not call __float__ to classec derived from str

2009-04-14 Thread Alexandr Zamaraev

New submission from Alexandr Zamaraev :

Test case:
[code]
class S:
def __init__(self, v):
self.data = v

def __int__(self):
print("S.INT called")
return int(str(self.data))
def __float__(self):
print("S.FLOAT called")
return float(str(self.data))


class T(str):
def __int__(self):
print("T.INT called")
return int(str(self))
def __float__(self):
print("T.FLOAT called")
return float(str(self))

class U(unicode):
def __int__(self):
print("U.INT called")
return int(unicode(self))
def __float__(self):
print("U.FLOAT called")
return float(unicode(self))


i = S("123")
print(type(int(i)))
print(type(float(i)))

i = T("123")
print(type(int(i)))
print(type(float(i))) # <<< CALLS __float__ NOTHING

i = U("123")
print(type(int(i)))
print(type(float(i)))
[/code]
Output:
[code]
S.INT called

S.FLOAT called

T.INT called


U.INT called

U.FLOAT called

[/code]

--
components: None
messages: 85979
nosy: shura_zam
severity: normal
status: open
title: Do not call __float__ to classec derived from str
versions: Python 2.5

___
Python tracker 

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



[issue5735] Segfault when loading not recompiled module

2009-04-14 Thread Leonid Vasilev

Leonid Vasilev  added the comment:

Thanks for patch, it works now:

Python compiled with --with-pydebug throws an ImportError when trying to
import modules compiled without --with-pydebug, as it should:

ImportError: /usr/local/lib/python3.0/site-packages/ext23.so: undefined
symbol: PyModule_Create2

--

___
Python tracker 

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



[issue4291] Allow Division of datetime.timedelta Objects

2009-04-14 Thread Jeremy Banks

Jeremy Banks  added the comment:

Redundant with #2706 and others.

--
nosy:  -belopolsky, haypo, marketdickinson
status: open -> closed

___
Python tracker 

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



[issue5760] __getitem__ error message hard to understand

2009-04-14 Thread Chris Rebert

New submission from Chris Rebert :

Prompted by
http://mail.python.org/pipermail/python-ideas/2009-April/004048.html

The current error message issued when trying to use the get item ([])
operator on an object that does not define __getitem__ can be hard to
understand:

>>> class A(object): pass
...
>>> A()['a']
Traceback (most recent call last):
  File "", line 1, in 
TypeError: 'A' object is unsubscriptable

Problems observed:
- "unsubscriptable" is easily misread in haste as "unscriptable", which
can be quite confusing, especially to newbies
- "subscripting" is not frequently used to describe the [] operator,
making the message more difficult to decipher (again, esp. for newbies)
- the underlying lack of a __getitem__ method is not mentioned, thus not
making it obvious how to remedy the error

Suggestion:
Use exception chaining and rephrase the error message to get something like:

AttributeError: class 'A' has no attribute '__getitem__'
The above exception was the direct cause of the following exception:
TypeError: 'A' object does not support the 'get item' operator

Similar changes should be made to __setitem__ & __delitem__.

--
components: Interpreter Core
messages: 85983
nosy: cvrebert
severity: normal
status: open
title: __getitem__ error message hard to understand
type: behavior
versions: Python 2.7, Python 3.0, Python 3.1

___
Python tracker 

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