[issue1621] Python should compile with -Wstrict-overflow when using gcc

2007-12-13 Thread Martin v. Löwis

Martin v. Löwis added the comment:

Using ansi is out of scope of this issue, and should not be mixed with
it. -ansi is about disabling certain GCC extensions. This report is
about C code in Python which has undefined behavior.

I think there is disagreement on whether Python should stop relying on
this particular undefined behavior (namely, whether the sum of two large
positive numbers is negative). GvR (apparently) believes that the
compiler should guarantee that the twos-complement semantic is available
throughout the C language.

--
nosy: +loewis

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Thomas Heller

Thomas Heller added the comment:

Guido van Rossum schrieb:
> (Thomas, could you run it in the 2.5 branch as well?  I seem to have
> checked in a lot of gratuitous changes by using an older version of
> autoconf.)

Done, see rev 59494.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1618] locale.strxfrm can't handle non-ascii strings

2007-12-13 Thread Martin v. Löwis

Martin v. Löwis added the comment:

It operates on char*, not Unicode strings.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1623] Implement PEP-3141 for Decimal

2007-12-13 Thread Jeffrey Yasskin

New submission from Jeffrey Yasskin:

I added __round__, __ceil__, __floor__, and __trunc__

--
components: Library (Lib)
files: decimal_3141.patch
messages: 58614
nosy: jyasskin
severity: normal
status: open
title: Implement PEP-3141 for Decimal
type: behavior
versions: Python 3.0
Added file: http://bugs.python.org/file8951/decimal_3141.patch

__
Tracker <[EMAIL PROTECTED]>

__

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



[issue1469] SSL tests leak memory

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

I spoke too soon. In a debug build, this hangs forever during the
second iteration:

./python.exe Lib/test/regrtest.py -uall -R1:1 test_ssl

Adding -v, it looks like two iterations are carried out perfectly (one
must be a trial run, one the warm-up run), but the third run goes
beserk; the output ends like this:

testAsyncoreServer (test.test_ssl.ThreadedTests) ...
 server:  read b'over\n' from client
 server:  closed connection 
 server:  read b'' from client
 server:  closed connection 
 server:  read b'' from client
 server:  closed connection 
.
. (the last two lines repeated forever)
.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1469] SSL tests leak memory

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

> Good catch.  I flipped a bit cleaning up the C code.
>
> Here's a fixed patch.
>
> Added file: http://bugs.python.org/file8949/patch-3

Great! Go ahead and check it in. Sorry for deleting the _real_close()
earlier BTW.

Enjoy your time away!

__
Tracker <[EMAIL PROTECTED]>

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



[issue1621] Python should compile with -Wstrict-overflow when using gcc

2007-12-13 Thread Christian Heimes

Christian Heimes added the comment:

Socket and SSL are using bluetooth.h which defines some functionas as
inline. Inline isn't part of C89. Linuxaudiodev depends on the 'linux'
macro which is not defined in  C89.

The Python core can be compiled with -ansi but the extension modules
require -std=gnu89.

Added file: http://bugs.python.org/file8950/config.patch

__
Tracker <[EMAIL PROTECTED]>

__Index: configure
===
--- configure	(Revision 59488)
+++ configure	(Arbeitskopie)
@@ -4427,25 +4427,29 @@
 then
 case $GCC in
 yes)
-if test "$CC" != 'g++' ; then
+	if test "$CC" != 'g++' ; then
 	STRICT_PROTO="-Wstrict-prototypes"
 	fi
-# For gcc 4.x we need to use -fwrapv so lets check if its supported
-if "$CC" -v --help 2>/dev/null |grep -- -fwrapv > /dev/null; then
-   WRAP="-fwrapv"
-fi
+	# For gcc 4.x we need to use -fwrapv so lets check if its supported
+	if "$CC" -v --help 2>/dev/null |grep -- -fwrapv > /dev/null; then
+		WRAP="-fwrapv"
+	fi
+	# For gcc 4.x we use -Wstrict-overflow for extra warnings
+	if "$CC" -v --help 2>/dev/null |grep -- -Wstrict-overflow > /dev/null; then
+		STRICT_OVERFLOW="-Wstrict-overflow"
+	fi
 	case $ac_cv_prog_cc_g in
 	yes)
 	if test "$Py_DEBUG" = 'true' ; then
 		# Optimization messes up debuggers, so turn it off for
 		# debug builds.
-		OPT="-g -Wall $STRICT_PROTO"
+		OPT="-std=gnu89 -g -Wall -Werror $STRICT_PROTO $STRICT_OVERFLOW"
 	else
-		OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
+		OPT="-std=gnu89 -g $WRAP -O3 -Wall -Werror $STRICT_PROTO $STRICT_OVERFLOW"
 	fi
 	;;
 	*)
-	OPT="-O3 -Wall $STRICT_PROTO"
+	OPT="-O3 -Wall -Werror $STRICT_PROTO"
 	;;
 	esac
 	case $ac_sys_system in
Index: configure.in
===
--- configure.in	(Revision 59488)
+++ configure.in	(Arbeitskopie)
@@ -754,25 +754,29 @@
 then
 case $GCC in
 yes)
-if test "$CC" != 'g++' ; then
+	if test "$CC" != 'g++' ; then
 	STRICT_PROTO="-Wstrict-prototypes"
 	fi
-# For gcc 4.x we need to use -fwrapv so lets check if its supported
-if "$CC" -v --help 2>/dev/null |grep -- -fwrapv > /dev/null; then
-   WRAP="-fwrapv"
-fi
+	# For gcc 4.x we need to use -fwrapv so lets check if its supported
+	if "$CC" -v --help 2>/dev/null |grep -- -fwrapv > /dev/null; then
+		WRAP="-fwrapv"
+	fi
+	# For gcc 4.x we use -Wstrict-overflow for extra warnings
+	if "$CC" -v --help 2>/dev/null |grep -- -Wstrict-overflow > /dev/null; then
+		STRICT_OVERFLOW="-Wstrict-overflow"
+	fi
 	case $ac_cv_prog_cc_g in
 	yes)
 	if test "$Py_DEBUG" = 'true' ; then
 		# Optimization messes up debuggers, so turn it off for
 		# debug builds.
-		OPT="-g -Wall $STRICT_PROTO"
+		OPT="-std=gnu89 -g -Wall -Werror $STRICT_PROTO $STRICT_OVERFLOW"
 	else
-		OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
+		OPT="-std=gnu89 -g $WRAP -O3 -Wall -Werror $STRICT_PROTO $STRICT_OVERFLOW"
 	fi
 	;;
 	*)
-	OPT="-O3 -Wall $STRICT_PROTO"
+	OPT="-O3 -Wall -Werror $STRICT_PROTO"
 	;;
 	esac
 	case $ac_sys_system in
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1621] Python should compile with -Wstrict-overflow when using gcc

2007-12-13 Thread Christian Heimes

Christian Heimes added the comment:

Should we use -ansi (C90 aka C89 standard) option, too? Python core
compiles fine with -ansi but together with -Werror it breaks several
extensions:

_bsddb_codecs_iso2022   _ctypes
_socket   _ssl  linuxaudiodev

__
Tracker <[EMAIL PROTECTED]>

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



[issue1621] Python should compile with -Wstrict-overflow when using gcc

2007-12-13 Thread Christian Heimes

Christian Heimes added the comment:

My gcc 4.1 doesn't have the -Wstrict-overflow option.

gcc-Version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)

--
nosy: +tiran

__
Tracker <[EMAIL PROTECTED]>

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



[issue1469] SSL tests leak memory

2007-12-13 Thread Bill Janssen

Changes by Bill Janssen:


Removed file: http://bugs.python.org/file8922/patch-2

__
Tracker <[EMAIL PROTECTED]>

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



[issue1469] SSL tests leak memory

2007-12-13 Thread Bill Janssen

Bill Janssen added the comment:

Good catch.  I flipped a bit cleaning up the C code.

Here's a fixed patch.

Added file: http://bugs.python.org/file8949/patch-3

__
Tracker <[EMAIL PROTECTED]>

__

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



[issue1620] New @spam.getter property syntax modifies the property in place

2007-12-13 Thread Christian Heimes

Christian Heimes added the comment:

Fixed in r59488

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

__
Tracker <[EMAIL PROTECTED]>

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



[issue1622] zipfile hangs on certain zip files

2007-12-13 Thread Guido van Rossum

Changes by Guido van Rossum:


--
keywords: +patch
nosy: +gvanrossum

__
Tracker <[EMAIL PROTECTED]>

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



[issue1622] zipfile hangs on certain zip files

2007-12-13 Thread Eric Huss

New submission from Eric Huss:

Creating a ZipFile object with a certain type of zip file can cause it
to go into an infinite loop.  The problem is the new extra field parsing
routine.  It unpacks integers as a signed value, which if they are
sufficiently large (over 32767), then it will loop forever.

There are many places in the zipfile module that incorrectly unpack
values as signed integers, but this is the only place that I can
determine that causes a serious problem.

Attached is a fix.

--
components: Library (Lib)
files: zipfile.patch
messages: 58606
nosy: ehuss
severity: normal
status: open
title: zipfile hangs on certain zip files
type: behavior
versions: Python 2.5, Python 2.6
Added file: http://bugs.python.org/file8948/zipfile.patch

__
Tracker <[EMAIL PROTECTED]>

__

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



[issue1607] Patch for TCL 8.5 support

2007-12-13 Thread Kurt B. Kaiser

Kurt B. Kaiser added the comment:

But indices are supposed to be strings according to the Tk 
documentation, and with 8.4 the Tkinter indices are strings.  Since 
most of the Tkinter 'documentation' is actually the Tcl/Tk man pages, 
it would be quite confusing to users if Tkinter diverged from Tcl/Tk 
in this regard.  I don't see any change from string in the Tk 8.5 
Text man page.

Second, is there a plan to switch to 8.5 for py3k?  If so, please 
post a link so I can catch up!  (I'm in favor of switching to 8.5, 
btw.)

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

> """code that has been audited and fixed in the past will again be
> vulnerable."""
>
> That code wasn't properly audited or fixed if it depended on integer
> overflow behavior.

Whatever, this is how overflow checks have been coded all over the code base.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Gregory P. Smith

Gregory P. Smith added the comment:

"""code that has been audited and fixed in the past will again be
vulnerable."""

That code wasn't properly audited or fixed if it depended on integer
overflow behavior.

Anyways, I'm glad we have the flag to disable the optimization on gcc in
the meantime.

We should open a bug regarding fixing all of pythons integer overflows.
 gcc is only one compiler.  Other compilers are free to behave in
exactly the same manner.

I've opened http://bugs.python.org/issue1621 to track the larger code fix.

--
nosy: +gregory.p.smith

__
Tracker <[EMAIL PROTECTED]>

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



[issue1621] Python should compile with -Wstrict-overflow when using gcc

2007-12-13 Thread Gregory P. Smith

New submission from Gregory P. Smith:

The resolution to http://bugs.python.org/issue1608 looks like it'll add
a -fwrapv gcc flag when building python.  This works around the issue
nicely on one compiler (gcc) but doesn't fix our fundamentally broken code.

We should fix all dependencies on integer overflow behavior, starting by
making everything compile properly with gcc's -Wstrict-overflow and
-Werror flags.

--
messages: 58602
nosy: gregory.p.smith
severity: normal
status: open
title: Python should compile with -Wstrict-overflow when using gcc
type: security
versions: Python 2.5, Python 2.6, Python 3.0

__
Tracker <[EMAIL PROTECTED]>

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



[issue1333] merge urllib and urlparse functionality

2007-12-13 Thread Brett Cannon

Brett Cannon added the comment:

Yes, the modules should probably all get merged somehow.  But discussing
it in the web-sig is fine with me and I am happy to look at what the
web-sig ends up recommending.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1333] merge urllib and urlparse functionality

2007-12-13 Thread Christian Heimes

Christian Heimes added the comment:

Please contact Brett Cannon. He organized the stdlib cleanup.

--
assignee:  -> brett.cannon
nosy: +brett.cannon, tiran

__
Tracker <[EMAIL PROTECTED]>

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



[issue1618] locale.strxfrm can't handle non-ascii strings

2007-12-13 Thread Christian Heimes

Christian Heimes added the comment:

What's wrong with the locale module?

--
nosy: +tiran

__
Tracker <[EMAIL PROTECTED]>

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



[issue1620] New @spam.getter property syntax modifies the property in place

2007-12-13 Thread Christian Heimes

New submission from Christian Heimes:

As reported by Duncan Booth at
http://permalink.gmane.org/gmane.comp.python.general/551183 the new
@spam.getter syntax modifies the property in place but it should create
a new one.

The patch is the first draft of a fix. I've to write unit tests to
verify the patch. It copies the property and as a bonus grabs the
__doc__ string from the getter if the doc string initially came from the
getter as well.

--
assignee: tiran
components: Interpreter Core
files: py3k_copy_property.patch
keywords: patch, py3k
messages: 58598
nosy: gvanrossum, tiran
priority: high
severity: normal
status: open
title: New @spam.getter property syntax modifies the property in place
versions: Python 2.6, Python 3.0
Added file: http://bugs.python.org/file8947/py3k_copy_property.patch

__
Tracker <[EMAIL PROTECTED]>

__Index: Objects/descrobject.c
===
--- Objects/descrobject.c	(revision 59478)
+++ Objects/descrobject.c	(working copy)
@@ -1065,8 +1065,12 @@
 	PyObject *prop_set;
 	PyObject *prop_del;
 	PyObject *prop_doc;
+	int getter_doc;
 } propertyobject;
 
+static PyObject * PyProperty_Copy(PyObject *, PyObject *, PyObject *,
+  PyObject *, PyObject *);
+
 static PyMemberDef property_members[] = {
 	{"fget", T_OBJECT, offsetof(propertyobject, prop_get), READONLY},
 	{"fset", T_OBJECT, offsetof(propertyobject, prop_set), READONLY},
@@ -1075,53 +1079,37 @@
 	{0}
 };
 
+
 PyDoc_STRVAR(getter_doc,
 	 "Descriptor to change the getter on a property.");
 
 PyObject *
 property_getter(PyObject *self, PyObject *getter)
 {
-	Py_XDECREF(((propertyobject *)self)->prop_get);
-	if (getter == Py_None)
-		getter = NULL;
-	Py_XINCREF(getter);
-	((propertyobject *)self)->prop_get = getter;
-	Py_INCREF(self);
-	return self;
+	return PyProperty_Copy(self, getter, NULL, NULL, NULL);
 }
 
+
 PyDoc_STRVAR(setter_doc,
-	 "Descriptor to change the setter on a property.\n");
+	 "Descriptor to change the setter on a property.");
 
 PyObject *
 property_setter(PyObject *self, PyObject *setter)
 {
-	Py_XDECREF(((propertyobject *)self)->prop_set);
-	if (setter == Py_None)
-		setter = NULL;
-	Py_XINCREF(setter);
-	((propertyobject *)self)->prop_set = setter;
-	Py_INCREF(self);
-	return self;
+	return PyProperty_Copy(self, NULL, setter, NULL, NULL);
 }
 
+
 PyDoc_STRVAR(deleter_doc,
 	 "Descriptor to change the deleter on a property.");
 
 PyObject *
 property_deleter(PyObject *self, PyObject *deleter)
 {
-	Py_XDECREF(((propertyobject *)self)->prop_del);
-	if (deleter == Py_None)
-		deleter = NULL;
-	Py_XINCREF(deleter);
-	((propertyobject *)self)->prop_del = deleter;
-	Py_INCREF(self);
-	return self;
+	return PyProperty_Copy(self, NULL, NULL, deleter, NULL);
 }
 
 
-
 static PyMethodDef property_methods[] = {
 	{"getter", property_getter, METH_O, getter_doc},
 	{"setter", property_setter, METH_O, setter_doc},
@@ -1186,15 +1174,62 @@
 	return 0;
 }
 
+static PyObject *
+PyProperty_Copy(PyObject *old, PyObject *get, PyObject *set, PyObject *del,
+		PyObject *doc)
+{
+	propertyobject *pold = (propertyobject *)old;
+	propertyobject *pnew = NULL;
+	PyObject *new, *type;
+
+	type = PyObject_Type(old);
+	if (type == NULL)
+		return NULL;
+
+	if (get == NULL || get == Py_None) {
+		Py_XDECREF(get);
+		get = pold->prop_get ? pold->prop_get : Py_None;
+	}
+	if (set == NULL || set == Py_None) {
+		Py_XDECREF(set);
+		set = pold->prop_set ? pold->prop_set : Py_None;
+	}
+	if (del == NULL || del == Py_None) {
+		Py_XDECREF(del);
+		del = pold->prop_del ? pold->prop_del : Py_None;
+	}
+	if (doc == NULL || doc == Py_None) {
+		Py_XDECREF(doc);
+		doc = pold->prop_doc ? pold->prop_doc : Py_None;
+	}
+	
+	new =  PyObject_CallFunction(type, "", get, set, del, doc);
+	if (new == NULL)
+		return NULL;
+	pnew = (propertyobject *)new;
+	
+	if (pold->getter_doc && get != Py_None) {
+		PyObject *get_doc = PyObject_GetAttrString(get, "__doc__");
+		if (get_doc != NULL) {
+			Py_XDECREF(pnew->prop_doc);
+			pnew->prop_doc = get_doc;  /* get_doc already INCREF'd by GetAttr */
+			pnew->getter_doc = 1;
+		} else {
+			PyErr_Clear();
+		}
+	}
+	return new;
+}
+
 static int
 property_init(PyObject *self, PyObject *args, PyObject *kwds)
 {
 	PyObject *get = NULL, *set = NULL, *del = NULL, *doc = NULL;
 	static char *kwlist[] = {"fget", "fset", "fdel", "doc", 0};
-	propertyobject *gs = (propertyobject *)self;
-
+	propertyobject *prop = (propertyobject *)self;
+	
 	if (!PyArg_ParseTupleAndKeywords(args, kwds, "|:property",
-	  kwlist, &get, &set, &del, &doc))
+	 kwlist, &get, &set, &del, &doc))
 		return -1;
 
 	if (get == Py_None)
@@ -1209,22 +1244,24 @@
 	Py_XINCREF(del);
 	Py_XINCREF(doc);
 
+	prop->prop_get = get;
+	prop->prop_set = set;
+	prop->prop_del = del;
+	prop->prop_doc = doc;
+	prop->getter_doc = 0;
+
 	/* if no docstring given and the g

[issue1608] test_str.py crashes

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

Thomas Heller ran autoconf for the trunk and submitted as r59485.

(Thomas, could you run it in the 2.5 branch as well?  I seem to have
checked in a lot of gratuitous changes by using an older version of
autoconf.)

--
nosy: +theller
resolution:  -> fixed
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

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



[issue1619] Test

2007-12-13 Thread Martin v. Löwis

Changes by Martin v. Löwis:


--
resolution:  -> invalid
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

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



[issue1619] Test

2007-12-13 Thread Martin v. Löwis

Changes by Martin v. Löwis:


--
nosy: loewis
severity: normal
status: open
title: Test

__
Tracker <[EMAIL PROTECTED]>

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



[issue1618] locale.strxfrm can't handle non-ascii strings

2007-12-13 Thread Martin v. Löwis

Martin v. Löwis added the comment:

locale.strxfrm needs to be removed in Python 3, probably along with the
entire locale module. We can't support it anymore.

--
nosy: +loewis

__
Tracker <[EMAIL PROTECTED]>

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



[issue1617] Rare exception in test_urllib2net

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

Can you log in to the box and reproduce it manually?

On Dec 13, 2007 1:49 PM, Neal Norwitz <[EMAIL PROTECTED]> wrote:
>
> Neal Norwitz added the comment:
>
> This may happen every time on the MIPS buildbot.  Here is a recent run.
>
> http://www.python.org/dev/buildbot/all/MIPS%20Debian%20trunk/builds/190/step-test/0
>
> My guess is that there is some exception happening in C code and that
> propagates back up to the error we see.  I could never find the root
> cause when I tried to trace I down though.
>
> --
> nosy: +nnorwitz
>
>
> __
> Tracker <[EMAIL PROTECTED]>
> 
> __
>

__
Tracker <[EMAIL PROTECTED]>

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



[issue1606] Doc: subprocess wait() may lead to dead lock

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

> I believe so, too. The subprocess docs aren't warning about the problem.
> I've seen a fair share of programmers who fall for the trap - including
> me a few weeks ago.

Yes, the docs should definitely address this.

> Consider yet another example
>
> >>> p = Popen(someprogram, stdin=PIPE, stdout=PIPE)
> >>> p.stdin.write(10MB of data)
>
> someprogram processes the incoming data in small blocks. Let's say 1KB
> and 1MB stdin and stdout buffer. It reads 1KB from stdin and writes 1KB
> to stdout until the stdout buffer is full. The program stops and waits
> for for Python to free the stdout buffer. However the python code is
> still writing data to the limited stdin buffer.

Hm. I thought this would be handled using threads or select but it
doesn't seem to be quite the case. communicate() does the right thing
but if you use p.stdin.write() directly you may indeed hang.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1617] Rare exception in test_urllib2net

2007-12-13 Thread Neal Norwitz

Neal Norwitz added the comment:

This may happen every time on the MIPS buildbot.  Here is a recent run.

http://www.python.org/dev/buildbot/all/MIPS%20Debian%20trunk/builds/190/step-test/0

My guess is that there is some exception happening in C code and that
propagates back up to the error we see.  I could never find the root
cause when I tried to trace I down though.

--
nosy: +nnorwitz

__
Tracker <[EMAIL PROTECTED]>

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



[issue1618] locale.strxfrm can't handle non-ascii strings

2007-12-13 Thread Filip Salomonsson

New submission from Filip Salomonsson:

locale.strxfrm currently does not handle non-ascii strings:

$ ./python
Python 3.0a2 (py3k:59482, Dec 13 2007, 21:27:14) 
[GCC 4.1.2 20070626 (Red Hat 4.1.2-14)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.setlocale(locale.LC_COLLATE, "en_US.utf8")
'en_US.utf8'
>>> locale.strxfrm("a")
'\x0c\x01\x08\x01\x02'
>>> locale.strxfrm("\N{LATIN SMALL LETTER A WITH DIAERESIS}")
Traceback (most recent call last):
  File "", line 1, in 
TypeError: strxfrm() argument 1 must be string without null bytes, not str

The attached patch tries to fix this:

$ ./python
Python 3.0a2 (py3k:59482M, Dec 13 2007, 21:58:09) 
[GCC 4.1.2 20070626 (Red Hat 4.1.2-14)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.setlocale(locale.LC_COLLATE, "en_US.utf8")
'en_US.utf8'
>>> locale.strxfrm("a")
'.\x01\x10\x01\x02'
>>> locale.strxfrm("\N{LATIN SMALL LETTER A WITH DIAERESIS}")
'.\x01\x19\x01\x02'
>>> alist = list("aboåäöABOÅÄÖñÑ")
>>> sorted(alist, cmp=locale.strcoll) == sorted(alist, key=locale.strxfrm)
True


The patch does not include what's needed to define HAVE_WCSXFRM, since I
really don't know how to do that properly (I edited 'configure' and
'pyconfig.h.in' manually to compile it).

--
files: strxfrm-unicode.diff
messages: 58592
nosy: filips
severity: normal
status: open
title: locale.strxfrm can't handle non-ascii strings
type: behavior
versions: Python 3.0
Added file: http://bugs.python.org/file8946/strxfrm-unicode.diff

__
Tracker <[EMAIL PROTECTED]>

__Index: Modules/_localemodule.c
===
--- Modules/_localemodule.c	(revision 59482)
+++ Modules/_localemodule.c	(working copy)
@@ -250,6 +250,7 @@
 static PyObject*
 PyLocale_strxfrm(PyObject* self, PyObject* args)
 {
+#if !defined(HAVE_WCSXFRM)
 char *s, *buf;
 size_t n1, n2;
 PyObject *result;
@@ -273,6 +274,43 @@
 result = PyUnicode_FromString(buf);
 PyMem_Free(buf);
 return result;
+#else
+PyObject *s, *result = NULL;
+wchar_t *buf = NULL, *ws = NULL;
+int len;
+size_t len2;
+if (!PyArg_UnpackTuple(args, "strxfrm", 1, 1, &s))
+return NULL;
+/* Argument must be unicode, or it's an error. */
+if (!PyUnicode_Check(s)) {
+PyErr_SetString(PyExc_ValueError, "strxfrm arguments must be strings");
+}
+/* Convert the unicode string to wchar[]. */
+len = PyUnicode_GET_SIZE(s) + 1;
+ws = PyMem_MALLOC(len * sizeof(wchar_t));
+if (!ws) {
+PyErr_NoMemory();
+goto done;
+}
+if (PyUnicode_AsWideChar((PyUnicodeObject*)s, ws, len) == -1)
+goto done;
+ws[len - 1] = 0;
+
+/* Get the transformation. */
+len2 = wcsxfrm(NULL, ws, 0) + 1;
+buf = PyMem_MALLOC(len2 * sizeof(wchar_t));
+if (!buf) {
+PyErr_NoMemory();
+goto done;
+}
+wcsxfrm(buf, ws, len2);
+result = PyUnicode_FromWideChar(buf, len2 - 1);
+  done:
+/* Deallocate everything. */
+if (ws) PyMem_FREE(ws);
+if (buf) PyMem_FREE(buf);
+return result;
+#endif
 }
 
 #if defined(MS_WINDOWS)
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1606] Doc: subprocess wait() may lead to dead lock

2007-12-13 Thread Raghuram Devarakonda

Raghuram Devarakonda added the comment:

Look at #1256 for similar report. A doc change was suggested there as well.

--
nosy: +draghuram

__
Tracker <[EMAIL PROTECTED]>

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



[issue1469] SSL tests leak memory

2007-12-13 Thread Christian Heimes

Christian Heimes added the comment:

It hangs on my Linux box, too. I've not yet tried on Windows.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1606] Doc: subprocess wait() may lead to dead lock

2007-12-13 Thread Christian Heimes

Christian Heimes added the comment:

Guido van Rossum wrote:
> That is done precisely to *avoid* blocking. I believe the only reason
> your example blocks is because you wait before reading -- you should
> do it the other way around, do all I/O first and *then* wait for the
> process to exit.

I believe so, too. The subprocess docs aren't warning about the problem.
I've seen a fair share of programmers who fall for the trap - including
me a few weeks ago.

> I disagree. I don't believe it will block unless you make the mistake
> of waiting for the process first.

Consider yet another example

>>> p = Popen(someprogram, stdin=PIPE, stdout=PIPE)
>>> p.stdin.write(10MB of data)

someprogram processes the incoming data in small blocks. Let's say 1KB
and 1MB stdin and stdout buffer. It reads 1KB from stdin and writes 1KB
to stdout until the stdout buffer is full. The program stops and waits
for for Python to free the stdout buffer. However the python code is
still writing data to the limited stdin buffer.

>>> data = p.stout.read()

Is the scenario realistic?

I tried it.

*** This works although it is slow
$ cat img_0948.jpg | convert - png:- >test

*** This example does not work. The test file is created but no data is
written to the file.

p = subprocess.Popen(["convert", "-",  "png:-"],
 stdin=subprocess.PIPE, stdout=subprocess.PIPE)

img = open("img_0948.jpg", "rb")
p.stdin.write(img.read())
with open("test", "wb") as f:
f.write(p.stdout.read())

*** It works with communicate:
with open("test", "wb") as f:
out, err = p.communicate(img.read())
f.write(out)

Christian

__
Tracker <[EMAIL PROTECTED]>

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



[issue1617] Rare exception in test_urllib2net

2007-12-13 Thread Guido van Rossum

New submission from Guido van Rossum:

test test_urllib2net failed -- Traceback (most recent call last):
 File "/tmp/python-test/local/lib/python2.6/test/test_urllib2net.py",
line 175, in test_ftp
   self._test_urls(urls, self._extra_handlers())
 File "/tmp/python-test/local/lib/python2.6/test/test_urllib2net.py",
line 244, in _test_urls
   f = urllib2.urlopen(url, req)
 File "/tmp/python-test/local/lib/python2.6/urllib2.py", line 124, in
urlopen
   return _opener.open(url, data, timeout)
 File "/tmp/python-test/local/lib/python2.6/urllib2.py", line 380, in open
   response = self._open(req, data)
 File "/tmp/python-test/local/lib/python2.6/urllib2.py", line 398, in _open
   '_open', req)
 File "/tmp/python-test/local/lib/python2.6/urllib2.py", line 358, in
_call_chain
   result = func(*args)
 File "/tmp/python-test/local/lib/python2.6/urllib2.py", line 1277, in
ftp_open
   fw = self.connect_ftp(user, passwd, host, port, dirs, req.timeout)
 File "/tmp/python-test/local/lib/python2.6/urllib2.py", line 1323, in
connect_ftp
   self.cache[key] = ftpwrapper(user, passwd, host, port, dirs, timeout)
 File "/tmp/python-test/local/lib/python2.6/urllib.py", line 842, in
__init__
   self.init()
 File "/tmp/python-test/local/lib/python2.6/urllib.py", line 848, in init
   self.ftp.connect(self.host, self.port, self.timeout)
 File "/tmp/python-test/local/lib/python2.6/ftplib.py", line 129, in connect
   self.sock = socket.create_connection((self.host, self.port),
self.timeout)
 File "/tmp/python-test/local/lib/python2.6/socket.py", line 462, in
create_connection
   raise error, msg
TypeError: __init__() takes exactly 2 arguments (3 given)

It looks like somehow msg is a 2-tuple here.  What exception could have
been caught?

--
messages: 58588
nosy: gvanrossum
priority: normal
severity: normal
status: open
title: Rare exception in test_urllib2net
type: crash
versions: Python 2.6

__
Tracker <[EMAIL PROTECTED]>

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



[issue1609] test_re.py fails

2007-12-13 Thread Ismail Donmez

Ismail Donmez added the comment:

Remove test_ucn from the list, it still fails but its for another bug
report.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

Committed revision 59483 (2.5 branch).
Committed revision 59484 (2.6 trunk).

Keeping this open since someone still needs to run autoconf to
regenerate configure for the 2.6 trunk.

--
priority: urgent -> normal

__
Tracker <[EMAIL PROTECTED]>

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



[issue1609] test_re.py fails

2007-12-13 Thread Ismail Donmez

Ismail Donmez added the comment:

Removing --with-wctype-functions in total fixes following regression tests,

test_codecs 
test_re 
test_ucn 
test_unicodedata

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Ismail Donmez

Ismail Donmez added the comment:

Last patch had a grammar error in comment, fix that.

Added file: http://bugs.python.org/file8945/wrap.patch

__
Tracker <[EMAIL PROTECTED]>

__Index: configure.in
===
--- configure.in	(revision 59479)
+++ configure.in	(working copy)
@@ -757,6 +757,10 @@
 if test "$CC" != 'g++' ; then
 	STRICT_PROTO="-Wstrict-prototypes"
 	fi
+# For gcc 4.x we need to use -fwrapv so lets check if its supported
+if "$CC" -v --help 2>/dev/null |grep -- -fwrapv > /dev/null; then
+   WRAP="-fwrapv"
+fi
 	case $ac_cv_prog_cc_g in
 	yes)
 	if test "$Py_DEBUG" = 'true' ; then
@@ -764,7 +768,7 @@
 		# debug builds.
 		OPT="-g -Wall $STRICT_PROTO"
 	else
-		OPT="-g -O3 -Wall $STRICT_PROTO"
+		OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
 	fi
 	;;
 	*)
Index: README
===
--- README	(revision 59479)
+++ README	(working copy)
@@ -282,19 +282,6 @@
 submit a documentation bug report to SourceForge (see Bug Reports
 above) so we can remove them!)
 
-GCC 4.1,
-GCC 4.2: There is a known incompatibility between Python and GCC,
- where GCC 4.1 and later uses an interpretation of C 
- different to earlier GCC releases in an area where the C 
- specification has undefined behaviour (namely, integer arithmetic 
- involving -sys.maxint-1).
-
-	 As a consequence, compiling Python with GCC 4.1/4.2 is not
-	 recommended. It is likely that this problem will be resolved
-	 in future Python releases. As a work-around, it seems that
-	 adding -fwrapv to the compiler options restores the earlier
-	 GCC behaviour.
-
 Unix platforms: If your vendor still ships (and you still use) Berkeley DB
 1.85 you will need to edit Modules/Setup to build the bsddb185
 module and add a line to sitecustomize.py which makes it the
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1608] test_str.py crashes

2007-12-13 Thread Ismail Donmez

Ismail Donmez added the comment:

Attached patch exactly checks if compiler supports -fwrapv otherwise
doesn't use it. Is this ok?

Added file: http://bugs.python.org/file8944/wrap.patch

__
Tracker <[EMAIL PROTECTED]>

__Index: configure.in
===
--- configure.in	(revision 59479)
+++ configure.in	(working copy)
@@ -757,6 +757,10 @@
 if test "$CC" != 'g++' ; then
 	STRICT_PROTO="-Wstrict-prototypes"
 	fi
+# For gcc 4.x we need use fwrapv so lets check if its supported
+if "$CC" -v --help 2>/dev/null |grep -- -fwrapv > /dev/null; then
+   WRAP="-fwrapv"
+fi
 	case $ac_cv_prog_cc_g in
 	yes)
 	if test "$Py_DEBUG" = 'true' ; then
@@ -764,7 +768,7 @@
 		# debug builds.
 		OPT="-g -Wall $STRICT_PROTO"
 	else
-		OPT="-g -O3 -Wall $STRICT_PROTO"
+		OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
 	fi
 	;;
 	*)
Index: README
===
--- README	(revision 59479)
+++ README	(working copy)
@@ -282,19 +282,6 @@
 submit a documentation bug report to SourceForge (see Bug Reports
 above) so we can remove them!)
 
-GCC 4.1,
-GCC 4.2: There is a known incompatibility between Python and GCC,
- where GCC 4.1 and later uses an interpretation of C 
- different to earlier GCC releases in an area where the C 
- specification has undefined behaviour (namely, integer arithmetic 
- involving -sys.maxint-1).
-
-	 As a consequence, compiling Python with GCC 4.1/4.2 is not
-	 recommended. It is likely that this problem will be resolved
-	 in future Python releases. As a work-around, it seems that
-	 adding -fwrapv to the compiler options restores the earlier
-	 GCC behaviour.
-
 Unix platforms: If your vendor still ships (and you still use) Berkeley DB
 1.85 you will need to edit Modules/Setup to build the bsddb185
 module and add a line to sitecustomize.py which makes it the
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1616] compiler warnings (gcc 2.96)

2007-12-13 Thread Guido van Rossum

New submission from Guido van Rossum:

I figured this would be useful:

/home/guido/p25/Modules/_ctypes/libffi/src/x86/ffi.c:177: warning:
function declaration isn't a prototype
/home/guido/p25/Modules/_ctypes/libffi/src/x86/ffi.c:194: warning:
function declaration isn't a prototype
/home/guido/p25/Modules/unicodedata.c: In function `unicodedata_decimal':
/home/guido/p25/Modules/unicodedata.c:110: warning: `rc' might be used
uninitialized in this function
/home/guido/p25/Modules/unicodedata.c: In function `unicodedata_numeric':
/home/guido/p25/Modules/unicodedata.c:197: warning: `rc' might be used
uninitialized in this function
/home/guido/p25/Modules/readline.c: In function `flex_complete':
/home/guido/p25/Modules/readline.c:681: warning: implicit declaration of
function `completion_matches'
/home/guido/p25/Modules/readline.c:681: warning: return makes pointer
from integer without a cast
/home/guido/p25/Modules/cjkcodecs/_codecs_iso2022.c: In function
`iso2022processesc':
/home/guido/p25/Modules/cjkcodecs/_codecs_iso2022.c:307: warning:
`esclen' might be used uninitialized in this function

--
assignee: gvanrossum
messages: 58582
nosy: gvanrossum
priority: low
severity: normal
status: open
title: compiler warnings (gcc 2.96)
versions: Python 2.5

__
Tracker <[EMAIL PROTECTED]>

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



[issue1501] 0 ** 0 documentation

2007-12-13 Thread Facundo Batista

Changes by Facundo Batista:


--
assignee:  -> facundobatista
nosy: +facundobatista

__
Tracker <[EMAIL PROTECTED]>

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



[issue1615] descriptor protocol bug

2007-12-13 Thread ganges master

New submission from ganges master:

it seems the code of PyObject_GenericGetAttr, which invokes the
descriptor protocol, silences any AttributeErrors raised by the
descriptor, for classes that also define __getattr__. it should
propagate up rather than being silently ignored.

the attached example is quite artificial, but it's a simplification of
real world code i had hard time debugging. turned out i misspelled an
attribute name inside the property getter function, which raised an
AttributeError as expected -- but the exception i got was quite
misleading, saying the instance has no attribute named so.

this bug only happens when the class defines a custom __getattr__. see
attached demo file for details.

--
components: Interpreter Core
files: demo.txt
messages: 58581
nosy: gangesmaster
severity: normal
status: open
title: descriptor protocol bug
type: behavior
versions: Python 2.5, Python 2.6
Added file: http://bugs.python.org/file8943/demo.txt

__
Tracker <[EMAIL PROTECTED]>

__only happens when the class defines a custom __getattr__:

>>> class Foo(object):
... def __getattr__(self, name):
... if name == "spam":
... return 17
... else:
... raise AttributeError("%s object has no attribute %r" %
... (self.__class__.__name__, name))
... @property
... def bacon(self):
... return int.lalala
...
>>>
>>> f = Foo()
>>> f.spam
17
>>> f.bacon
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 7, in __getattr__
AttributeError: Foo object has no attribute 'bacon'  <<-- expected 'int object 
has no attribute lalala'
>>>



without a custom __getattr__ works as expected

>>> class Bar(object):
... def __init__(self):
... self.x = 17
...
... @property
... def bacon(self):
... return int.lalala
...
>>> b = Bar()
>>> b.x
17
>>> b.bacon
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 7, in bacon
AttributeError: type object 'int' has no attribute 'lalala'
>>>___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1469] SSL tests leak memory

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

Hm, when I run the full test_ssl test suite with

./python Lib/test/regrtest.py -v -uall test_ssl

it always hangs in testAsyncoreServer after printing this:

testAsyncoreServer (test.test_ssl.ThreadedTests) ...
 server:  new connection from 127.0.0.1:59781
 client:  sending 'FOO\n'...
 server:  read 4 from client

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

GCC 2.96 is still the golden standard for me, and it doesn't like
-fwrapv. Please try to come up with a better patch. It should be easy
enough to invoke gcc -fwrapv with a dummy program.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Ismail Donmez

Ismail Donmez added the comment:

Ok gcc developers say -fwrapv is there since gcc 3.3 so I think its
still fine, if not I will prepare another patch.

Regards.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Ismail Donmez

Ismail Donmez added the comment:

After applying patch you need to run autoconf to update configure file
and svn commit afterwards.

Regards,
ismail

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Ismail Donmez

Ismail Donmez added the comment:

Looks like -fwrapv is there since gcc 2.95.3 attached patch adds -fwrapv
when debugging disabled, also removes gcc 4.x part from README as it no
longer applies.

Added file: http://bugs.python.org/file8942/fwrapv.patch

__
Tracker <[EMAIL PROTECTED]>

__Index: README
===
--- README	(revision 59479)
+++ README	(working copy)
@@ -282,19 +282,6 @@
 submit a documentation bug report to SourceForge (see Bug Reports
 above) so we can remove them!)
 
-GCC 4.1,
-GCC 4.2: There is a known incompatibility between Python and GCC,
- where GCC 4.1 and later uses an interpretation of C 
- different to earlier GCC releases in an area where the C 
- specification has undefined behaviour (namely, integer arithmetic 
- involving -sys.maxint-1).
-
-	 As a consequence, compiling Python with GCC 4.1/4.2 is not
-	 recommended. It is likely that this problem will be resolved
-	 in future Python releases. As a work-around, it seems that
-	 adding -fwrapv to the compiler options restores the earlier
-	 GCC behaviour.
-
 Unix platforms: If your vendor still ships (and you still use) Berkeley DB
 1.85 you will need to edit Modules/Setup to build the bsddb185
 module and add a line to sitecustomize.py which makes it the
Index: configure.in
===
--- configure.in	(revision 59479)
+++ configure.in	(working copy)
@@ -764,7 +764,7 @@
 		# debug builds.
 		OPT="-g -Wall $STRICT_PROTO"
 	else
-		OPT="-g -O3 -Wall $STRICT_PROTO"
+		OPT="-g -fwrapv -O3 -Wall $STRICT_PROTO"
 	fi
 	;;
 	*)
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1608] test_str.py crashes

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

Can you suggest a patch that adds this permanently, whenever it is supported?

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Ismail Donmez

Ismail Donmez added the comment:

-fwrapv fixes the issue, thanks!

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

> Ok so this is a code bug according to GCC developers see comment 1 & 2
> at http://gcc.gnu.org/PR34454 .

I told you you can't win this argument with the GCC devs.

We'll have to use -fwrapv or whatever.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Ismail Donmez

Ismail Donmez added the comment:

Ok so this is a code bug according to GCC developers see comment 1 & 2
at http://gcc.gnu.org/PR34454 .

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Ismail Donmez

Ismail Donmez added the comment:

Reported as a gcc bug, http://gcc.gnu.org/PR34454

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Ismail Donmez

Ismail Donmez added the comment:

Following testcase doesn't print overflow with gcc 4.3 when compiled
with -O3, works with gcc 3.4.6 though.

#include 
#include 

void foo(ssize_t x)
{
 if (x >= 0) {
   if (x+x < 0) printf("Overflow\n");
}
}

main()
{
  volatile ssize_t x =2147483647;
  foo(x);
}

__
Tracker <[EMAIL PROTECTED]>

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



[issue1613] Makefile's VPATH feature is broken

2007-12-13 Thread Christian Heimes

Christian Heimes added the comment:

Fixed in r59482
I've updated the README and changed distutils slightly. Distutils was
using Modules/Setup.dist to detect an uninstalled Python. However
Setup.dist is only available in the srcdir and not in the VPATH dir.
I've changed it to Setup.local.

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

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Ismail Donmez

Ismail Donmez added the comment:

Test always prints overflow here, tested with -O3 but here are
interesting overflow warnings that might give a clue , but I think
Cpickle is not involved here, but anyway:

/home/cartman/python-2.5/Modules/cPickle.c: In function 'Unpickler_noload':
/home/cartman/python-2.5/Modules/cPickle.c:4232: warning: assuming
signed overflow does not occur when assuming that (X - c) > X is always
false
/home/cartman/python-2.5/Modules/cPickle.c:194: warning: assuming signed
overflow does not occur when assuming that (X - c) > X is always false
/home/cartman/python-2.5/Modules/cPickle.c: In function 'load':
/home/cartman/python-2.5/Modules/cPickle.c:4232: warning: assuming
signed overflow does not occur when assuming that (X - c) > X is always
false

__
Tracker <[EMAIL PROTECTED]>

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



[issue1613] Makefile's VPATH feature is broken

2007-12-13 Thread Christian Heimes

Christian Heimes added the comment:

Guido van Rossum wrote:
> Do you need more help at this point?

No, I'm fine. I've a working solution for the problem. :)

Christian

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

> if you can give me a sample testcase I can bug GCC developers, this
> doesn't look good from GCC side at all. Btw from my limited C knowledge
> marking variables would volatile would prevent optimizations of them.

The example would be something like

void foo(ssize_t x)
{
  if (x >= 0) {
if (x+x < 0) printf("Overflow\n");
  }
}

main()
{
  foo(2147483647);
}

This should print "Overflow" but won't if the evil optimization
triggers. (However you may have to tweak the example program so the
compiler can't inline the argument to foo.)

__
Tracker <[EMAIL PROTECTED]>

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



[issue1609] test_re.py fails

2007-12-13 Thread Ismail Donmez

Ismail Donmez added the comment:

> Not quite yet, gcc 4.3 had a big inlining bug that was just corrected
> two weeks ago:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33434
> You may have encountered this bug, or another similar one...

Two weeks ago is too old for me, I am using SVN snapshot from yesterday :-)

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Ismail Donmez

Ismail Donmez added the comment:

Guido,

if you can give me a sample testcase I can bug GCC developers, this
doesn't look good from GCC side at all. Btw from my limited C knowledge
marking variables would volatile would prevent optimizations of them.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

Martin, can you look into this?  It seems GCC 4.3 disables buffer
overflow protection checks.  The best short-term solution may be to
disable that particular kind of optimization.  How?

--
assignee:  -> loewis
nosy: +loewis

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

Martin, can you look into this?  It seems GCC 4.3 disables buffer
overflow protection checks.  The best short-term solution may be to
disable that particular kind of optimization.  How?

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Ismail Donmez

Ismail Donmez added the comment:

Indeed you are correct,

>>> '\ta\n\tb'.expandtabs(2147483647)

Program received signal SIGSEGV, Segmentation fault.
string_expandtabs (self=0xb7ba7c60, args=0xb7ba7dec) at
Objects/stringobject.c:3358
3358*q++ = ' ';
(gdb) bt
#0  string_expandtabs (self=0xb7ba7c60, args=0xb7ba7dec) at
Objects/stringobject.c:3358
#1  0xb7e1b6dd in PyCFunction_Call (func=0xb7ba72ec, arg=0xb7ba7dec,
kw=0x0) at Objects/methodobject.c:73
#2  0xb7e6d05b in PyEval_EvalFrameEx (f=0x80cc40c, throwflag=0) at
Python/ceval.c:3569
#3  0xb7e6ec35 in PyEval_EvalCodeEx (co=0xb7b987b8, globals=0xb7bceacc,
locals=0xb7bceacc, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0,
defcount=0,
closure=0x0) at Python/ceval.c:2832
#4  0xb7e6ee53 in PyEval_EvalCode (co=0xb7b987b8, globals=0xb7bceacc,
locals=0xb7bceacc) at Python/ceval.c:494
#5  0xb7e8ea8d in PyRun_InteractiveOneFlags (fp=0xb7d48420,
filename=0xb7ec589c "", flags=0xbff3c6a8) at Python/pythonrun.c:1273
#6  0xb7e8ecc6 in PyRun_InteractiveLoopFlags (fp=0xb7d48420,
filename=0xb7ec589c "", flags=0xbff3c6a8) at Python/pythonrun.c:723
#7  0xb7e8f427 in PyRun_AnyFileExFlags (fp=0xb7d48420,
filename=0xb7ec589c "", closeit=0, flags=0xbff3c6a8) at
Python/pythonrun.c:692
#8  0xb7e9a347 in Py_Main (argc=0, argv=0xbff3c774) at Modules/main.c:523
#9  0x080485a2 in main (argc=538976288, argv=0x20202020) at
./Modules/python.c:23


Though I am not exactly sure how to proceed from here.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

Actually, looking at the sample code and the string_expandtabs()
implementation it's clear what happened: the test for overflow on line
3318 or 3331 or 3339 must have been optimized out by GCC.

This is very inconvenient because lots of buffer overflow protection
uses similar code; this means that code that has been audited and fixed
in the past will again be vulnerable after compilation by GCC 4.3.

I'm going to ask Martin von Loewis to give an opinion on this.

Thanks for bringing this up!

--
priority:  -> urgent

__
Tracker <[EMAIL PROTECTED]>

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



[issue1609] test_re.py fails

2007-12-13 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

> > Is GCC 4.3 released yet?
>
> Not yet but soon, its less buggy compared to 4.1 and 4.2 
> at the moment.

Not quite yet, gcc 4.3 had a big inlining bug that was just corrected
two weeks ago:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33434
You may have encountered this bug, or another similar one...

--
nosy: +amaury.forgeotdarc

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

> This is a soon to be released GCC though I won't deny it has
> regressions, but note that extra optimizations already uncovered bugs in
> other software.

And the GCC authors always win these cases, C standard in hand.

> And unless I can get a minimal C testcase, GCC bug will be worthless.
>
> Exact crashling call is string_tests.py line 255 :
>
> self.checkraises(OverflowError,
>  '\ta\n\tb', 'expandtabs', sys.maxint)
>
> Commenting out this fixes the crash.

If you want for me to debug this myself it'll be ages. it looks like
the crashing call is

'\ta\n\tb'.expandtabs(2147483647)

Can you confirm that this crashes? If it does, you should be able to
use gdb to step through expandtabs() and hopefully analyze the
problem.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1613] Makefile's VPATH feature is broken

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

Do you need more help at this point?

__
Tracker <[EMAIL PROTECTED]>

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



[issue1609] test_re.py fails

2007-12-13 Thread Ismail Donmez

Ismail Donmez added the comment:

> What system libraries?

libpython2.5.so.1.0 , this is a shared lib build after all.

> Does it make a difference if you don't specify either of
>
> --enable-unicode=ucs4 \
> --with-wctype-functions

Removing --with-wctype-functions fixes the issue.

> Is GCC 4.3 released yet?

Not yet but soon, its less buggy compared to 4.1 and 4.2 at the moment.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Ismail Donmez

Ismail Donmez added the comment:

This is a soon to be released GCC though I won't deny it has
regressions, but note that extra optimizations already uncovered bugs in
other software.

And unless I can get a minimal C testcase, GCC bug will be worthless.

Exact crashling call is string_tests.py line 255 :

self.checkraises(OverflowError,
 '\ta\n\tb', 'expandtabs', sys.maxint)

Commenting out this fixes the crash.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1613] Makefile's VPATH feature is broken

2007-12-13 Thread Christian Heimes

Christian Heimes added the comment:

You are right! :) A make clean in the root of my local workspace solved
the problem but revealed another problem:

$ make
running build
running build_ext
building '_struct' extension
gcc -pthread -fPIC -fno-strict-aliasing -g -Wall -Wstrict-prototypes -I.
-I/home/heimes/dev/python/py3k/debug/./Include -I./Include -IInclude -I.
-I/usr/local/include -I/usr/local/include/python3.0 -c _struct.c -o
build/temp.linux-i686-3.0/_struct.o
gcc: _struct.c: No such file or directory
gcc: keine Eingabedateien
error: /home/heimes/dev/python/py3k/debug/Modules/_ctypes/libffi: No
such file or directory

I fixed the problem by adding the option -b $(srcdir) to setup.py build
in the Makefile.

Next I run into a problem with the modules. Apparently itertools was not
added as a built-in module.

running build
Traceback (most recent call last):
  File "../setup.py", line 1584, in 
main()
  File "../setup.py", line 1579, in main
'Lib/smtpd.py']
  File "/home/heimes/dev/python/py3k/Lib/distutils/core.py", line 148,
in setup
dist.run_commands()
  File "/home/heimes/dev/python/py3k/Lib/distutils/dist.py", line 942,
in run_commands
self.run_command(cmd)
  File "/home/heimes/dev/python/py3k/Lib/distutils/dist.py", line 960,
in run_command
cmd_obj = self.get_command_obj(command)
  File "/home/heimes/dev/python/py3k/Lib/distutils/dist.py", line 847,
in get_command_obj
self._set_command_options(cmd_obj, options)
  File "/home/heimes/dev/python/py3k/Lib/distutils/dist.py", line 868,
in _set_command_options
bool_opts = map(translate_longopt, command_obj.boolean_options)
ImportError: /usr/local/lib/python3.0/site-packages/itertools.so:
undefined symbol: PyUnicodeUCS4_FromFormat

I copied $(srcdir)/Modules/Setup* ./Modules/ and Python compiled
itertools as built-ins.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1609] test_re.py fails

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

> Without  LD_LIBRARY_PATH it would use the system libraries and not the
> compiled ones which anyway is not wanted.

What system libraries?

Does it make a difference if you don't specify either of

--enable-unicode=ucs4 \
--with-wctype-functions

?

Is GCC 4.3 released yet?

__
Tracker <[EMAIL PROTECTED]>

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



[issue1333] merge urllib and urlparse functionality

2007-12-13 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti:


--
resolution: accepted -> 

__
Tracker <[EMAIL PROTECTED]>

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



[issue1614] bug in string method "title"

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

That's not going to change.

--
nosy: +gvanrossum
resolution:  -> wont fix
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

BTW is this a released version of GCC?  If not, you might want to file
the bug with the GCC project...

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

Looks like expandtabs() has a problem.  Can you boil it down to a single
call?

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Ismail Donmez

Ismail Donmez added the comment:

--enable-pydebug fixes the crash it might be that some uninitialized
variable doesn't take affect unless optimized as valgrind output shows
many of this.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1609] test_re.py fails

2007-12-13 Thread Ismail Donmez

Ismail Donmez added the comment:

gcc 4.3, Linux 2.6.18, 32bit. 

Without  LD_LIBRARY_PATH it would use the system libraries and not the
compiled ones which anyway is not wanted.

Configure line used is (damn I forgot to specify this before, sorry)

--with-fpectl \
--enable-shared \
--enable-ipv6 \
--with-threads \
--enable-unicode=ucs4 \
--with-wctype-functions

--enable-pydebug doesn't help.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2007-12-13 Thread Bill Janssen

Bill Janssen added the comment:

The mechanism is there for direct use of the SSL module, yes.  But the
question is, what should indirect usage, like the httplib or urllib modules,
do?  If they are going to check hostnames on use of an https: URL, they need
some way to pass a ca_certs file through to the SSL code they use.

Bill

On Dec 13, 2007 7:14 AM, Andreas Hasenack <[EMAIL PROTECTED]> wrote:

>
> Andreas Hasenack added the comment:
>
> > do it automatically.  Unfortunately, that means that client-side
> certificate
> > verification has to be done (it's pointless to look at the data in
> > unverified certificates), and that means that the client software has to
> > have an appropriate collection of root certificates to verify against.
>  I
>
> But the current API already has this feature:
> ssl_sock = ssl.wrap_socket(s, ca_certs="/etc/pki/tls/rootcerts/%s" % cert,
>  cert_reqs=ssl.CERT_REQUIRED)
>
> So this is already taken care of with ca_certs and cert_reqs, right?
>
> __
> Tracker <[EMAIL PROTECTED]>
> 
> __
>

Added file: http://bugs.python.org/file8941/unnamed

__
Tracker <[EMAIL PROTECTED]>

__The mechanism is there for direct use of the SSL module, yes.  But the 
question is, what should indirect usage, like the httplib or urllib modules, 
do?  If they are going to check hostnames on use of an https: URL, they 
need some way to pass a ca_certs file through to the SSL code they use.
BillOn Dec 13, 2007 7:14 AM, Andreas 
Hasenack [EMAIL PROTECTED]> 
wrote:
Andreas Hasenack added the comment:> do it automatically. 
 Unfortunately, that means that client-sidecertificate> 
verification has to be done (it's pointless to look at the data in> 
unverified certificates), and that means that the client software has to
> have an appropriate collection of root certificates to verify against. 
 IBut the current API already has this feature:ssl_sock = 
ssl.wrap_socket(s, ca_certs="/etc/pki/tls/rootcerts/%s" % cert,
                     
 cert_reqs=ssl.CERT_REQUIRED)So this is already taken care of with 
ca_certs and cert_reqs, 
right?__Tracker 
[EMAIL PROTECTED]>http://bugs.python.org/issue1589>__

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



[issue1613] Makefile's VPATH feature is broken

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

Before I try to reproduce this, I remember having problems when
switching between using VPATH and not using it in the same subversion
workspace.  The .o files left behind by one version confuse the other.

--
nosy: +gvanrossum

__
Tracker <[EMAIL PROTECTED]>

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



[issue1614] bug in string method "title"

2007-12-13 Thread Bob Helmbold

New submission from Bob Helmbold:

Summary: "title" method of string objects does not 
   handle contractions and possessives correctly.
See the following short program and its results for examples.
<<<
"""
Test of string method 'capitalize'
"""

stringList=["we're",
"you're",
"they're",
"i've",
"we've",
"you've",
"they've",
"can't",
"won't",
"doesn't",
"haven't",
"daren't",
"shouldn't",
"weren't",
"wasn't",
"i'm"
]

for item in stringList:
n=len(item)
spaces=' '*(12-n)
itemTitled = item.title()
isATitle = itemTitled.istitle()
print "%s -> %s%s is title=%s" %(item, spaces, itemTitled, isATitle)

<<<
Results in:
we're ->We'Re is title=True
you're ->   You'Re is title=True
they're ->  They'Re is title=True
i've -> I'Ve is title=True
we've ->We'Ve is title=True
you've ->   You'Ve is title=True
they've ->  They'Ve is title=True
can't ->Can'T is title=True
won't ->Won'T is title=True
doesn't ->  Doesn'T is title=True
haven't ->  Haven'T is title=True
daren't ->  Daren'T is title=True
shouldn't ->Shouldn'T is title=True
weren't ->  Weren'T is title=True
wasn't ->   Wasn'T is title=True
i'm ->  I'M is title=True

--
components: Interpreter Core
messages: 58544
nosy: ElGordo
severity: normal
status: open
title: bug in string method "title"
type: behavior
versions: Python 2.5

__
Tracker <[EMAIL PROTECTED]>

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



[issue1611] doctest.testmod gets noisy if called more than once per SystemExit

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

I suspect that doctest was simply not intended to be used this way.

Maybe Tim remembers more?

--
assignee:  -> tim_one
nosy: +gvanrossum, tim_one

__
Tracker <[EMAIL PROTECTED]>

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



[issue1609] test_re.py fails

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

Can't reproduce.

Like before, what platform, compiler etc.?  Does using ./configure
--with-pydebug make a difference?  What's the LD_LIBRARY_PATH for?

--
nosy: +gvanrossum

__
Tracker <[EMAIL PROTECTED]>

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



[issue1313119] urlparse "caches" parses regardless of encoding

2007-12-13 Thread Alexandre Vassalotti

Alexandre Vassalotti added the comment:

Fixed in r59480.

--
nosy: +alexandre.vassalotti
resolution:  -> fixed
status: open -> closed

_
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

What hardware and OS?  32 or 64 bit?  What optimization level?  Debug
build or not?

NB. Unless you used /Misc/valgrind-python.supp, the valgrind output is
useless.

--
nosy: +gvanrossum

__
Tracker <[EMAIL PROTECTED]>

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



[issue1613] Makefile's VPATH feature is broken

2007-12-13 Thread Christian Heimes

New submission from Christian Heimes:

Makefile has a feature called VPATH that is often used for cross
platform compilation or the creation of a different flavor.

Example:

$ cd py3k
$ mkdir debug
$ cd debug
$ ../configure --with-pydebug
$ make
...
gcc -pthread -c -fno-strict-aliasing -g -Wall -Wstrict-prototypes  -I.
-IInclude -I../Include   -DPy_BUILD_CORE -o Python/mysnprintf.o
../Python/mysnprintf.c
gcc -pthread -g -Wall -Wstrict-prototypes   Parser/acceler.o
Parser/grammar1.o Parser/listnode.o Parser/node.o Parser/parser.o
Parser/parsetok.o Parser/bitset.o Parser/metagrammar.o
Parser/firstsets.o Parser/grammar.o Parser/pgen.o Objects/obmalloc.o
Python/mysnprintf.o Parser/tokenizer_pgen.o Parser/printgrammar.o
Parser/pgenmain.o -lpthread -ldl  -lutil -o Parser/pgen
gcc: Parser/tokenizer_pgen.o: No such file or directory
gcc: Parser/printgrammar.o: No such file or directory
gcc: Parser/pgenmain.o: No such file or directory

--
components: Build
keywords: py3k
messages: 58539
nosy: tiran
priority: normal
severity: normal
status: open
title: Makefile's VPATH feature is broken
versions: Python 2.6, Python 3.0

__
Tracker <[EMAIL PROTECTED]>

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



[issue1606] Doc: subprocess wait() may lead to dead lock

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

> > Why not simply reverse the wait() and read() calls?
>
> I don't think it is sufficient if the user uses more than one pipe. The
> subprocess.communicate() and _communicate() methods are using threads
> (Windows) or select (Unix) when multiple pipes for stdin, stderr and
> stderr are involved.

That is done precisely to *avoid* blocking. I believe the only reason
your example blocks is because you wait before reading -- you should
do it the other way around, do all I/O first and *then* wait for the
process to exit.

> The only safe way with multiple pipes is communicate([input]) unless the
> process returns *lots* of data. The subprocess module is buffering the
> data in memory if the user uses PIPE or STDIN.

I disagree. I don't believe it will block unless you make the mistake
of waiting for the process first.

> The subprocess module also contains a XXX comment in the unix version of
> _communicate()
>
># XXX Rewrite these to use non-blocking I/O on the
># file objects; they are no longer using C stdio!
>
> Should I create another bug entry for it?

No, we have too many bug entries already.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1612] infinite recursion when using collections.Sequence in a recursive function (Py30a2)

2007-12-13 Thread Guido van Rossum

Guido van Rossum added the comment:

The bug is in your code; a string is considered a sequence but its
elements are also strings (of length 1).

--
nosy: +gvanrossum
resolution:  -> invalid
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

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



[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2007-12-13 Thread Guido van Rossum

Changes by Guido van Rossum:


--
nosy:  -gvanrossum

__
Tracker <[EMAIL PROTECTED]>

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



[issue1612] infinite recursion when using collections.Sequence in a recursive function (Py30a2)

2007-12-13 Thread Mark Summerfield

New submission from Mark Summerfield:

In the attached file there are two tiny functions, flatten1() and
flatten2(). There is only one difference between them:
flatten1() has the line:
if isinstance(x, list):
and flatten2() has this line instead:
if isinstance(x, collections.Sequence):

flatten1() works perfectly in Python 2.5.1 and Python 30a2 (just comment
out the flatten2() code).
But flatten2() goes into "infinite" recursion in Python 30a2 when trying
to flatten list "c".

--
components: Interpreter Core
files: bug.py
messages: 58536
nosy: mark
severity: normal
status: open
title: infinite recursion when using collections.Sequence in a recursive 
function (Py30a2)
type: behavior
versions: Python 3.0
Added file: http://bugs.python.org/file8939/bug.py

__
Tracker <[EMAIL PROTECTED]>

__import collections

def flatten1(seq):
"""Returns a list containing all the items in seq with no nested
sequences

>>> a = [[1, 2], [3, [4, [5, 6], 7], 8], 9, [10, 11], [12]]
>>> b =flatten1(a)
>>> b
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
>>> flatten1(b) == b
True
>>> c = [["S"] * 4, ["M"] * 2, "R", "H", ["D"] * 3, "A", "B", "E"]
>>> flatten1(c)
['S', 'S', 'S', 'S', 'M', 'M', 'R', 'H', 'D', 'D', 'D', 'A', 'B', 'E']
"""
result = []
for x in seq:
if isinstance(x, list):
result.extend(flatten1(x))
else:
result.append(x)
return result


def flatten2(seq):
"""Returns a list containing all the items in seq with no nested
sequences

>>> a = [[1, 2], [3, [4, [5, 6], 7], 8], 9, [10, 11], [12]]
>>> b =flatten2(a)
>>> b
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
>>> flatten2(b) == b
True
>>> c = [["S"] * 4, ["M"] * 2, "R", "H", ["D"] * 3, "A", "B", "E"]
>>> flatten2(c)
['S', 'S', 'S', 'S', 'M', 'M', 'R', 'H', 'D', 'D', 'D', 'A', 'B', 'E']
"""
result = []
for x in seq:
if isinstance(x, collections.Sequence):
result.extend(flatten2(x))
else:
result.append(x)
return result


if __name__ == "__main__":
import doctest
doctest.testmod()
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1589] New SSL module doesn't seem to verify hostname against commonName in certificate

2007-12-13 Thread Andreas Hasenack

Andreas Hasenack added the comment:

> do it automatically.  Unfortunately, that means that client-side
certificate
> verification has to be done (it's pointless to look at the data in
> unverified certificates), and that means that the client software has to
> have an appropriate collection of root certificates to verify against.  I

But the current API already has this feature:
ssl_sock = ssl.wrap_socket(s, ca_certs="/etc/pki/tls/rootcerts/%s" % cert,
  cert_reqs=ssl.CERT_REQUIRED)

So this is already taken care of with ca_certs and cert_reqs, right?

__
Tracker <[EMAIL PROTECTED]>

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



[issue1611] doctest.testmod gets noisy if called more than once per SystemExit

2007-12-13 Thread Pat LaVarre

New submission from Pat LaVarre:

SUMMARY:

Calling doctest.testmod more than once before SystemExit spews stderr 
messages such as "*** DocTestRunner.merge: '__main__' in both testers; 
summing outcomes"

STEPS TO REPRODUCE:

$ cat tttestmod.py 
import doctest
doctest.testmod() # 1
doctest.testmod() # 2
doctest.testmod() # 3
$ 

ACTUAL RESULTS:

$ python ./tttestmod.py 
*** DocTestRunner.merge: '__main__' in both testers; summing outcomes.
*** DocTestRunner.merge: '__main__' in both testers; summing outcomes.
$ 

EXPECTED RESULTS:

$ python ./tttestmod.py 
$ 

WORKAROUND:

Filter stdout.write calls from doctest.py to squelch the noise.

REGRESSION/ ISOLATION:

$ python --version
Python 2.5.1
$

Also mentioned 2006-10 in comp.lang.python at DocTestRunner.merge 
verbose,
i.e., http://groups.google.com/group/comp.lang.python/search?
group=comp.lang.python&q=DocTestRunner.merge+verbose

Not yet found in Bugs.python.org at DocTestRunner.

NOTES:

We can reasonably expect newbies to doctest random things
that need to be doctested more than once.

We can't reasonably expect newbies to know to how to filter doctest 
stdout,
for example as below.

#!/usr/bin/env python

r""" ttestmod.py

Filter Doctest stdout a la http://wiki.python.org/moin/doctest
to call doctest.testmod more than once per SystemExit
without producing noise.

>>> import random
>>> import sys
>>>
>>> die = random.randint(1, 6)
>>> print >>sys.stderr, die
>>>
>>> die == 6
True
>>>

"""

import sys

class DocTestOutput:

def __init__(self, out = sys.stdout):

self.out = out
self.write = self.writeOut
self.quietly = False

def writeOut(self, bytes):

head = "*** DocTestRunner.merge: '__main__"
tail = "' in both testers; summing outcomes."

if bytes.startswith(head):
if bytes.endswith(tail):
self.quietly = True

if not self.quietly:
self.out.write(bytes)

if 0 <= bytes.find('\n'):
self.quietly = False

if __name__ == '__main__':

import doctest

sys.stdout = DocTestOutput()

doctest.testmod()
doctest.testmod()

--
components: Library (Lib)
messages: 58533
nosy: [EMAIL PROTECTED]
severity: normal
status: open
title: doctest.testmod gets noisy if called more than once per SystemExit
type: behavior
versions: Python 2.5

__
Tracker <[EMAIL PROTECTED]>

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



[issue1610] test_socket.py fails

2007-12-13 Thread Ismail Donmez

Ismail Donmez added the comment:

Then it won't run as expected (I got python 2.4 installed system wise) :

./python: error while loading shared libraries: libpython2.5.so.1.0:
cannot open shared object file: No such file or directory

__
Tracker <[EMAIL PROTECTED]>

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



[issue1350] IDLE - CallTips enhancement - show full doc-string in new window

2007-12-13 Thread Tal Einat

Tal Einat added the comment:

Yes, I admit I haven't tested this very thoroughly. I'll give this some
more time this weekend and submit another patch.

As for 3.0, I'll have to see what you've changed, but I'll gladly work
up a patch based on the newer version.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1610] test_socket.py fails

2007-12-13 Thread Facundo Batista

Facundo Batista added the comment:

What happens if you do NOT change the library path in front of it?

--
nosy: +facundobatista

__
Tracker <[EMAIL PROTECTED]>

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



[issue1609] test_re.py fails

2007-12-13 Thread Ismail Donmez

Changes by Ismail Donmez:


--
type:  -> behavior

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] test_str.py crashes

2007-12-13 Thread Ismail Donmez

Changes by Ismail Donmez:


--
title: Regression tests crashes with gcc 4.3 -> test_str.py crashes

__
Tracker <[EMAIL PROTECTED]>

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



[issue1610] test_socket.py fails

2007-12-13 Thread Ismail Donmez

New submission from Ismail Donmez:

Checkout Python 2.5 from release25-maint branch, revision 59479,

[~/python-2.5]> LD_LIBRARY_PATH=/home/cartman/python-2.5: ./python
./Lib/test/test_socket.py
testCrucialConstants (__main__.GeneralModuleTests) ... ok
testDefaultTimeout (__main__.GeneralModuleTests) ... ok
testGetServBy (__main__.GeneralModuleTests) ... ERROR
testGetSockOpt (__main__.GeneralModuleTests) ... ok
testHostnameRes (__main__.GeneralModuleTests) ... ok
testIPv4toString (__main__.GeneralModuleTests) ... ok
testIPv6toString (__main__.GeneralModuleTests) ... ok
testInterpreterCrash (__main__.GeneralModuleTests) ... ok
testNewAttributes (__main__.GeneralModuleTests) ... ok
testNtoH (__main__.GeneralModuleTests) ... ok
testRefCountGetNameInfo (__main__.GeneralModuleTests) ... ok
testSendAfterClose (__main__.GeneralModuleTests) ... ok
testSetSockOpt (__main__.GeneralModuleTests) ... ok
testSockName (__main__.GeneralModuleTests) ... ok
testSocketError (__main__.GeneralModuleTests) ... ok
testStringToIPv4 (__main__.GeneralModuleTests) ... ok
testStringToIPv6 (__main__.GeneralModuleTests) ... ok
test_weakref (__main__.GeneralModuleTests) ... ok
testFromFd (__main__.BasicTCPTest) ... ok
testOverFlowRecv (__main__.BasicTCPTest) ... ok
testOverFlowRecvFrom (__main__.BasicTCPTest) ... ok
testRecv (__main__.BasicTCPTest) ... ok
testRecvFrom (__main__.BasicTCPTest) ... ok
testSendAll (__main__.BasicTCPTest) ... ok
testShutdown (__main__.BasicTCPTest) ... ok
testClose (__main__.TCPCloserTest) ... ok
testInterruptedTimeout (__main__.TCPTimeoutTest) ... ok
testTCPTimeout (__main__.TCPTimeoutTest) ... ok
testTimeoutZero (__main__.TCPTimeoutTest) ... ok
testExceptionTree (__main__.TestExceptions) ... ok
testRecvFromInto (__main__.BufferIOTest) ... ok
testRecvInto (__main__.BufferIOTest) ... ok
testRecvFrom (__main__.BasicUDPTest) ... ok
testRecvFromNegative (__main__.BasicUDPTest) ... ok
testSendtoAndRecv (__main__.BasicUDPTest) ... ok
testTimeoutZero (__main__.UDPTimeoutTest) ... ok
testUDPTimeout (__main__.UDPTimeoutTest) ... ok
testAccept (__main__.NonBlockingTCPTests) ... ok
testConnect (__main__.NonBlockingTCPTests) ... ok
testRecv (__main__.NonBlockingTCPTests) ... ok
testSetBlocking (__main__.NonBlockingTCPTests) ... ok
testClosedAttr (__main__.FileObjectClassTestCase) ... ok
testFullRead (__main__.FileObjectClassTestCase) ... ok
testReadline (__main__.FileObjectClassTestCase) ... ok
testSmallRead (__main__.FileObjectClassTestCase) ... ok
testUnbufferedRead (__main__.FileObjectClassTestCase) ... ok
testClosedAttr (__main__.UnbufferedFileObjectClassTestCase) ... ok
testFullRead (__main__.UnbufferedFileObjectClassTestCase) ... ok
testReadline (__main__.UnbufferedFileObjectClassTestCase) ... ok
testSmallRead (__main__.UnbufferedFileObjectClassTestCase) ... ok
testUnbufferedRead (__main__.UnbufferedFileObjectClassTestCase) ... ok
testUnbufferedReadline (__main__.UnbufferedFileObjectClassTestCase) ... ok
testClosedAttr (__main__.LineBufferedFileObjectClassTestCase) ... ok
testFullRead (__main__.LineBufferedFileObjectClassTestCase) ... ok
testReadline (__main__.LineBufferedFileObjectClassTestCase) ... ok
testSmallRead (__main__.LineBufferedFileObjectClassTestCase) ... ok
testUnbufferedRead (__main__.LineBufferedFileObjectClassTestCase) ... ok
testClosedAttr (__main__.SmallBufferedFileObjectClassTestCase) ... ok
testFullRead (__main__.SmallBufferedFileObjectClassTestCase) ... ok
testReadline (__main__.SmallBufferedFileObjectClassTestCase) ... ok
testSmallRead (__main__.SmallBufferedFileObjectClassTestCase) ... ok
testUnbufferedRead (__main__.SmallBufferedFileObjectClassTestCase) ... ok
testClose (__main__.Urllib2FileobjectTest) ... ok
testRecv (__main__.BasicSocketPairTest) ... ok
testSend (__main__.BasicSocketPairTest) ... ok
testLinuxAbstractNamespace (__main__.TestLinuxAbstractNamespace) ... ok
testMaxName (__main__.TestLinuxAbstractNamespace) ... ok
testNameOverflow (__main__.TestLinuxAbstractNamespace) ... ok

==
ERROR: testGetServBy (__main__.GeneralModuleTests)
--
Traceback (most recent call last):
  File "./Lib/test/test_socket.py", line 344, in testGetServBy
eq(socket.getservbyport(port2), service)
error: port/proto not found

--
Ran 68 tests in 5.558s

FAILED (errors=1)
Traceback (most recent call last):
  File "./Lib/test/test_socket.py", line 995, in 
test_main()
  File "./Lib/test/test_socket.py", line 991, in test_main
test_support.run_unittest(*tests)
  File "/home/cartman/python-2.5/Lib/test/test_support.py", line 441, in
run_unittest
run_suite(suite, testclass)
  File "/home/cartman/python-2.5/Lib/test/test_support.py", line 426, in
run_suite
raise TestFailed(err)
test.test_support.TestFailed: Traceback (most recent call last):
  File "./Lib/test/test_socket.py", line 344, in t

[issue1609] test_re.py fails

2007-12-13 Thread Ismail Donmez

New submission from Ismail Donmez:

Using python 2.5 revision 59479 from release25-maint branch, 

[~/python-2.5]> LD_LIBRARY_PATH=/home/cartman/python-2.5: ./python
./Lib/test/test_re.py
test_anyall (__main__.ReTests) ... ok
test_basic_re_sub (__main__.ReTests) ... ok
test_bigcharset (__main__.ReTests) ... ok
test_bug_113254 (__main__.ReTests) ... ok
test_bug_1140 (__main__.ReTests) ... ok
test_bug_114660 (__main__.ReTests) ... ok
test_bug_117612 (__main__.ReTests) ... ok
test_bug_418626 (__main__.ReTests) ... ok
test_bug_448951 (__main__.ReTests) ... ok
test_bug_449000 (__main__.ReTests) ... ok
test_bug_449964 (__main__.ReTests) ... ok
test_bug_462270 (__main__.ReTests) ... ok
test_bug_527371 (__main__.ReTests) ... ok
test_bug_545855 (__main__.ReTests) ... ok
test_bug_581080 (__main__.ReTests) ... ok
test_bug_612074 (__main__.ReTests) ... ok
test_bug_725106 (__main__.ReTests) ... ok
test_bug_725149 (__main__.ReTests) ... ok
test_bug_764548 (__main__.ReTests) ... ok
test_bug_817234 (__main__.ReTests) ... ok
test_bug_926075 (__main__.ReTests) ... ok
test_bug_931848 (__main__.ReTests) ... ok
test_category (__main__.ReTests) ... ok
test_constants (__main__.ReTests) ... ok
test_empty_array (__main__.ReTests) ... ok
test_expand (__main__.ReTests) ... ok
test_finditer (__main__.ReTests) ... ok
test_flags (__main__.ReTests) ... ok
test_getattr (__main__.ReTests) ... ok
test_getlower (__main__.ReTests) ... ok
test_groupdict (__main__.ReTests) ... ok
test_ignore_case (__main__.ReTests) ... ok
test_non_consuming (__main__.ReTests) ... ok
test_not_literal (__main__.ReTests) ... ok
test_pickling (__main__.ReTests) ... ok
test_qualified_re_split (__main__.ReTests) ... ok
test_qualified_re_sub (__main__.ReTests) ... ok
test_re_escape (__main__.ReTests) ... ok
test_re_findall (__main__.ReTests) ... ok
test_re_groupref (__main__.ReTests) ... ok
test_re_groupref_exists (__main__.ReTests) ... ok
test_re_match (__main__.ReTests) ... ok
test_re_split (__main__.ReTests) ... ok
test_re_subn (__main__.ReTests) ... ok
test_repeat_minmax (__main__.ReTests) ... ok
test_scanner (__main__.ReTests) ... ok
test_search_coverage (__main__.ReTests) ... ok
test_search_star_plus (__main__.ReTests) ... ok
test_special_escapes (__main__.ReTests) ... ok
test_sre_character_class_literals (__main__.ReTests) ... ok
test_sre_character_literals (__main__.ReTests) ... ok
test_stack_overflow (__main__.ReTests) ... ok
test_sub_template_numeric_escape (__main__.ReTests) ... ok
test_symbolic_refs (__main__.ReTests) ... ok
test_weakref (__main__.ReTests) ... ok

--
Ran 55 tests in 0.194s

OK
Running re_tests test suite
=== Failed incorrectly ('(?u)\\b.\\b', u'\xc4', 0, 'found', u'\xc4')
=== Failed incorrectly ('(?u)\\w', u'\xc4', 0, 'found', u'\xc4')

--
components: Tests
messages: 58527
nosy: cartman
severity: normal
status: open
title: test_re.py fails
versions: Python 2.5

__
Tracker <[EMAIL PROTECTED]>

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



[issue1608] Regression tests crashes with gcc 4.3

2007-12-13 Thread Ismail Donmez

Ismail Donmez added the comment:

gdb backtrace, segfaulting test is Lib/test/test_str.py

Added file: http://bugs.python.org/file8936/backtrace.txt

__
Tracker <[EMAIL PROTECTED]>

__(gdb) run ./Lib/test/test_str.py
Starting program: /home/cartman/python-2.5/python ./Lib/test/test_str.py
test___contains__ (__main__.StrTest) ... ok
test_bug1001011 (__main__.StrTest) ... ok
test_capitalize (__main__.StrTest) ... ok
test_center (__main__.StrTest) ... ok
test_conversion (__main__.StrTest) ... ok
test_count (__main__.StrTest) ... ok
test_encoding_decoding (__main__.StrTest) ... ok
test_endswith (__main__.StrTest) ... ok

Program received signal SIGSEGV, Segmentation fault.
string_expandtabs (self=0xb7c069e0, args=0xb7c1ec2c) at 
Objects/stringobject.c:3358
3358*q++ = ' ';
(gdb) bt
#0  string_expandtabs (self=0xb7c069e0, args=0xb7c1ec2c) at 
Objects/stringobject.c:3358
#1  0xb7ee072d in PyCFunction_Call (func=0xb7c1ebac, arg=0xb7c1ec2c, 
kw=0xb7c16dfc) at Objects/methodobject.c:73
#2  0xb7ea6c47 in PyObject_Call (func=0xb7c1ecd4, arg=0xb7c1ec2c, 
kw=0xb7c16dfc) at Objects/abstract.c:1861
#3  0xb7f311a9 in PyEval_EvalFrameEx (f=0x80cfd64, throwflag=0) at 
Python/ceval.c:3849
#4  0xb7f340a5 in PyEval_EvalCodeEx (co=0xb7c71f98, globals=0xb7c6b4f4, 
locals=0x0, args=0xb7c0e2b8, argcount=4, kws=0x0, kwcount=0, defs=0x0, 
defcount=0,
closure=0x0) at Python/ceval.c:2832
#5  0xb7ecb3fe in function_call (func=0xb7c0125c, arg=0xb7c0e2ac, kw=0x0) at 
Objects/funcobject.c:517
#6  0xb7ea6c47 in PyObject_Call (func=0xb7c1ecd4, arg=0xb7c0e2ac, kw=0x0) at 
Objects/abstract.c:1861
#7  0xb7f311a9 in PyEval_EvalFrameEx (f=0x80cfbec, throwflag=0) at 
Python/ceval.c:3849
#8  0xb7f340a5 in PyEval_EvalCodeEx (co=0xb7c00e78, globals=0xb7c6d604, 
locals=0x0, args=0x80e4748, argcount=5, kws=0x80e475c, kwcount=0, defs=0x0,
defcount=0, closure=0x0) at Python/ceval.c:2832
#9  0xb7f32931 in PyEval_EvalFrameEx (f=0x80e460c, throwflag=0) at 
Python/ceval.c:3665
#10 0xb7f335be in PyEval_EvalFrameEx (f=0x80cd5ec, throwflag=0) at 
Python/ceval.c:3655
#11 0xb7f340a5 in PyEval_EvalCodeEx (co=0xb7c71cc8, globals=0xb7c6b4f4, 
locals=0x0, args=0xb7c14938, argcount=2, kws=0x80cc578, kwcount=0, 
defs=0xb7bfe898,
defcount=1, closure=0x0) at Python/ceval.c:2832
#12 0xb7ecb382 in function_call (func=0xb7c010d4, arg=0xb7c1492c, 
kw=0xb7c16c64) at Objects/funcobject.c:517
#13 0xb7ea6c47 in PyObject_Call (func=0xb7c1ecd4, arg=0xb7c1492c, 
kw=0xb7c16c64) at Objects/abstract.c:1861
#14 0xb7f311a9 in PyEval_EvalFrameEx (f=0x80cd484, throwflag=0) at 
Python/ceval.c:3849
#15 0xb7f340a5 in PyEval_EvalCodeEx (co=0xb7c71d10, globals=0xb7c6b4f4, 
locals=0x0, args=0xb7c148f8, argcount=2, kws=0x0, kwcount=0, defs=0x0, 
defcount=0,
closure=0x0) at Python/ceval.c:2832
#16 0xb7ecb3fe in function_call (func=0xb7c0110c, arg=0xb7c148ec, kw=0x0) at 
Objects/funcobject.c:517
#17 0xb7ea6c47 in PyObject_Call (func=0xb7c1ecd4, arg=0xb7c148ec, kw=0x0) at 
Objects/abstract.c:1861
#18 0xb7eaea25 in instancemethod_call (func=0xb7c0110c, arg=0xb7c148ec, kw=0x0) 
at Objects/classobject.c:2509
#19 0xb7ea6c47 in PyObject_Call (func=0xb7c1ecd4, arg=0xb7c148cc, kw=0x0) at 
Objects/abstract.c:1861
#20 0xb7f00d60 in slot_tp_call (self=0xb7c1438c, args=0xb7c148cc, kwds=0x0) at 
Objects/typeobject.c:4633
#21 0xb7ea6c47 in PyObject_Call (func=0xb7c1ecd4, arg=0xb7c148cc, kw=0x0) at 
Objects/abstract.c:1861
#22 0xb7f2f6cc in PyEval_EvalFrameEx (f=0x80cd31c, throwflag=0) at 
Python/ceval.c:3780
#23 0xb7f340a5 in PyEval_EvalCodeEx (co=0xb7c75458, globals=0xb7c6b4f4, 
locals=0x0, args=0xb7c141d8, argcount=2, kws=0x80c8b90, kwcount=0, defs=0x0,
defcount=0, closure=0x0) at Python/ceval.c:2832
#24 0xb7ecb382 in function_call (func=0xb7c014c4, arg=0xb7c141cc, 
kw=0xb7c16bdc) at Objects/funcobject.c:517
#25 0xb7ea6c47 in PyObject_Call (func=0xb7c1ecd4, arg=0xb7c141cc, 
kw=0xb7c16bdc) at Objects/abstract.c:1861
#26 0xb7f311a9 in PyEval_EvalFrameEx (f=0x80cd1b4, throwflag=0) at 
Python/ceval.c:3849
#27 0xb7f340a5 in PyEval_EvalCodeEx (co=0xb7c754a0, globals=0xb7c6b4f4, 
locals=0x0, args=0xb7c0ff58, argcount=2, kws=0x0, kwcount=0, defs=0x0, 
defcount=0,
closure=0x0) at Python/ceval.c:2832
#28 0xb7ecb3fe in function_call (func=0xb7c014fc, arg=0xb7c0ff4c, kw=0x0) at 
Objects/funcobject.c:517
#29 0xb7ea6c47 in PyObject_Call (func=0xb7c1ecd4, arg=0xb7c0ff4c, kw=0x0) at 
Objects/abstract.c:1861
#30 0xb7eaea25 in instancemethod_call (func=0xb7c014fc, arg=0xb7c0ff4c, kw=0x0) 
at Objects/classobject.c:2509
#31 0xb7ea6c47 in PyObject_Call (func=0xb7c1ecd4, arg=0xb7c1486c, kw=0x0) at 
Objects/abstract.c:1861
#32 0xb7f00d60 in slot_tp_call (self=0xb7c1412c, args=0xb7c1486c, kwds=0x0) at 
Objects/typeobject.c:4633
#33 0xb7ea6c47 in PyObject_Call (func=0xb7c1ecd4, arg=0xb7c1486c, kw=0x0) at 
Objects/abstract.c:1861
#34 0xb7f2f6cc in PyEval_EvalFrameEx (f=0x80cd04c, throwflag=

[issue1608] Regression tests crashes with gcc 4.3

2007-12-13 Thread Ismail Donmez

New submission from Ismail Donmez:

Checkout Python 2.5 from release25-maint branch, revision 59479

Compiled with gcc 4.3.0 20071212 , make test crashes with the following
output

[... snip ...]
test_socket_ssl
test_socket_ssl skipped -- Use of the `network' resource not enabled
test_socketserver
test_socketserver skipped -- Use of the `network' resource not enabled
test_softspace
test_sort
test_sqlite
test_startfile
test_startfile skipped -- cannot import name startfile
test_str
make: *** [test] Segmentation fault

--
components: Tests
messages: 58525
nosy: cartman
severity: normal
status: open
title: Regression tests crashes with gcc 4.3
type: crash
versions: Python 2.5

__
Tracker <[EMAIL PROTECTED]>

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



[issue1580] Use shorter float repr when possible

2007-12-13 Thread Noam Raphael

Noam Raphael added the comment:

2007/12/13, Guido van Rossum <[EMAIL PROTECTED]>:
>
> > Ok, so if I understand correctly, the ideal thing would be to
> > implement decimal to binary conversion by ourselves. This would make
> > str <-> float conversion do the same thing on all platforms, and would
> > make repr(1.1)=='1.1'. This would also allow us to define exactly how
> > floats operate, with regard to infinities and NaNs. All this is for
> > IEEE-754 platforms -- for the rare platforms which don't support it,
> > the current state remains.
>
> Does doubledigits.c not work for non-754 platforms?

No. It may be a kind of an oops, but currently it just won't compile
on platforms which it doesn't recognize, and it only recognizes 754
platforms.
>
> > 2. Keep the binary to shortest decimal routine and use it only when we
> > know that the system's decimal to binary routine is correctly rounding
> > (we can check - perhaps Microsoft has changed theirs?)
>
> Tim says you can't check (test) for this -- you have to prove it from
> source, or trust the vendor's documentation. I would have no idea
> where to find this documented.
>
The program for testing floating point compatibility is in
http://www.cant.ua.ac.be/ieeecc754.html

To run it, on my computer, I used:
./configure -target Conversions -platform IntelPentium_cpp
make
./IeeeCC754 -d -r n -n x Conversion/testsets/d2bconvd
less ieee.log

This tests only doubles, round to nearest, and ignores flags which
should be raised to signal inexact conversion. You can use any file in
Conversions/testsets/d2b* - I chose this one pretty randomly.

It turns out that even on my gcc 4.1.3 it finds a few floats not
correctly rounded. :(

Anyway, it can be used to test other platforms. If not by the
executable itself, we can pretty easily write a python program which
uses the test data.

I don't know what exactly the errors with gcc 4.1.3 mean - is there a
problem with the algorithm of glibc, or perhaps the testing program
didn't set some flag?

__
Tracker <[EMAIL PROTECTED]>

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



  1   2   >