[issue1329] Different 3.0a1 exit behavior

2007-10-29 Thread Christian Heimes

Christian Heimes added the comment:

Here you go, Guido!

Added file: http://bugs.python.org/file8647/py3k_closefd.patch

__
Tracker <[EMAIL PROTECTED]>

__Index: Python/pythonrun.c
===
--- Python/pythonrun.c	(revision 58695)
+++ Python/pythonrun.c	(working copy)
@@ -720,7 +720,7 @@
 
 	/* Set sys.stdin */
 	if (!(std = PyFile_FromFd(fileno(stdin), "", "r", -1,
-  NULL, "\n"))) {
+  NULL, "\n", 0))) {
 		goto error;
 	}
 	PySys_SetObject("__stdin__", std);
@@ -729,7 +729,7 @@
 
 	/* Set sys.stdout */
 	if (!(std = PyFile_FromFd(fileno(stdout), "", "w", -1,
-  NULL, "\n"))) {
+  NULL, "\n", 0))) {
 goto error;
 }
 	PySys_SetObject("__stdout__", std);
@@ -738,7 +738,7 @@
 
 	/* Set sys.stderr */
 	if (!(std = PyFile_FromFd(fileno(stderr), "", "w", -1,
-  NULL, "\n"))) {
+  NULL, "\n", 0))) {
 goto error;
 }
 PySys_SetObject("__stderr__", std);
Index: Python/import.c
===
--- Python/import.c	(revision 58695)
+++ Python/import.c	(working copy)
@@ -2588,7 +2588,7 @@
    (char*)PyUnicode_GetDefaultEncoding();
 		}
 		fob = PyFile_FromFd(fd, pathname, fdp->mode, -1,
-	(char*)encoding, NULL);
+(char*)encoding, NULL, -1);
 		if (fob == NULL) {
 			close(fd);
 			PyMem_FREE(found_encoding);
Index: Include/fileobject.h
===
--- Include/fileobject.h	(revision 58695)
+++ Include/fileobject.h	(working copy)
@@ -8,7 +8,8 @@
 
 #define PY_STDIOTEXTMODE "b"
 
-PyAPI_FUNC(PyObject *) PyFile_FromFd(int, char *, char *, int, char *, char *);
+PyAPI_FUNC(PyObject *) PyFile_FromFd(int, char *, char *, int, char *, char *,
+ int);
 PyAPI_FUNC(PyObject *) PyFile_GetLine(PyObject *, int);
 PyAPI_FUNC(int) PyFile_WriteObject(PyObject *, PyObject *, int);
 PyAPI_FUNC(int) PyFile_WriteString(const char *, PyObject *);
Index: Objects/fileobject.c
===
--- Objects/fileobject.c	(revision 58695)
+++ Objects/fileobject.c	(working copy)
@@ -27,15 +27,19 @@
 
 PyObject *
 PyFile_FromFd(int fd, char *name, char *mode, int buffering, char *encoding,
-	  char *newline)
+	  char *newline, int closefd)
 {
 	PyObject *io, *stream, *nameobj = NULL;
 
+	if (closefd < 0) {
+		closefd = 1;
+	}
+
 	io = PyImport_ImportModule("io");
 	if (io == NULL)
 		return NULL;
-	stream = PyObject_CallMethod(io, "open", "isiss", fd, mode,
- buffering, encoding, newline);
+	stream = PyObject_CallMethod(io, "open", "isissi", fd, mode,
+ buffering, encoding, newline, closefd);
 	Py_DECREF(io);
 	if (stream == NULL)
 		return NULL;
Index: Misc/NEWS
===
--- Misc/NEWS	(revision 58695)
+++ Misc/NEWS	(working copy)
@@ -28,6 +28,9 @@
   with `Py_FileSystemDefaultEncoding` and a new API method 
   `PyUnicode_DecodeFSDefault(char*)` was added.
 
+- io.open() and _fileio.FileIO have grown a new argument closefd. A false value
+  disables the closing of the file descriptor.
+
 Extension Modules
 -
 
Index: Doc/c-api/concrete.rst
===
--- Doc/c-api/concrete.rst	(revision 58696)
+++ Doc/c-api/concrete.rst	(working copy)
@@ -2401,12 +2401,12 @@
:ctype:`PyFileObject`.
 
 
-.. cfunction:: PyFile_FromFd(int fd, char *name, char *mode, int buffering, char *encoding, char *newline)
+.. cfunction:: PyFile_FromFd(int fd, char *name, char *mode, int buffering, char *encoding, char *newline, int closefd)
 
Create a new :ctype:`PyFileObject` from the file descriptor of an already
opened file *fd*. The arguments *name*, *encoding* and *newline* can be
-   *NULL* as well as buffering can be *-1* to use the defaults. Return *NULL* on
-   failure.
+   *NULL* as well as *buffering* and *closefd* can be *-1* to use the defaults.
+   Return *NULL* on failure.
 
.. warning::
 
Index: Lib/io.py
===
--- Lib/io.py	(revision 58695)
+++ Lib/io.py	(working copy)
@@ -49,7 +49,8 @@
 self.characters_written = characters_written
 
 
-def open(file, mode="r", buffering=None, encoding=None, newline=None):
+def open(file, mode="r", buffering=None, encoding=None, newline=None,
+ closefd=True):
 r"""Replacement for the built-in open function.
 
 Args:
@@ -81,6 +82,8 @@
   other legal values, any `'\n'` characters written are
   translated to the given string.
 
+  closefd: Disable the closing of the underlying file descriptor
+
 (*) If a file descriptor is given, it is closed when the returned
 I/O object is closed.  If you don't want this to happen, use
 os.dup()

[issue1352] Preliminary stderr patch

2007-10-29 Thread Christian Heimes

Christian Heimes added the comment:

Improved patch

--
nosy: +gvanrossum
Added file: http://bugs.python.org/file8648/py3k_preliminary_stderr2.patch

__
Tracker <[EMAIL PROTECTED]>

__Index: Python/pythonrun.c
===
--- Python/pythonrun.c	(revision 58695)
+++ Python/pythonrun.c	(working copy)
@@ -151,7 +151,7 @@
 {
 	PyInterpreterState *interp;
 	PyThreadState *tstate;
-	PyObject *bimod, *sysmod;
+	PyObject *bimod, *sysmod, *stderr;
 	char *p;
 #if defined(HAVE_LANGINFO_H) && defined(CODESET)
 	char *codeset;
@@ -228,6 +228,13 @@
 	PyDict_SetItemString(interp->sysdict, "modules",
 			 interp->modules);
 
+	/* set up a dump stderr printer until we have enough infrastructure
+   for the io module in place */
+	stderr = PyFile_NewStdPrinter(2);
+	if (stderr == NULL)
+		Py_FatalError("Py_Initialize: can't set preliminary stderr");
+	PySys_SetObject("stderr", stderr);
+
 	_PyImport_Init();
 
 	/* initialize builtin exceptions */
@@ -736,6 +743,9 @@
 	PySys_SetObject("stdout", std);
 	Py_DECREF(std);
 
+	/* Remove old stderr printer */
+	PySys_SetObject("stderr", NULL);
+
 	/* Set sys.stderr */
 	if (!(std = PyFile_FromFd(fileno(stderr), "", "w", -1,
   NULL, "\n"))) {
Index: Include/fileobject.h
===
--- Include/fileobject.h	(revision 58695)
+++ Include/fileobject.h	(working copy)
@@ -8,6 +8,10 @@
 
 #define PY_STDIOTEXTMODE "b"
 
+PyAPI_DATA(PyTypeObject) PyStdPrinter_Type;
+
+PyAPI_FUNC(PyObject *) PyFile_NewStdPrinter(int);
+
 PyAPI_FUNC(PyObject *) PyFile_FromFd(int, char *, char *, int, char *, char *);
 PyAPI_FUNC(PyObject *) PyFile_GetLine(PyObject *, int);
 PyAPI_FUNC(int) PyFile_WriteObject(PyObject *, PyObject *, int);
Index: Objects/object.c
===
--- Objects/object.c	(revision 58695)
+++ Objects/object.c	(working copy)
@@ -1595,6 +1595,9 @@
 
 	if (PyType_Ready(&PyCode_Type) < 0)
 		Py_FatalError("Can't initialize 'code'");
+
+	if (PyType_Ready(&PyStdPrinter_Type) < 0)
+		Py_FatalError("Can't initialize StderrPrinter");
 }
 
 
Index: Objects/fileobject.c
===
--- Objects/fileobject.c	(revision 58695)
+++ Objects/fileobject.c	(working copy)
@@ -325,6 +325,129 @@
 	return buf;
 }
 
+/*  std printer  */
+
+typedef struct {
+	PyObject_HEAD
+	int fd : 1;
+} PyStdPrinter_Object;
+
+static PyObject *
+stdprinter_new(PyTypeObject *type, PyObject *args, PyObject *kews)
+{
+	PyStdPrinter_Object *self;
+
+	assert(type != NULL && type->tp_alloc != NULL);
+
+	self = (PyStdPrinter_Object *) type->tp_alloc(type, 0);
+	if (self != NULL) {
+		self->fd = -1;
+	}
+
+	return (PyObject *) self;
+}
+
+PyObject *
+PyFile_NewStdPrinter(int fd)
+{
+	PyStdPrinter_Object *self;
+
+	if (fd != 1 && fd != 2) {
+		PyErr_BadInternalCall();
+		return NULL;
+	}
+
+	self = PyObject_New(PyStdPrinter_Object,
+			&PyStdPrinter_Type);
+	self->fd = fd;
+	return (PyObject*)self;
+}
+
+PyObject *
+stdprinter_write(PyStdPrinter_Object *self, PyObject *args)
+{
+	PyObject *d;
+	char *c = NULL;
+	Py_ssize_t size = -1;
+
+	if (!PyArg_ParseTuple(args, "O:write", &d))
+		return NULL;
+
+	if (PyBytes_Check(d)) {
+		c = PyBytes_AS_STRING(d);
+		size = PyBytes_Size(d);
+	}
+	else if (PyString_Check(d)) {
+		if (PyString_AsStringAndSize(d, &c, &size) == 0) {
+			c = NULL;
+		}
+	} else if (PyUnicode_Check(d)) {
+		c = PyUnicode_AsStringAndSize(d, &size);
+} else {
+		PyErr_SetString(PyExc_TypeError, 
+"Can only write bytes, string and unicode!");
+		return NULL;
+	}
+
+	if (c == NULL || size < 0) {
+		PyErr_SetString(PyExc_ValueError, "no string");
+		return NULL;
+	}
+
+	write(self->fd, c, size);
+
+	Py_RETURN_NONE;
+}
+
+static PyMethodDef stdprinter_methods[] = {
+	{"write", (PyCFunction)stdprinter_write, METH_VARARGS, ""},
+ 	{NULL,		NULL}		/* sentinel */
+};
+
+PyTypeObject PyStdPrinter_Type = {
+	PyVarObject_HEAD_INIT(&PyType_Type, 0)
+	"stderrprinter",			/* tp_name */
+	sizeof(PyStdPrinter_Object),		/* tp_basicsize */
+	0,	/* tp_itemsize */
+	/* methods */
+	0,	/* tp_dealloc */
+	0,	/* tp_print */
+	0,	/* tp_getattr */
+	0,	/* tp_setattr */
+	0,	/* tp_compare */
+	0,	/* tp_repr */
+	0,	/* tp_as_number */
+	0,	/* tp_as_sequence */
+	0,	/* tp_as_mapping */
+	0,	/* tp_hash */
+	0,	/* tp_call */
+	0,	/* tp_str */
+	PyObject_GenericGetAttr,		/* tp_getattro */
+	0,	/* tp_setattro */
+	0,	/* tp_as_buffer */
+	Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,/* tp_flags */
+	0,	/* tp_doc */
+	0,	/* tp_traverse */
+	0,	/* tp_clear */
+	0,	/* tp_richcompare */
+	0,	/* tp_weaklistoffset */
+	0,	/* tp_iter */
+	0,	/* tp_iternext */
+	std

[issue1353] mp4 missing from mimetypes.py

2007-10-29 Thread Jacob

New submission from Jacob:

mp4 is missing from the mimetypes.py list of valid mimetypes. mp4 is 
registered with IANA and is defined in the mpeg-4 standard as a container 
for mpeg-4 codecs such as h264. Lack of this definition means the format 
cannot be recognised by software dependsing on the mimetypes modules, that 
don't use one of the suggested local mime definitions (OpenBSD).

--
components: Library (Lib)
files: mimetypes.py.patch
messages: 56900
nosy: kraft
severity: normal
status: open
title: mp4 missing from mimetypes.py
type: rfe
versions: Python 2.1.1, Python 2.1.2, Python 2.2, Python 2.2.1, Python 2.2.2, 
Python 2.2.3, Python 2.3, Python 2.4, Python 2.5
Added file: http://bugs.python.org/file8649/mimetypes.py.patch

__
Tracker <[EMAIL PROTECTED]>

__--- mimetypes.py.orig   Mon Oct 29 23:47:08 2007
+++ mimetypes.pyMon Oct 29 23:19:05 2007
@@ -391,6 +391,7 @@
 '.movie'  : 'video/x-sgi-movie',
 '.mp2': 'audio/mpeg',
 '.mp3': 'audio/mpeg',
+'.mp4': 'video/mp4',
 '.mpa': 'video/mpeg',
 '.mpe': 'video/mpeg',
 '.mpeg'   : 'video/mpeg',
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1354] windows installer problem

2007-10-29 Thread Raja R

New submission from Raja R:

Hi,
  I downloaded the python-2.5.msi yesterday and tried installing it 
but i am getting the following error "This installation package could 
not be opened . cOntact the application vendor to verify that this is 
a valid WIndows Installer package."

I was able to install python 2.4.4 successfully in my system. I want 
python 2.5 urgently as I need to work in PyQt.

My machine config is: Microsoft Windows XP, Media Center Edition 
Version 2002, Service Pack 2. 

Please advice on this problem at the earliest.

Thanks,
Raja.

--
components: Installation
messages: 56901
nosy: rajar
severity: urgent
status: open
title: windows installer problem
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



[issue1355] xml.dom refers to PyXML, which is no longer maintained

2007-10-29 Thread whooey1830

New submission from whooey1830:

http://docs.python.org/dev/library/xml.dom.html#module-xml.dom

"PyXML
Users that require a full-featured implementation of DOM should use
the PyXML package."

PyXML however is no longer maintained. Is it a wise idea to link to that
resource? Novice users might trust blindly, before finding out about the
restrictions they are going to face (maintainence, code fixes..) I
suggest adding at least information, that no code fixes are being done,
but documentation on the pyxml website is still updated (Thats how i've
understood their website. Please correct me if i am wrong. I'm feeling a
bit frustrated having spent time with a package, which is no longer
maintained, to be honest.)

--
components: Documentation
messages: 56902
nosy: whooey1830
severity: normal
status: open
title: xml.dom refers to PyXML, which is no longer maintained
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



[issue1183] race in SocketServer.ForkingMixIn.collect_children

2007-10-29 Thread David Ripton

David Ripton added the comment:

No signal handler.  Yes, we run subprocesses.

I don't believe either is necessary to trigger the race condition, though.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1612746] Enhanced tabbed pane widget

2007-10-29 Thread Tal Einat

Tal Einat added the comment:

Update, as requested.

After the recent configDialog.py changes, very little changes to it are
required.

I've included a much updated version of tabbedPages.py in this patch.
Since posting the original patch, I've discovered and fixed a few bugs,
implemented a 3d look for the tabs, and cleaned up the code. This
version has also been tested more thoroughly.

Also, this version very nicely supports tabbed panes with more than one
row of tabs. However you can't see this with configDialog.py, you'll
have to use the test code to check it out (just add several new pages
and then play around with them). I've used this feature in implementing
the extension config dialog, where every extension gets its own tab. I
hope I can finally get to posting a patch for it...

Enjoy!

Added file: http://bugs.python.org/file8650/IDLE_tabbedPages.071029.patch

_
Tracker <[EMAIL PROTECTED]>

_

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



[issue1354] windows installer problem

2007-10-29 Thread Raghuram Devarakonda

Raghuram Devarakonda added the comment:

I installed python 2.5 on multiple windows machines and had no problem.
How ever, this doesn't look like it belongs in bug tracker. You will
have better chance if you post to comp.lang.python.

--
nosy: +draghuram

__
Tracker <[EMAIL PROTECTED]>

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



[issue1320] PCBuild8 Solution Support Changes

2007-10-29 Thread Kevin Watters

Kevin Watters added the comment:

This patch did not work for me.

After running build_ssl.bat, the last couple lines of my console are:

cl /Fotmp32dll\cfb_enc.obj  -Iinc32 -Itmp32dll /MD /Ox /O2 /Ob2
/W3 /WX
/Gs0 /GF /Gy /nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN
-DL_ENDIAN -D
DSO_WIN32 -D_CRT_SECURE_NO_DEPRECATE -DBN_ASM -DMD5_ASM -DSHA1_ASM
-DRMD160_ASM
-DOPENSSL_USE_APPLINK -I. /Fdout32dll -DOPENSSL_NO_IDEA -DOPENSSL_NO_RC5
-DOPENS
SL_NO_MDC2 -DOPENSSL_NO_KRB5 -D_WINDLL  -DOPENSSL_BUILD_SHLIBCRYPTO -c
.\crypto\
des\cfb_enc.c
cfb_enc.c
cl /Fotmp32dll\ofb64ede.obj  -Iinc32 -Itmp32dll /MD /Ox /O2 /Ob2
/W3 /WX
 /Gs0 /GF /Gy /nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN
-DL_ENDIAN -
DDSO_WIN32 -D_CRT_SECURE_NO_DEPRECATE -DBN_ASM -DMD5_ASM -DSHA1_ASM
-DRMD160_ASM
 -DOPENSSL_USE_APPLINK -I. /Fdout32dll -DOPENSSL_NO_IDEA
-DOPENSSL_NO_RC5 -DOPEN
SSL_NO_MDC2 -DOPENSSL_NO_KRB5 -D_WINDLL  -DOPENSSL_BUILD_SHLIBCRYPTO -c
.\crypto
\des\ofb64ede.c
ofb64ede.c
cl /Fotmp32dll\enc_read.obj  -Iinc32 -Itmp32dll /MD /Ox /O2 /Ob2
/W3 /WX
 /Gs0 /GF /Gy /nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN
-DL_ENDIAN -
DDSO_WIN32 -D_CRT_SECURE_NO_DEPRECATE -DBN_ASM -DMD5_ASM -DSHA1_ASM
-DRMD160_ASM
 -DOPENSSL_USE_APPLINK -I. /Fdout32dll -DOPENSSL_NO_IDEA
-DOPENSSL_NO_RC5 -DOPEN
SSL_NO_MDC2 -DOPENSSL_NO_KRB5 -D_WINDLL  -DOPENSSL_BUILD_SHLIBCRYPTO -c
.\crypto
\des\enc_read.c
enc_read.c
.\crypto\des\enc_read.c(150) : error C2220: warning treated as error -
no 'objec
t' file generated
.\crypto\des\enc_read.c(150) : warning C4996: 'read' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\io.h(329)
: see de
claration of 'read'
Message: 'The POSIX name for this item is deprecated. Instead,
use the I
SO C++ conformant name: _read. See online help for details.'
.\crypto\des\enc_read.c(172) : warning C4996: 'read' was declared deprecated
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\io.h(329)
: see de
claration of 'read'
Message: 'The POSIX name for this item is deprecated. Instead,
use the I
SO C++ conformant name: _read. See online help for details.'
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio
8\VC\BIN\c
l.EXE"' : return code '0x2'
Stop.
Executing ms\ntdll.mak failed
2

--
nosy: +kevinwatters

__
Tracker <[EMAIL PROTECTED]>

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



[issue1320] PCBuild8 Solution Support Changes

2007-10-29 Thread Christian Heimes

Christian Heimes added the comment:

Kevin,

It's a known issue which is solved in newer version of OpenSSL. I hope
to convince somebody to update the packages someday.

--
nosy: +tiran

__
Tracker <[EMAIL PROTECTED]>

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



[issue1462525] URI parsing library

2007-10-29 Thread Isaac Morland

Isaac Morland added the comment:

This is probably overkill, but I've created a Python script (attached)
that runs all the tests given in Section 5.4 of RFC 3986.  It reports
the following:

baseurl=http://a/b/c/d;p?q
failed for ?y: got http://a/b/c/?y, expected http://a/b/c/d;p?y
failed for ../../../g: got http://a/../g, expected http://a/g
failed for ../../../../g: got http://a/../../g, expected http://a/g
failed for /./g: got http://a/./g, expected http://a/g
failed for /../g: got http://a/../g, expected http://a/g
failed for http:g: got http://a/b/c/g, expected http:g

The last of these is sanctioned by the RFC as acceptable for backward
compatibility, so I'll ignore that.  The remainder suggest that in
addition to the query-relative bug, there is a problem with not reducing
"/./" to just "/", and with dropping excess occurrences of ".." that
would go above the root.  On the other hand, these additional issues are
listed in the RFC as "abnormal" so I'm not sure if people are going to
want to put in the time to address them.

--
nosy: +ijmorlan
Added file: http://bugs.python.org/file8651/testurlparse.py

_
Tracker <[EMAIL PROTECTED]>

_

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



[issue1356] 3.0a1 Solaris w/ SUN C/C++

2007-10-29 Thread Jean Brouwers

New submission from Jean Brouwers:

Building 3.0a1 on Solaris 10 using SUN's C/C++ compilers fails due to 
one compilation error.

The problem is the name of the last argument 'restrict' of function 
analyze_cells on line 473 in file Python/symtable.c.  Changing that name 
to something else like 'restricted' makes the build build.

There is an '*** Error code 1' at the very end of  make test, but that 
is a separate issue.   

The ./configure command line needs to include the options  --without-gcc 
and  --with-cxx-main=CC.

This is Solaris 10 on an Ultra 20 (Opteron) machine with SUN C/C++ 5.8 
2005/10/13.

--
components: Build
messages: 56908
nosy: MrJean1
severity: normal
status: open
title: 3.0a1 Solaris w/ SUN C/C++
type: compile error
versions: 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



[issue1357] 3.0a1 make test Error on Solaris w/ SUN C/C++

2007-10-29 Thread Jean Brouwers

New submission from Jean Brouwers:

The 3.0a1 Solaris build (see issue #1356) fails at the end of  make test 
with the following error:


test_zlib
278 tests OK.
5 tests failed:
test_cookielib test_email test_fileio test_pipes test_uuid
39 tests skipped:
test_aepack test_applesingle test_bsddb test_bsddb3
test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp
test_codecmaps_kr test_codecmaps_tw test_ctypes test_curses
test_gdbm test_hashlib test_hmac test_macostools
test_normalization test_ossaudiodev test_pep277 test_plistlib
test_scriptpackages test_socket_ssl test_socketserver test_sqlite
test_ssl test_startfile test_sundry test_tarfile test_tcl
test_timeout test_unicode_file test_unicodedata test_urllib2
test_urllib2_localnet test_urllib2net test_urllibnet test_winreg
test_winsound test_xmlrpc_net test_zipfile64
11 skips unexpected on sunos5:
test_hashlib test_hmac test_urllib2_localnet test_urllib2net
test_ctypes test_urllib2 test_tcl test_sundry test_ssl
test_tarfile test_unicodedata
*** Error code 1
make: Fatal error: Command failed for target `test'

The entire log of  make test is attached.  If you need other make or  
configure logs or if I should rebuild with other options, let me know.

--
components: Tests
files: log.make_test
messages: 56910
nosy: MrJean1
severity: normal
status: open
title: 3.0a1 make test Error on  Solaris w/ SUN C/C++
versions: Python 3.0
Added file: http://bugs.python.org/file8652/log.make_test

__
Tracker <[EMAIL PROTECTED]>

__cc -c  -DNDEBUG -O  -I. -I./Include  -DPy_BUILD_CORE -o Python/symtable.o 
Python/symtable.c
cc -c  -DNDEBUG -O  -I. -I./Include  -DPy_BUILD_CORE -DSVNVERSION=\"`LC_ALL=C 
echo exported`\" -o Modules/getbuildinfo.o ./Modules/getbuildinfo.c
rm -f libpython3.0.a
ar cr libpython3.0.a Modules/getbuildinfo.o
ar cr libpython3.0.a Modules/_typesmodule.o
ar cr libpython3.0.a 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 
Parser/myreadline.o Parser/tokenizer.o
ar cr libpython3.0.a Objects/abstract.o  Objects/boolobject.o  
Objects/bufferobject.o  Objects/bytesobject.o  Objects/cellobject.o  
Objects/classobject.o  Objects/cobject.o  Objects/codeobject.o  
Objects/complexobject.o  Objects/descrobject.o  Objects/enumobject.o  
Objects/exceptions.o  Objects/genobject.o  Objects/fileobject.o  
Objects/floatobject.o  Objects/frameobject.o  Objects/funcobject.o  
Objects/iterobject.o  Objects/listobject.o  Objects/longobject.o  
Objects/dictobject.o  Objects/memoryobject.o  Objects/methodobject.o  
Objects/moduleobject.o  Objects/object.o  Objects/obmalloc.o  
Objects/rangeobject.o  Objects/setobject.o  Objects/sliceobject.o  
Objects/stringobject.o  Objects/structseq.o  Objects/tupleobject.o  
Objects/typeobject.o  Objects/weakrefobject.o  Objects/unicodeobject.o 
Objects/unicodectype.o
ar cr libpython3.0.a Python/Python-ast.o  Python/asdl.o  Python/ast.o  
Python/bltinmodule.o  Python/ceval.o  Python/compile.o  Python/codecs.o  
Python/errors.o  Python/frozen.o  Python/frozenmain.o  Python/future.o  
Python/getargs.o  Python/getcompiler.o  Python/getcopyright.o  
Python/getmtime.o  Python/getplatform.o  Python/getversion.o  Python/graminit.o 
 Python/import.o  Python/importdl.o  Python/marshal.o  Python/modsupport.o  
Python/mystrtoul.o  Python/mysnprintf.o  Python/peephole.o  Python/pyarena.o  
Python/pyfpe.o  Python/pystate.o  Python/pythonrun.o  Python/structmember.o  
Python/symtable.o  Python/sysmodule.o  Python/traceback.o  Python/getopt.o  
Python/pystrtod.o  Python/formatter_unicode.o  Python/dynload_shlib.o
Python/thread.o
ar cr libpython3.0.a Modules/config.o  Modules/getpath.o  Modules/main.o  
Modules/gcmodule.o 
ar cr libpython3.0.a Modules/threadmodule.o  Modules/signalmodule.o  
Modules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  
Modules/_sre.o  Modules/_codecsmodule.o  Modules/_fileio.o  Modules/zipimport.o 
 Modules/symtablemodule.o  Modules/xxsubtype.o
ranlib libpython3.0.a
CC   -o python \
Modules/python.o \
libpython3.0.a -lresolv -lsocket -lnsl -lrt -ldl   -lm  
running build
running build_ext
INFO: Can't locate Tcl/Tk libs and/or headers
building '_ctypes' extension
cc -Kpic -DNDEBUG -O -I. -I/home2/jean/tools/Python-3.0a1/./Include 
-Ibuild/temp.solaris-2.10-i86pc-3.0/libffi/include 
-Ibuild/temp.solaris-2.10-i86pc-3.0/libffi 
-I/home2/jean/tools/Python-3.0a1/Modules/_ctypes/libffi/src -I./Include -I. 
-I/home2/jean/tools/Python-3.0a1/Include -I/home2/jean/tools/Python-3.0a1 -c 
/home2/jean/tools/Python-3.0a1/Modules/_ctypes/_ctypes.c -o 
build/temp.solaris-2.10-i86pc-3.0/home2/jean/tools/Python-3.0a1/Modules/_ctypes/_ctypes.o
"build/temp.solaris-2.10-i86pc-3.0/libffi/incl

[issue1612746] Enhanced tabbed pane widget

2007-10-29 Thread Tal Einat

Tal Einat added the comment:

Bah, sorry, included wrong version of tabbedPages.py in the previous patch.

(differences are very minor, just some code cleanup and one very minor bug)

Added file: http://bugs.python.org/file8653/IDLE_tabbedPages.071029.patch

_
Tracker <[EMAIL PROTECTED]>

_

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



[issue1340] correction for test_tempfile in py3k on Windows

2007-10-29 Thread Guido van Rossum

Guido van Rossum added the comment:

New Revision: 58701.

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



[issue1357] 3.0a1 make test Error on Solaris w/ SUN C/C++

2007-10-29 Thread Christian Heimes

Christian Heimes added the comment:

Please run the test suite in verbose mode and attach the output:

$ ./python Lib/test/regrtest.py -v test_cookielib test_email test_fileio
test_pipes test_uuid

You seem to missing some packages to build additional extensions. Can
you install sqlite, openssl, readline, TCL/TK, curses and BSDDB?

--
nosy: +tiran

__
Tracker <[EMAIL PROTECTED]>

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



[issue1348] httplib closes socket, then tries to read from it

2007-10-29 Thread Guido van Rossum

Guido van Rossum added the comment:

I don't think that patch is the right thing either.  Certainly the
comment on the line you're proposing to delete is suggesting that the
close() call was added for a reason.

--
nosy: +gvanrossum

__
Tracker <[EMAIL PROTECTED]>

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



[issue1349] more uses of ord() in plat-mac/ic.py

2007-10-29 Thread Guido van Rossum

Guido van Rossum added the comment:

Looks good, though I can't find anything that would test this.

Can you check this in yourself?

--
assignee: nnorwitz -> janssen
nosy: +gvanrossum

__
Tracker <[EMAIL PROTECTED]>

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



[issue1345] Fix for test_netrc on Windows

2007-10-29 Thread Guido van Rossum

Guido van Rossum added the comment:

Are you sure this is the proper fix? Why does netrc.py insist on not
having \r\n line endings?  It opens the file in text mode so I don't
quite understand your 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



[issue1347] BaseHTTPServer writing strings to bytes interface

2007-10-29 Thread Guido van Rossum

Guido van Rossum added the comment:

Looks good. You can check this in yourself right?

--
assignee:  -> janssen
nosy: +gvanrossum
resolution:  -> accepted

__
Tracker <[EMAIL PROTECTED]>

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



[issue1341] correction for test_fileinput in py3k on Windows

2007-10-29 Thread Guido van Rossum

Guido van Rossum added the comment:

Thanks, good catch!

Committed revision 58704.

(in the py3k branch)

--
nosy: +gvanrossum
resolution:  -> accepted
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



[issue1339] smtplib starttls() should ehlo() if it needs to

2007-10-29 Thread Guido van Rossum

Guido van Rossum added the comment:

You'll get more traction on this if you submit a 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



[issue1358] Compile error on OS X 10.5

2007-10-29 Thread andres

New submission from andres:

Compiling python 2.5.1 on Mac OS X 10.5 (Leopard) fails with the
following message:

gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp
-mno-fused-madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes  -I.
-I./Include   -DPy_BUILD_CORE  -c ./Modules/posixmodule.c -o
Modules/posixmodule.o
./Modules/posixmodule.c: In function ‘posix_setpgrp’:
./Modules/posixmodule.c:3592: error: too few arguments to function ‘setpgrp’
make: *** [Modules/posixmodule.o] Error 1

I am also attaching the output of the configuration script.

--
components: Macintosh
files: configure.txt
messages: 56921
nosy: andres
severity: major
status: open
title: Compile error on OS X 10.5
type: compile error
versions: Python 2.5
Added file: http://bugs.python.org/file8655/configure.txt

__
Tracker <[EMAIL PROTECTED]>

__checking MACHDEP... darwin
checking EXTRAPLATDIR... $(PLATMACDIRS)
checking for --without-gcc... no
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for --with-cxx-main=... no
checking for g++... g++
configure: WARNING:

  By default, distutils will build C++ extension modules with "g++".
  If this is not intended, then set CXX on the configure command line.
  
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for AIX... no
checking for --with-suffix... 
checking for case-insensitive build directory... yes
checking LIBRARY... libpython$(VERSION).a
checking LINKCC... $(PURIFY) $(MAINCC)
checking for --enable-shared... no
checking for --enable-profiling... 
checking LDLIBRARY... libpython$(VERSION).a
checking for ranlib... ranlib
checking for ar... ar
checking for svnversion... found
checking for a BSD-compatible install... /usr/bin/install -c
checking for --with-pydebug... no
checking whether gcc accepts -fno-strict-aliasing... yes
checking whether gcc accepts -OPT:Olimit=0... no
checking whether gcc accepts -Olimit 1500... no
checking whether pthreads are available without options... yes
checking whether g++ also accepts flags for thread support... no
checking for ANSI C header files... rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking asm/types.h usability... no
checking asm/types.h presence... no
checking for asm/types.h... no
checking conio.h usability... no
checking conio.h presence... no
checking for conio.h... no
checking curses.h usability... yes
checking curses.h presence... yes
checking for curses.h... yes
checking direct.h usability... no
checking direct.h presence... no
checking for direct.h... no
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking grp.h usability... yes
checking grp.h presence... yes
checking for grp.h... yes
checking shadow.h usability... no
checking shadow.h presence... no
checking for shadow.h... no
checking io.h usability... no
checking io.h presence... no
checking for io.h... no
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking libintl.h usability... no
checking libintl.h presence... no
checking for libintl.h... no
checking ncurses.h usability... yes
checking ncurses.h presence... yes
checking for ncurses.h... yes
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking process.h usability... no
checking process.h presence... no
checking for process.h... no
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking stropts.h usability... no
checking stropts.h presence... no
checking for stropts.h... no
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking thread.h usability... no
checking thread.h presence... no
checking for thread.h... no
checking for unistd.h... (cached) yes
checking utime.h usability... yes
checking utime.h presence... yes
checking for utime.h... yes
checking sys/audioio.h usability... no
checking sys/audioi

[issue1252] IDLE - patch Delegator to support callables

2007-10-29 Thread Tal Einat

Tal Einat added the comment:

I'm trying to keep this as simple as possible, because it seems we're
tending to over-complicate.

We're discussing two distinct issues:

1) Should Delegator delegate calls to callables
2) Should Percolator inherit from Delegator

Have I missed something?


Regarding the first issue, I do think Delegator should do this, because
I view calling a callable as a special case of calling a method. To
illustrate my point, please take the code in example1.py, run it once
with Delegator as it is, and run it again after adding the __call__
method to Delegator's definition.



Regarding the second issue, I don't think I can put my thoughts better
than I already have:

As for Percolator, it really "is a" delegator -- it delegates attribute
access to the bottom of the chain, unless it is explicitly overridden.
True, in a "normal" Delegator this overriding can only be done in one
place, and in a Percolator it can also happen in any of the chain's
links. But the concept is identical -- it is a transparent proxy for an
underlying object.


Added file: http://bugs.python.org/file8654/example1.py

__
Tracker <[EMAIL PROTECTED]>

__import traceback
from Delegator import Delegator

class Callable(object):
def __call__(self, *args, **kw):
return args, kw

def method(self, *args, **kw):
return args, kw

if __name__ == '__main__':
delegator = Delegator(Callable())

print 'Normal method call:',
print delegator.method('one', two='two')

print '"Direct" call (the underlying object is callable):',
try:
print delegator('one', two='two')
except:
print
traceback.print_exc()
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1355] xml.dom refers to PyXML, which is no longer maintained

2007-10-29 Thread Martin v. Löwis

Martin v. Löwis added the comment:

Yes, the documentation should be changed. I feel sorry that you've
wasted your time.

--
nosy: +loewis

__
Tracker <[EMAIL PROTECTED]>

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



[issue1354] windows installer problem

2007-10-29 Thread Martin v. Löwis

Martin v. Löwis added the comment:

Indeed, this tracker is not about obtaining support. It is a place for
you to help us, not for us to help you.

If you want to help, please report the precise URL, and compute and
report the md5sum of the file you downloaded.

--
nosy: +loewis

__
Tracker <[EMAIL PROTECTED]>

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



[issue1353] mp4 missing from mimetypes.py

2007-10-29 Thread Guido van Rossum

Guido van Rossum added the comment:

Committed revision 58706.

This is in the trunk, i.e. what will become Python 2.6.  I don't think
it's worth fixing in 2.5.2, but if you really think it should go there
as well, petition Neal Norwitz.

--
nosy: +gvanrossum
resolution:  -> accepted
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



[issue1357] 3.0a1 make test Error on Solaris w/ SUN C/C++

2007-10-29 Thread Guido van Rossum

Guido van Rossum added the comment:

If this report is simply due to the lack of certain required packages,
can it just be closed as invalid?

--
nosy: +gvanrossum

__
Tracker <[EMAIL PROTECTED]>

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



[issue1089358] need siginterrupt() on Linux - impossible to do timeouts

2007-10-29 Thread Ralf Schmitt

Ralf Schmitt added the comment:

here is a patch against 2.5.1

Added file: http://bugs.python.org/file8657/patch

_
Tracker <[EMAIL PROTECTED]>

_

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



[issue1329] Different 3.0a1 exit behavior

2007-10-29 Thread Guido van Rossum

Changes by Guido van Rossum:


--
assignee:  -> gvanrossum

__
Tracker <[EMAIL PROTECTED]>

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



[issue1357] 3.0a1 make test Error on Solaris w/ SUN C/C++

2007-10-29 Thread Jean Brouwers

Jean Brouwers added the comment:

Close it for now.  Once I have the missing packages installed I will try 
again.

My main concern was not the actual test failures, but the  make test *** 
Error 1 ... itself.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1356] 3.0a1 Solaris w/ SUN C/C++

2007-10-29 Thread Martin v. Löwis

Martin v. Löwis added the comment:

Thanks for the report. Fixed in r58705.

--
nosy: +loewis

__
Tracker <[EMAIL PROTECTED]>

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



[issue1359] py3k: out of bounds read in PyUnicode_DecodeUnicodeEscape

2007-10-29 Thread Guido van Rossum

Guido van Rossum added the comment:

Thanks!!

The patch as given doesn't quite work -- it gives an error message on
string literals like '\s'.  By reverting some of your code and only
keeping the bounds checks for the octal escape code I got it to work
though.  See my checkin.

Committed revision 58707.

This needs to be backported too; it seems a pure coincidence it didn't
trigger before!

--
assignee:  -> gvanrossum
resolution:  -> accepted
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



[issue1358] Compile error on OS X 10.5

2007-10-29 Thread andres

andres added the comment:

I've attached a compressed config.log.

Incidentally, we were able to get Python to compile by appending the  
following line to pyconfig.h:
#define SETPGRP_HAVE_ARG

-Andres

On Oct 29, 2007, at 1:00 PM, Martin v. Löwis wrote:

>
> Martin v. Löwis added the comment:
>
> Can you please also attach config.log (perhaps compressed)?
>
> --
> nosy: +loewis
>
> __
> Tracker <[EMAIL PROTECTED]>
> 
> __

Added file: http://bugs.python.org/file8659/unnamed
Added file: http://bugs.python.org/file8660/config.log.gz
Added file: http://bugs.python.org/file8661/unnamed

__
Tracker <[EMAIL PROTECTED]>

__I've attached a compressed 
config.log.Incidentally, we were able to get Python to compile by 
appending the following line to pyconfig.h:#define
SETPGRP_HAVE_ARG-Andres


config.log.gz
Description: GNU Zip compressed data
On Oct 29, 2007, at 
1:00 PM, Martin v. Löwis wrote:Martin v. Löwis 
added the comment:Can you please also attach config.log (perhaps 
compressed)?--nosy: 
+loewis__Tracker [EMAIL PROTECTED]>http://bugs.python.org/issue1358>__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1357] 3.0a1 make test Error on Solaris w/ SUN C/C++

2007-10-29 Thread Guido van Rossum

Guido van Rossum added the comment:

Closing.

The make fatal error is just what make prints when a command fails with
a nonzero exit code; regrtest.py returns a nonzero exit code to the
shell for just this purpose.

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



[issue1171] allow subclassing of bytes type

2007-10-29 Thread Guido van Rossum

Changes by Guido van Rossum:


--
priority: normal -> high

__
Tracker <[EMAIL PROTECTED]>

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



[issue1358] Compile error on OS X 10.5

2007-10-29 Thread Martin v. Löwis

Martin v. Löwis added the comment:

Can you please also attach config.log (perhaps compressed)?

--
nosy: +loewis

__
Tracker <[EMAIL PROTECTED]>

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



[issue1352] Preliminary stderr patch

2007-10-29 Thread Guido van Rossum

Changes by Guido van Rossum:


--
assignee:  -> gvanrossum
priority:  -> high

__
Tracker <[EMAIL PROTECTED]>

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



[issue1359] py3k: out of bounds read in PyUnicode_DecodeUnicodeEscape

2007-10-29 Thread Amaury Forgeot d'Arc

New submission from Amaury Forgeot d'Arc:

A correction for the problem found by GvR in change 58692:

> There's one mystery: if I remove ob_sstate from the PyStringObject struct,
> some (unicode) string literals are mutilated, e.g. ('\\1', '\1') prints
> ('\\1', '\t').  This must be an out of bounds write or something that I
> can't track down.  (It doesn't help that it doesn't occur in debug mode.
> And no, make clean + recompilation doesn't help either.)
> 
> So, in the mean time, I just keep the field, renamed to 'ob_placeholder'.

I think I found the problem. It reproduces on Windows, with a slightly
different input
>>> ('\\2','\1')
('\\2', '\n')
(the win32 release build is of the kind "optimized with debug info", so
using the debugger is possible)

The problem is in unicodeobject.c::PyUnicode_DecodeUnicodeEscape:
- the input buffer is not null-terminated
- when decoding octal escape, we increment s without checking if it is
still in the limits.
In my case, the "\1" was followed by a "2" in memory, hence the bogus
chr(0o12) == '\n'.

Also corrected a potential problem when the string ends with a \:
PyUnicode_DecodeUnicodeEscape("\\t", 1) should return an error.

--
components: Interpreter Core
files: unicodeEscape.diff
messages: 56933
nosy: amaury.forgeotdarc, gvanrossum
severity: normal
status: open
title: py3k: out of bounds read in PyUnicode_DecodeUnicodeEscape
versions: Python 3.0
Added file: http://bugs.python.org/file8658/unicodeEscape.diff

__
Tracker <[EMAIL PROTECTED]>

__

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



[issue1356] 3.0a1 Solaris w/ SUN C/C++

2007-10-29 Thread Guido van Rossum

Changes by Guido van Rossum:


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



[issue1359] py3k: out of bounds read in PyUnicode_DecodeUnicodeEscape

2007-10-29 Thread Guido van Rossum

Guido van Rossum added the comment:

Better fix:
Committed revision 58708.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1359] py3k: out of bounds read in PyUnicode_DecodeUnicodeEscape

2007-10-29 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

I don't like this assert either: this function is part of the public
API, and should not crash the interpreter just because of a trailing \.

To test easily:

import ctypes
decode = ctypes.pythonapi.PyUnicodeUCS2_DecodeUnicodeEscape
decode.restype = ctypes.py_object
decode(b'\\1', 1, None)

This should gently raise a UnicodeDecodeError IMO.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1359] py3k: out of bounds read in PyUnicode_DecodeUnicodeEscape

2007-10-29 Thread Guido van Rossum

Guido van Rossum added the comment:

(Hold on, the assert I added triggers in debug mode.)

--
status: closed -> open

__
Tracker <[EMAIL PROTECTED]>

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



[issue1351] Add getsize() to io instances

2007-10-29 Thread Guido van Rossum

Guido van Rossum added the comment:

I'm -1 myself.  I've rarely needed this -- if I wanted to know the size,
I was almost always going to read the data into memory anyway, so why
not just read it and then ask how much you got?  For files on the
filesystem there's os.path.getsize().

If I ever were to let this in, here's some more criticism:

(a) the SizeInfo class is overkill.  getsize() should just return an int.

(b) getsize() should check self.seekable() first and raise the
appropriate error if the file isn't seekable.

(c) os.fstat() is much less likely to work than the tell-seek-tell-seek
sequence, so why not use that everywhere?

(d) people will expect to use this on text files, but of course the
outcome will be in bytes, hence 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



[issue1347] BaseHTTPServer writing strings to bytes interface

2007-10-29 Thread Bill Janssen

Bill Janssen added the comment:

Will do.

On 10/29/07, Guido van Rossum <[EMAIL PROTECTED]> wrote:
>
> Guido van Rossum added the comment:
>
> Looks good. You can check this in yourself right?
>
> --
> assignee:  -> janssen
> nosy: +gvanrossum
> resolution:  -> accepted
>
> __
> 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



[issue1349] more uses of ord() in plat-mac/ic.py

2007-10-29 Thread Bill Janssen

Bill Janssen added the comment:

I've been testing it over the weekend.  Will do.

Bill

On 10/29/07, Guido van Rossum <[EMAIL PROTECTED]> wrote:
>
> Guido van Rossum added the comment:
>
> Looks good, though I can't find anything that would test this.
>
> Can you check this in yourself?
>
> --
> assignee: nnorwitz -> janssen
> nosy: +gvanrossum
>
> __
> 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



[issue1360] Queue.get() can't be interrupted with Ctrl-C unless timed out

2007-10-29 Thread Daniele Varrazzo

New submission from Daniele Varrazzo:

This issue probably depends on #1167930

When waiting on a queue in blocking mode, in no timeout is set, ctrl-C
doesn't raise KeyboardInterrupt::

q = Queue()
q.get(True)
# ctrl-c doesn't work here

If any timeout is set, ctrl-c works as expected::

q = Queue()
ONEYEAR = 365 * 24 * 60 * 60
q.get(True, ONEYEAR)
# ctrl-c works here

Traceback (most recent call last):
File "queuebug.py", line 6, in 
q.get(True, ONEYEAR)
File "/usr/lib/python2.5/Queue.py", line 174, in get
self.not_empty.wait(remaining)
File "/usr/lib/python2.5/threading.py", line 233, in wait
_sleep(delay)
KeyboardInterrupt

--
components: Library (Lib)
messages: 56942
nosy: piro
severity: normal
status: open
title: Queue.get() can't be interrupted with Ctrl-C unless timed out
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



[issue1352] Preliminary stderr patch

2007-10-29 Thread Guido van Rossum

Guido van Rossum added the comment:

Good idea.

Are there any places where PyBytes or PyString are written to stderr? 
Or can you get away with just supporting PyUnicode?

It's "dumb", not "dump".

I wouldn't explicitly remove the old stderr printer -- it will be
deleted automatically by the PyDict_SetItemString() call in
PySys_SetObject().  That way you'll still have it when the
PyFile_FromFd() call fails...

This patch doesn't commute with your 'closefd' patch...

__
Tracker <[EMAIL PROTECTED]>

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



[issue1359] py3k: out of bounds read in PyUnicode_DecodeUnicodeEscape

2007-10-29 Thread Guido van Rossum

Changes by Guido van Rossum:


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



[issue1329] Different 3.0a1 exit behavior

2007-10-29 Thread Guido van Rossum

Guido van Rossum added the comment:

Thanks!!  Code review:

Shouldn't closefd be passed as 1 in import.c?

I don't see the point of distinguishing between -1 and +1.  The block
"if (closefd < 0) { closefd = 1; }" looks rather silly.

In io.py, you should document that closefd must not be False when a
filename is given.

I think in _fileio.c, you can insist that the closefd argument is an int
(a bool will work anyway, as bool is a subclass of int).

I don't think we should warn when trying to close an unclosable fd; it
should really just be a no-op.  Also, if you are going to call
PyErr_WarnEx(), you should test its return value (it can raise an
exception!).

Please don't add trailing whitespace.

--
priority:  -> high

__
Tracker <[EMAIL PROTECTED]>

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



[issue1360] Queue.get() can't be interrupted with Ctrl-C unless timed out

2007-10-29 Thread Guido van Rossum

Guido van Rossum added the comment:

This (and the other issue you mention) is because the regular acquire()
method on a basic lock cannot be interrupted.  That's unlikely to go
away, so you'll just have to live with this.  As you've discovered,
specifying a timeout solves the issue.  Since code running in threads
doesn't receive signals anyway (in Python), it would be fairly pointless
to slow down lock acquisition in order to support keyboard interrupts.

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



[issue1361] hashlib uses OpenSSL which is much slower than Aaron Gifford

2007-10-29 Thread Eric Hopper

New submission from Eric Hopper:

Aaron Gifford's implementation of SHA-{256,384,512} is nearly twice as
fast as OpenSSLs.

--
components: Extension Modules
messages: 56946
nosy: Omnifarious
severity: normal
status: open
title: hashlib uses OpenSSL which is much slower than Aaron Gifford
type: resource usage
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



[issue1167930] threading.Thread.join() cannot be interrupted by a Ctrl-C

2007-10-29 Thread Guido van Rossum

Guido van Rossum added the comment:

This is because the regular acquire() method on a basic lock cannot be
interrupted.  That's unlikely to go away, so you'll just have to live
with this.  As you've discovered, specifying a timeout solves the issue
(sort of).

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



[issue1362] Simple mistake in http://docs.python.org/tut/node6.html

2007-10-29 Thread Dan M

New submission from Dan M:

In section 4.6 it says:
Writing the value None is normally suppressed by the interpreter if it
would be the only value written.

When it should say:
Writing the value None is normally displayed by the interpreter if it
would be the only value written.

Or less wordy:
The value None is (normally) displayed by the interpreter when it would
be the only value written.

--
components: Documentation
messages: 56948
nosy: dmazz
severity: minor
status: open
title: Simple mistake in http://docs.python.org/tut/node6.html

__
Tracker <[EMAIL PROTECTED]>

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



[issue1361] hashlib uses OpenSSL which is much slower than Aaron Gifford

2007-10-29 Thread Eric Hopper

Eric Hopper added the comment:

My testing methodology was faulty, this is not actually true.  Oops.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1361] please close: hashlib uses OpenSSL which is much slower than Aaron Gifford

2007-10-29 Thread Eric Hopper

Changes by Eric Hopper:


--
title: hashlib uses OpenSSL which is much slower than Aaron Gifford -> please 
close: hashlib uses OpenSSL which is much slower than Aaron Gifford

__
Tracker <[EMAIL PROTECTED]>

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



[issue1360] Queue.get() can't be interrupted with Ctrl-C unless timed out

2007-10-29 Thread Daniele Varrazzo

Daniele Varrazzo added the comment:

Because the easy workaround, we can live with the issue. Anyway, because
the workaround is not trivial to find, and because the behavior is
supposed to remain unchanged, maybe the issue should be mentioned in the
docs.

Thank you for the explanation :)

__
Tracker <[EMAIL PROTECTED]>

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



[issue1361] please close: hashlib uses OpenSSL which is much slower than Aaron Gifford

2007-10-29 Thread Facundo Batista

Facundo Batista added the comment:

The OP changed his mind, :)

--
nosy: +facundobatista
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



[issue1612746] Enhanced tabbed pane widget

2007-10-29 Thread Kurt B. Kaiser

Kurt B. Kaiser added the comment:

Prior to the 13:17:41 update:
r58710.
Minor formatting changes.

I figured you might have an update :-)  It's good to let these new 
modules 
age a bit :-)  Well, maybe not that long...

renamed tabbedPages.py -> tabbedpages.py to conform to PEP 8.
Nicely done, thanks for the patch!

One comment: when multiple rows are created, the row order in the test 
widget, counting from the top, is 2341.  I expected 1234.

--
resolution: out of date -> accepted

_
Tracker <[EMAIL PROTECTED]>

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



[issue1612746] Enhanced tabbed pane widget

2007-10-29 Thread Kurt B. Kaiser

Kurt B. Kaiser added the comment:

Well, I already checked it in.  Please synch to svn and send me an update 
against that.  Note that I renamed tabbedPages.py.

_
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-10-29 Thread Senthil

Senthil added the comment:

I have started this work at
http://svn.python.org/projects/sandbox/trunk/urilib/
as a part of G-SoC, yes taking it to web-sig would be appropriate and I
shall do so. techtonik, you might want to review it urilib and we can
discuss it further.
Thanks,

--
nosy: +orsenthil

__
Tracker <[EMAIL PROTECTED]>

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



[issue1329] Different 3.0a1 exit behavior

2007-10-29 Thread Christian Heimes

Christian Heimes added the comment:

Guido van Rossum wrote:
> Shouldn't closefd be passed as 1 in import.c?
> 
> I don't see the point of distinguishing between -1 and +1.  The block
> "if (closefd < 0) { closefd = 1; }" looks rather silly.

I used -1 as default to keep it consistent with buffer=-1. I figured out
that I can go with "closefd != 0 means close it".

> In io.py, you should document that closefd must not be False when a
> filename is given.

Done

> I think in _fileio.c, you can insist that the closefd argument is an int
> (a bool will work anyway, as bool is a subclass of int).

Thanks, it makes the code a bit easier.

> I don't think we should warn when trying to close an unclosable fd; it
> should really just be a no-op.  Also, if you are going to call
> PyErr_WarnEx(), you should test its return value (it can raise an
> exception!).

I think we should keep the warning. The warning made me aware of a minor
bug in quopri.

> Please don't add trailing whitespace.

I've reconfigured my editor to remove trailing spaces.

I've attached a combined patch for closefd and preliminary stderr.

Christian

Added file: 
http://bugs.python.org/file8662/py3k_combined_preliminary_closefd.patch

__
Tracker <[EMAIL PROTECTED]>

__Index: Python/pythonrun.c
===
--- Python/pythonrun.c	(revision 58700)
+++ Python/pythonrun.c	(working copy)
@@ -151,7 +151,7 @@
 {
 	PyInterpreterState *interp;
 	PyThreadState *tstate;
-	PyObject *bimod, *sysmod;
+	PyObject *bimod, *sysmod, *pstderr;
 	char *p;
 #if defined(HAVE_LANGINFO_H) && defined(CODESET)
 	char *codeset;
@@ -228,6 +228,13 @@
 	PyDict_SetItemString(interp->sysdict, "modules",
 			 interp->modules);
 
+	/* Set up a dumb stderr printer until we have enough infrastructure
+   for the io module in place. */
+	pstderr = PyFile_NewStdPrinter(fileno(stderr));
+	if (pstderr == NULL)
+		Py_FatalError("Py_Initialize: can't set preliminary stderr");
+	PySys_SetObject("stderr", pstderr);
+
 	_PyImport_Init();
 
 	/* initialize builtin exceptions */
@@ -720,7 +727,7 @@
 
 	/* Set sys.stdin */
 	if (!(std = PyFile_FromFd(fileno(stdin), "", "r", -1,
-  NULL, "\n"))) {
+  NULL, "\n", 0))) {
 		goto error;
 	}
 	PySys_SetObject("__stdin__", std);
@@ -729,16 +736,16 @@
 
 	/* Set sys.stdout */
 	if (!(std = PyFile_FromFd(fileno(stdout), "", "w", -1,
-  NULL, "\n"))) {
+  NULL, "\n", 0))) {
 goto error;
 }
 	PySys_SetObject("__stdout__", std);
 	PySys_SetObject("stdout", std);
 	Py_DECREF(std);
 
-	/* Set sys.stderr */
+	/* Set sys.stderr, replaces the preliminary stderr */
 	if (!(std = PyFile_FromFd(fileno(stderr), "", "w", -1,
-  NULL, "\n"))) {
+  NULL, "\n", 0))) {
 goto error;
 }
 PySys_SetObject("__stderr__", std);
Index: Python/import.c
===
--- Python/import.c	(revision 58700)
+++ Python/import.c	(working copy)
@@ -2588,7 +2588,7 @@
    (char*)PyUnicode_GetDefaultEncoding();
 		}
 		fob = PyFile_FromFd(fd, pathname, fdp->mode, -1,
-	(char*)encoding, NULL);
+(char*)encoding, NULL, 1);
 		if (fob == NULL) {
 			close(fd);
 			PyMem_FREE(found_encoding);
Index: Include/fileobject.h
===
--- Include/fileobject.h	(revision 58700)
+++ Include/fileobject.h	(working copy)
@@ -8,7 +8,8 @@
 
 #define PY_STDIOTEXTMODE "b"
 
-PyAPI_FUNC(PyObject *) PyFile_FromFd(int, char *, char *, int, char *, char *);
+PyAPI_FUNC(PyObject *) PyFile_FromFd(int, char *, char *, int, char *, char *,
+ int);
 PyAPI_FUNC(PyObject *) PyFile_GetLine(PyObject *, int);
 PyAPI_FUNC(int) PyFile_WriteObject(PyObject *, PyObject *, int);
 PyAPI_FUNC(int) PyFile_WriteString(const char *, PyObject *);
@@ -20,6 +21,13 @@
 */
 PyAPI_DATA(const char *) Py_FileSystemDefaultEncoding;
 
+/* Internal API
+
+   The std printer acts as a preliminary sys.stderr until the new io
+   infrastructure is in place. */
+PyAPI_FUNC(PyObject *) PyFile_NewStdPrinter(int);
+PyAPI_DATA(PyTypeObject) PyStdPrinter_Type;
+
 #ifdef __cplusplus
 }
 #endif
Index: Objects/object.c
===
--- Objects/object.c	(revision 58700)
+++ Objects/object.c	(working copy)
@@ -1595,6 +1595,9 @@
 
 	if (PyType_Ready(&PyCode_Type) < 0)
 		Py_FatalError("Can't initialize 'code'");
+
+	if (PyType_Ready(&PyStdPrinter_Type) < 0)
+		Py_FatalError("Can't initialize StdPrinter");
 }
 
 
Index: Objects/fileobject.c
===
--- Objects/fileobject.c	(revision 58700)
+++ Objects/fileobject.c	(working copy)
@@ -27,15 +27,15 @@
 
 PyObject *
 PyFile_FromFd(int fd, char *name, char *mode, int buffering, char *encoding,
-	  char *newline)
+	   

[issue1362] Simple mistake in http://docs.python.org/tut/node6.html

2007-10-29 Thread Martin v. Löwis

Martin v. Löwis added the comment:

I fail to see the bug. The documentation is correct as it stands, ie.
None is *not* displayed normally. IOW, writing is normally suppressed.

--
nosy: +loewis
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



[issue1352] Preliminary stderr patch

2007-10-29 Thread Christian Heimes

Christian Heimes added the comment:

Guido van Rossum wrote:
> Are there any places where PyBytes or PyString are written to stderr? 
> Or can you get away with just supporting PyUnicode?

I could have simple copied the write method from _fileio.c and letting
the argument parser do its job instead of fighting with the API for 20
minutes. :

> It's "dumb", not "dump".

I need an IDE with a context aware spell checker :]

> I wouldn't explicitly remove the old stderr printer -- it will be
> deleted automatically by the PyDict_SetItemString() call in
> PySys_SetObject().  That way you'll still have it when the
> PyFile_FromFd() call fails...

I didn't know that. I'll keep it in place.

__
Tracker <[EMAIL PROTECTED]>

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