[issue1597850] Cross compiling patches for MINGW

2007-10-27 Thread Scott Tsai

Scott Tsai added the comment:

I messed up while generating cross-2.5.1.patch last time.
Added a hackish way to set "disabled_module_list" in setup.py from
corresponding environment variable.

Added file: http://bugs.python.org/file8628/cross-2.5.1.patch

_
Tracker <[EMAIL PROTECTED]>

_diff --exclude=configure -urN Python-2.5.1/configure.in Python-2.5.1-hacked/configure.in
--- Python-2.5.1/configure.in	2007-03-12 18:50:51.0 +0800
+++ Python-2.5.1-hacked/configure.in	2007-10-27 14:31:18.0 +0800
@@ -9,6 +9,11 @@
 AC_CONFIG_SRCDIR([Include/object.h])
 AC_CONFIG_HEADER(pyconfig.h)
 
+# find compiler while respecting --host setting
+AC_CANONICAL_HOST()
+AC_CHECK_TOOLS(CC,gcc cc)
+AC_CHECK_TOOLS(CXX,g++ c++)
+
 dnl This is for stuff that absolutely must end up in pyconfig.h.
 dnl Please use pyport.h instead, if possible.
 AH_TOP([
@@ -163,8 +168,8 @@
 # Set name for machine-dependent library files
 AC_SUBST(MACHDEP)
 AC_MSG_CHECKING(MACHDEP)
-if test -z "$MACHDEP"
-then
+if test -z "$MACHDEP"; then
+if test "$cross_compiling" = "no"; then
 	ac_sys_system=`uname -s`
 	if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "Monterey64" \
 	-o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
@@ -172,6 +177,23 @@
 	else
 		ac_sys_release=`uname -r`
 	fi
+else
+	m=`$CC -dumpmachine`
+ 	changequote(<<, >>)#dnl
+	ac_sys_system=`expr "$m" : "[^-]*-\([^-]*\)"`
+ 	changequote([, ])#dnl
+
+
+	case $ac_sys_system in
+	cygwin*) ac_sys_system=`echo $ac_sys_system | sed s/cygwin/CYGWIN/g `;;
+	darwin*) ac_sys_system=`echo $ac_sys_system | sed s/darwin/Darwin/g `;;
+	freebsd*) ac_sys_system=`echo $ac_sys_system | sed s/freebsd/FreeBSD/g `;;
+	linux*) ac_sys_system=`echo $ac_sys_system | sed s/linux/Linux/g `;;
+	esac
+	
+
+fi
+
 	ac_md_system=`echo $ac_sys_system |
 			   tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
 	ac_md_release=`echo $ac_sys_release |
@@ -419,8 +441,8 @@
 if test -z "$CXX"
 then
 case "$CC" in
-gcc)AC_PATH_PROG(CXX, [g++], [g++], [notfound]) ;;
-cc) AC_PATH_PROG(CXX, [c++], [c++], [notfound]) ;;
+gcc)AC_CHECK_TOOL(CXX, [g++], [notfound]) ;;
+cc) AC_CHECK_TOOL(CXX, [c++], [notfound]) ;;
 esac
 	if test "$CXX" = "notfound"
 	then
@@ -429,7 +451,7 @@
 fi
 if test -z "$CXX"
 then
-	AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, notfound)
+	AC_CHECK_TOOLS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, notfound)
 	if test "$CXX" = "notfound"
 	then
 		CXX=""
@@ -480,9 +502,11 @@
 then
 AC_MSG_RESULT(yes)
 BUILDEXEEXT=.exe
+case_sensitive=no
 else
-	AC_MSG_RESULT(no)
-	BUILDEXEEXT=$EXEEXT
+AC_MSG_RESULT(no)
+BUILDEXEEXT=$EXEEXT
+case_sensitive=yes
 fi
 rmdir CaseSensitiveTestDir
 
@@ -681,9 +705,9 @@
 
 AC_MSG_RESULT($LDLIBRARY)
 
-AC_PROG_RANLIB
-AC_SUBST(AR)
-AC_CHECK_PROGS(AR, ar aal, ar)
+# find tools while respecting --host setting
+AC_CHECK_TOOL(RANLIB,ranlib)
+AC_CHECK_TOOLS(AR,ar aal,ar)
 
 AC_SUBST(SVNVERSION)
 AC_CHECK_PROG(SVNVERSION, svnversion, found, not-found)
@@ -801,7 +825,7 @@
  AC_TRY_RUN([int main() { return 0; }],
  ac_cv_no_strict_aliasing_ok=yes,
  ac_cv_no_strict_aliasing_ok=no,
- ac_cv_no_strict_aliasing_ok=no)
+ ac_cv_no_strict_aliasing_ok=yes)
  CC="$ac_save_cc"
 AC_MSG_RESULT($ac_cv_no_strict_aliasing_ok)
 if test $ac_cv_no_strict_aliasing_ok = yes
@@ -3345,30 +3369,19 @@
   AC_MSG_RESULT(no)
 )
 
-AC_MSG_CHECKING(for /dev/ptmx)
-
-if test -r /dev/ptmx
-then
-  AC_MSG_RESULT(yes)
-  AC_DEFINE(HAVE_DEV_PTMX, 1,
-  [Define if we have /dev/ptmx.])
-else
-  AC_MSG_RESULT(no)
-fi
-
-AC_MSG_CHECKING(for /dev/ptc)
-
-if test -r /dev/ptc
-then
-  AC_MSG_RESULT(yes)
-  AC_DEFINE(HAVE_DEV_PTC, 1,
-  [Define if we have /dev/ptc.])
-else
-  AC_MSG_RESULT(no)
-fi
+AC_CHECK_FILE(/dev/ptmx,
+	[AC_DEFINE(HAVE_DEV_PTMX, 1,
+	   [Define if we have /dev/ptmx.])],
+	[])
+
+AC_CHECK_FILE(/dev/ptc,
+	[AC_DEFINE(HAVE_DEV_PTC, 1,
+	   [Define if we have /dev/ptc.])],
+	[])
 
 AC_MSG_CHECKING(for %zd printf() format support)
-AC_TRY_RUN([#include 
+AC_CACHE_VAL(ac_cv_printf_zd_format,
+		AC_TRY_RUN([#include 
 #include 
 #include 
 
@@ -3400,7 +3413,7 @@
 }],
 [AC_MSG_RESULT(yes)
  AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])],
- AC_MSG_RESULT(no))
+ AC_MSG_RESULT(no)))
 
 AC_CHECK_TYPE(socklen_t,,
   AC_DEFINE(socklen_t,int,
@@ -3430,6 +3443,63 @@
 done
 AC_MSG_RESULT(done)
 
+# Cross compiling
+AC_SUBST(cross_compiling)
+
+if test "$cross_compiling" = "yes"; then
+AC_MSG_CHECKING(cc for build)
+CC_FOR_BUILD="${CC_FOR_BUILD-cc}"
+else
+CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
+fi   
+ 
+if test "$cross_compiling" = "yes"; then
+   AC_MSG_RESULT($CC_FOR_BUILD)
+fi
+
+AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler (default: cc)])
+	
+if test "$cross_compiling" = "yes"; then
+AC_MSG_CHE

[issue1597850] Cross compiling patches for MINGW

2007-10-27 Thread Scott Tsai

Scott Tsai added the comment:

Grumble, uploaded wrong version of patch.

Added file: http://bugs.python.org/file8629/cross-2.5.1.patch

_
Tracker <[EMAIL PROTECTED]>

_diff -urN --exclude configure --exclude 'config.*' Python-2.5.1/configure.in Python-2.5.1-hacked/configure.in
--- Python-2.5.1/configure.in	2007-03-12 18:50:51.0 +0800
+++ Python-2.5.1-hacked/configure.in	2007-10-27 16:46:39.0 +0800
@@ -9,6 +9,11 @@
 AC_CONFIG_SRCDIR([Include/object.h])
 AC_CONFIG_HEADER(pyconfig.h)
 
+# find compiler while respecting --host setting
+AC_CANONICAL_HOST()
+AC_CHECK_TOOLS(CC,gcc cc)
+AC_CHECK_TOOLS(CXX,g++ c++)
+
 dnl This is for stuff that absolutely must end up in pyconfig.h.
 dnl Please use pyport.h instead, if possible.
 AH_TOP([
@@ -163,8 +168,8 @@
 # Set name for machine-dependent library files
 AC_SUBST(MACHDEP)
 AC_MSG_CHECKING(MACHDEP)
-if test -z "$MACHDEP"
-then
+if test -z "$MACHDEP"; then
+if test "$cross_compiling" = "no"; then
 	ac_sys_system=`uname -s`
 	if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "Monterey64" \
 	-o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
@@ -172,6 +177,23 @@
 	else
 		ac_sys_release=`uname -r`
 	fi
+else
+	m=`$CC -dumpmachine`
+ 	changequote(<<, >>)#dnl
+	ac_sys_system=`expr "$m" : "[^-]*-\([^-]*\)"`
+ 	changequote([, ])#dnl
+
+
+	case $ac_sys_system in
+	cygwin*) ac_sys_system=`echo $ac_sys_system | sed s/cygwin/CYGWIN/g `;;
+	darwin*) ac_sys_system=`echo $ac_sys_system | sed s/darwin/Darwin/g `;;
+	freebsd*) ac_sys_system=`echo $ac_sys_system | sed s/freebsd/FreeBSD/g `;;
+	linux*) ac_sys_system=`echo $ac_sys_system | sed s/linux/Linux/g `;;
+	esac
+	
+
+fi
+
 	ac_md_system=`echo $ac_sys_system |
 			   tr -d '[/ ]' | tr '[[A-Z]]' '[[a-z]]'`
 	ac_md_release=`echo $ac_sys_release |
@@ -419,8 +441,8 @@
 if test -z "$CXX"
 then
 case "$CC" in
-gcc)AC_PATH_PROG(CXX, [g++], [g++], [notfound]) ;;
-cc) AC_PATH_PROG(CXX, [c++], [c++], [notfound]) ;;
+gcc)AC_CHECK_TOOL(CXX, [g++], [notfound]) ;;
+cc) AC_CHECK_TOOL(CXX, [c++], [notfound]) ;;
 esac
 	if test "$CXX" = "notfound"
 	then
@@ -429,7 +451,7 @@
 fi
 if test -z "$CXX"
 then
-	AC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, notfound)
+	AC_CHECK_TOOLS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, notfound)
 	if test "$CXX" = "notfound"
 	then
 		CXX=""
@@ -480,9 +502,11 @@
 then
 AC_MSG_RESULT(yes)
 BUILDEXEEXT=.exe
+case_sensitive=no
 else
-	AC_MSG_RESULT(no)
-	BUILDEXEEXT=$EXEEXT
+AC_MSG_RESULT(no)
+BUILDEXEEXT=$EXEEXT
+case_sensitive=yes
 fi
 rmdir CaseSensitiveTestDir
 
@@ -681,9 +705,9 @@
 
 AC_MSG_RESULT($LDLIBRARY)
 
-AC_PROG_RANLIB
-AC_SUBST(AR)
-AC_CHECK_PROGS(AR, ar aal, ar)
+# find tools while respecting --host setting
+AC_CHECK_TOOL(RANLIB,ranlib)
+AC_CHECK_TOOLS(AR,ar aal,ar)
 
 AC_SUBST(SVNVERSION)
 AC_CHECK_PROG(SVNVERSION, svnversion, found, not-found)
@@ -801,7 +825,7 @@
  AC_TRY_RUN([int main() { return 0; }],
  ac_cv_no_strict_aliasing_ok=yes,
  ac_cv_no_strict_aliasing_ok=no,
- ac_cv_no_strict_aliasing_ok=no)
+ ac_cv_no_strict_aliasing_ok=yes)
  CC="$ac_save_cc"
 AC_MSG_RESULT($ac_cv_no_strict_aliasing_ok)
 if test $ac_cv_no_strict_aliasing_ok = yes
@@ -3345,30 +3369,19 @@
   AC_MSG_RESULT(no)
 )
 
-AC_MSG_CHECKING(for /dev/ptmx)
-
-if test -r /dev/ptmx
-then
-  AC_MSG_RESULT(yes)
-  AC_DEFINE(HAVE_DEV_PTMX, 1,
-  [Define if we have /dev/ptmx.])
-else
-  AC_MSG_RESULT(no)
-fi
-
-AC_MSG_CHECKING(for /dev/ptc)
-
-if test -r /dev/ptc
-then
-  AC_MSG_RESULT(yes)
-  AC_DEFINE(HAVE_DEV_PTC, 1,
-  [Define if we have /dev/ptc.])
-else
-  AC_MSG_RESULT(no)
-fi
+AC_CHECK_FILE(/dev/ptmx,
+	[AC_DEFINE(HAVE_DEV_PTMX, 1,
+	   [Define if we have /dev/ptmx.])],
+	[])
+
+AC_CHECK_FILE(/dev/ptc,
+	[AC_DEFINE(HAVE_DEV_PTC, 1,
+	   [Define if we have /dev/ptc.])],
+	[])
 
 AC_MSG_CHECKING(for %zd printf() format support)
-AC_TRY_RUN([#include 
+AC_CACHE_VAL(ac_cv_printf_zd_format,
+		AC_TRY_RUN([#include 
 #include 
 #include 
 
@@ -3400,7 +3413,7 @@
 }],
 [AC_MSG_RESULT(yes)
  AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])],
- AC_MSG_RESULT(no))
+ AC_MSG_RESULT(no)))
 
 AC_CHECK_TYPE(socklen_t,,
   AC_DEFINE(socklen_t,int,
@@ -3430,6 +3443,63 @@
 done
 AC_MSG_RESULT(done)
 
+# Cross compiling
+AC_SUBST(cross_compiling)
+
+if test "$cross_compiling" = "yes"; then
+AC_MSG_CHECKING(cc for build)
+CC_FOR_BUILD="${CC_FOR_BUILD-cc}"
+else
+CC_FOR_BUILD="${CC_FOR_BUILD-$CC}"
+fi   
+ 
+if test "$cross_compiling" = "yes"; then
+   AC_MSG_RESULT($CC_FOR_BUILD)
+fi
+
+AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler (default: cc)])
+	
+if test "$cross_compiling" = "yes"; then
+AC_MSG_CHECKING(python for build)
+PYTHON_FOR_BUILD="${PYTHON_FOR_BUILD-python}"
+PYTHON_FOR_BUILD=`

[issue1343] XMLGenerator: nice elements

2007-10-27 Thread panzi

panzi added the comment:

patch for xml/sax/saxutils.py

Added file: http://bugs.python.org/file8631/xml.sax.saxutils.patch

__
Tracker <[EMAIL PROTECTED]>

__--- /usr/lib/python2.5/xml/sax/saxutils.py	2007-05-02 18:56:40.0 +0200
+++ xml/sax/saxutils.py	2007-10-22 22:44:33.0 +0200
@@ -4,8 +4,8 @@ convenience of application and driver wr
 """
 
 import os, urlparse, urllib, types
-import handler
-import xmlreader
+from xml.sax import handler
+from xml.sax import xmlreader
 
 try:
 _StringTypes = [types.StringType, types.UnicodeType]
@@ -93,6 +93,7 @@ class XMLGenerator(handler.ContentHandle
 self._current_context = self._ns_contexts[-1]
 self._undeclared_ns_maps = []
 self._encoding = encoding
+self._pending_start_element = False
 
 def _write(self, text):
 if isinstance(text, str):
@@ -111,6 +112,11 @@ class XMLGenerator(handler.ContentHandle
 # Return the unqualified name
 return name[1]
 
+def _finish_pending_start_element(self,endElement=False):
+if self._pending_start_element:
+self._write('>')
+self._pending_start_element = False
+
 # ContentHandler methods
 
 def startDocument(self):
@@ -127,15 +133,21 @@ class XMLGenerator(handler.ContentHandle
 del self._ns_contexts[-1]
 
 def startElement(self, name, attrs):
+self._finish_pending_start_element()
 self._write('<' + name)
 for (name, value) in attrs.items():
 self._write(' %s=%s' % (name, quoteattr(value)))
-self._write('>')
+self._pending_start_element = True
 
 def endElement(self, name):
-self._write('' % name)
+if self._pending_start_element:
+self._write('/>')
+self._pending_start_element = False
+else:
+self._write('' % name)
 
 def startElementNS(self, name, qname, attrs):
+self._finish_pending_start_element()
 self._write('<' + self._qname(name))
 
 for prefix, uri in self._undeclared_ns_maps:
@@ -147,18 +159,27 @@ class XMLGenerator(handler.ContentHandle
 
 for (name, value) in attrs.items():
 self._write(' %s=%s' % (self._qname(name), quoteattr(value)))
-self._write('>')
+self._pending_start_element = True
 
 def endElementNS(self, name, qname):
-self._write('' % self._qname(name))
+if self._pending_start_element:
+self._write('/>')
+self._pending_start_element = False
+else:
+self._write('' % self._qname(name))
 
 def characters(self, content):
-self._write(escape(content))
+if content:
+self._finish_pending_start_element()
+self._write(escape(content))
 
 def ignorableWhitespace(self, content):
-self._write(content)
+if content:
+self._finish_pending_start_element()
+self._write(content)
 
 def processingInstruction(self, target, data):
+self._finish_pending_start_element()
 self._write('' % (target, data))
 
 
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1343] XMLGenerator: nice elements

2007-10-27 Thread panzi

panzi added the comment:

patch for _xmlplus.sax.saxutils.py

Added file: http://bugs.python.org/file8632/_xmlplus.sax.saxutils.patch

__
Tracker <[EMAIL PROTECTED]>

__--- /usr/lib/python2.5/site-packages/_xmlplus/sax/saxutils.py	2004-11-29 13:36:36.0 +0100
+++ site-packages/_xmlplus/sax/saxutils.py	2007-10-22 22:44:54.0 +0200
@@ -6,9 +6,11 @@ $Id: saxutils.py,v 1.35 2004/03/20 07:46
 """
 
 import os, urlparse, urllib2, types
-import handler
-import xmlreader
-import sys, _exceptions, saxlib
+from xml.sax import handler
+from xml.sax import xmlreader
+from xml.sax import _exceptions
+from xml.sax import saxlib
+import sys
 
 try:
 _StringTypes = [types.StringType, types.UnicodeType]
@@ -173,7 +175,7 @@ class ErrorRaiser:
 raise exception
 
 # --- AttributesImpl now lives in xmlreader
-from xmlreader import AttributesImpl
+from xml.sax.xmlreader import AttributesImpl
 
 # --- XMLGenerator is the SAX2 ContentHandler for writing back XML
 import codecs
@@ -231,7 +233,12 @@ class XMLGenerator(handler.ContentHandle
 self._undeclared_ns_maps = []
 self._encoding = encoding
 self._generated_prefix_ctr = 0
-return
+self._pending_start_element = False
+
+def _finish_pending_start_element(self,endElement=False):
+if self._pending_start_element:
+self._out.write('>')
+self._pending_start_element = False
 
 # ContentHandler methods
 
@@ -249,16 +256,22 @@ class XMLGenerator(handler.ContentHandle
 del self._ns_contexts[-1]
 
 def startElement(self, name, attrs):
+self._finish_pending_start_element()
 self._out.write('<' + name)
 for (name, value) in attrs.items():
 self._out.write(' %s=' % name)
 writeattr(self._out, value)
-self._out.write('>')
+self._pending_start_element = True
 
 def endElement(self, name):
-self._out.write('' % name)
+if self._pending_start_element:
+self._out.write('/>')
+self._pending_start_element = False
+else:
+self._out.write('' % name)
 
 def startElementNS(self, name, qname, attrs):
+self._finish_pending_start_element()
 if name[0] is None:
 name = name[1]
 elif self._current_context[name[0]] is None:
@@ -291,27 +304,36 @@ class XMLGenerator(handler.ContentHandle
 name = self._current_context[name[0]] + ":" + name[1]
 self._out.write(' %s=' % name)
 writeattr(self._out, value)
-self._out.write('>')
+self._pending_start_element = True
 
 def endElementNS(self, name, qname):
-# XXX: if qname is not None, we better use it.
-# Python 2.0b2 requires us to use the recorded prefix for
-# name[0], though
-if name[0] is None:
-qname = name[1]
-elif self._current_context[name[0]] is None:
-qname = name[1]
+if self._pending_start_element:
+self._out.write('/>')
+self._pending_start_element = False
 else:
-qname = self._current_context[name[0]] + ":" + name[1]
-self._out.write('' % qname)
+# XXX: if qname is not None, we better use it.
+# Python 2.0b2 requires us to use the recorded prefix for
+# name[0], though
+if name[0] is None:
+qname = name[1]
+elif self._current_context[name[0]] is None:
+qname = name[1]
+else:
+qname = self._current_context[name[0]] + ":" + name[1]
+self._out.write('' % qname)
 
 def characters(self, content):
-writetext(self._out, content)
+if content:
+self._finish_pending_start_element()
+writetext(self._out, content)
 
 def ignorableWhitespace(self, content):
-self._out.write(content)
+if content:
+self._finish_pending_start_element()
+self._out.write(content)
 
 def processingInstruction(self, target, data):
+self._finish_pending_start_element()
 self._out.write('' % (target, data))
 
 
@@ -323,10 +345,12 @@ class LexicalXMLGenerator(XMLGenerator, 
 self._in_cdata = 0
 
 def characters(self, content):
-if self._in_cdata:
-self._out.write(content.replace(']]>', ']]>]]>', ']]>]]>

[issue1342] Crash on Windows if Python runs from a directory with umlauts

2007-10-27 Thread Christian Heimes

Christian Heimes added the comment:

The patch fixes parts of the problem. At least Python doesn't crash any
more when run from a directory with non ASCII chars. It just fails with
an import error in initstdio().

Added file: http://bugs.python.org/file8633/py3k_more_win_fsencoding.patch

__
Tracker <[EMAIL PROTECTED]>

__Index: Include/unicodeobject.h
===
--- Include/unicodeobject.h	(revision 58687)
+++ Include/unicodeobject.h	(working copy)
@@ -155,6 +155,7 @@
 # define PyUnicode_DecodeCharmap PyUnicodeUCS2_DecodeCharmap
 # define PyUnicode_DecodeLatin1 PyUnicodeUCS2_DecodeLatin1
 # define PyUnicode_DecodeFSDefault PyUnicodeUCS2_DecodeFSDefault
+# define PyUnicode_DecodeFSDefaultAndSize PyUnicodeUCS2_DecodeFSDefaultAndSize
 # define PyUnicode_DecodeRawUnicodeEscape PyUnicodeUCS2_DecodeRawUnicodeEscape
 # define PyUnicode_DecodeUTF32 PyUnicodeUCS2_DecodeUTF32
 # define PyUnicode_DecodeUTF32Stateful PyUnicodeUCS2_DecodeUTF32Stateful
@@ -247,6 +248,7 @@
 # define PyUnicode_DecodeCharmap PyUnicodeUCS4_DecodeCharmap
 # define PyUnicode_DecodeLatin1 PyUnicodeUCS4_DecodeLatin1
 # define PyUnicode_DecodeFSDefault PyUnicodeUCS4_DecodeFSDefault
+# define PyUnicode_DecodeFSDefaultAndSize PyUnicodeUCS4_DecodeFSDefaultAndSize
 # define PyUnicode_DecodeRawUnicodeEscape PyUnicodeUCS4_DecodeRawUnicodeEscape
 # define PyUnicode_DecodeUTF32 PyUnicodeUCS4_DecodeUTF32
 # define PyUnicode_DecodeUTF32Stateful PyUnicodeUCS4_DecodeUTF32Stateful
@@ -657,6 +659,12 @@
 const char *s   /* encoded string */
 );
 
+PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefaultAndSize(
+const char *s,   /* encoded string */
+Py_ssize_t size  /* size */
+);
+
+
 /* Return a char* holding the UTF-8 encoded value of the
Unicode object.
 
Index: Objects/unicodeobject.c
===
--- Objects/unicodeobject.c	(revision 58687)
+++ Objects/unicodeobject.c	(working copy)
@@ -1263,10 +1263,14 @@
 }
 
 PyObject*
-PyUnicode_DecodeFSDefault(const char *s)
-{
+PyUnicode_DecodeFSDefault(const char *s) {
 Py_ssize_t size = (Py_ssize_t)strlen(s);
+return PyUnicode_DecodeFSDefaultAndSize(s, size);
+}
 
+PyObject*
+PyUnicode_DecodeFSDefaultAndSize(const char *s, Py_ssize_t size)
+{
 /* During the early bootstrapping process, Py_FileSystemDefaultEncoding
can be undefined. If it is case, decode using UTF-8. The following assumes
that Py_FileSystemDefaultEncoding is set to a built-in encoding during the
@@ -1274,11 +1278,11 @@
 */
 if (Py_FileSystemDefaultEncoding) {
 #if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
-if (strcmp(Py_FileSystemDefaultEncoding, "mbcs")) {
+if (strcmp(Py_FileSystemDefaultEncoding, "mbcs") == 0) {
 return PyUnicode_DecodeMBCS(s, size, "replace");
 }
 #elif defined(__APPLE__)
-if (strcmp(Py_FileSystemDefaultEncoding, "utf-8")) {
+if (strcmp(Py_FileSystemDefaultEncoding, "utf-8") == 0) {
 return PyUnicode_DecodeUTF8(s, size, "replace");
 }
 #endif
Index: Python/sysmodule.c
===
--- Python/sysmodule.c	(revision 58687)
+++ Python/sysmodule.c	(working copy)
@@ -1081,11 +1081,11 @@
 	SET_SYS_FROM_STRING("platform",
 			PyUnicode_FromString(Py_GetPlatform()));
 	SET_SYS_FROM_STRING("executable",
-			PyUnicode_FromString(Py_GetProgramFullPath()));
+			PyUnicode_DecodeFSDefault(Py_GetProgramFullPath()));
 	SET_SYS_FROM_STRING("prefix",
-			PyUnicode_FromString(Py_GetPrefix()));
+			PyUnicode_DecodeFSDefault(Py_GetPrefix()));
 	SET_SYS_FROM_STRING("exec_prefix",
-		   	PyUnicode_FromString(Py_GetExecPrefix()));
+		   	PyUnicode_DecodeFSDefault(Py_GetExecPrefix()));
 	SET_SYS_FROM_STRING("maxint",
 			PyInt_FromLong(PyInt_GetMax()));
 	SET_SYS_FROM_STRING("maxsize",
@@ -1150,7 +1150,7 @@
 		p = strchr(path, delim);
 		if (p == NULL)
 			p = strchr(path, '\0'); /* End of string */
-		w = PyUnicode_FromStringAndSize(path, (Py_ssize_t) (p - path));
+		w = PyUnicode_DecodeFSDefaultAndSize(path, (Py_ssize_t) (p - path));
 		if (w == NULL) {
 			Py_DECREF(v);
 			return NULL;
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1342] Crash on Windows if Python runs from a directory with umlauts

2007-10-27 Thread Christian Heimes

Christian Heimes added the comment:

I've added a fprintf(stderr, "%s", path) to makepathobject(). I suspect
that PC/getpathp.c doesn't handle non ASCII chars correctly. It's using
char instead of w_char all over the place. Could that be related to the
issue, Neal?

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

c:\testäöü\PCBuild8\win32release>set PYTHONPATH=c:\testäöü\Lib

c:\testäöü\PCBuild8\win32release>python
c:\testõ÷³\Lib;c:\testõ÷³\PCBuild8\win32release\python30.zip;c:\testõ÷³\DLLs;c:\
testõ÷³\lib;c:\testõ÷³\lib\plat-win;c:\testõ÷³\lib\lib-tk;c:\testõ÷³\PCBuild8\wi
n32releaseFatal Python error: Py_Initialize: can't initialize sys
standard strea
ms
object  : ImportError('No module named encodings.utf_8',)
type: ImportError
refcount: 4
address : 00A43540
lost sys.stderr

This application has requested the Runtime to terminate it in an unusual
way.
Please contact the application's support team for more information.

--
nosy: +nnorwitz

__
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-27 Thread Jean Brouwers

Jean Brouwers added the comment:

Yes, that is the expected behavior in this case.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1135] xview/yview of Tix.Grid is broken

2007-10-27 Thread Hirokazu Yamamoto

Hirokazu Yamamoto added the comment:

Sorry for late repry. I couldn't apply Issue1522587's patch itself
because it was too old, so I tried only [xy]view{,_moveto,_scroll}
functions by applying patch partially. (partial.patch) And yes, it worked.

Added file: http://bugs.python.org/file8634/partial.patch

__
Tracker <[EMAIL PROTECTED]>

__Index: Lib/lib-tk/Tix.py
===
--- Lib/lib-tk/Tix.py	(revision 58625)
+++ Lib/lib-tk/Tix.py	(working copy)
@@ -1865,21 +1865,25 @@
 # def size dim index ?option value ...?
 # def unset x y
 
-def xview(self):
-return self._getdoubles(self.tk.call(self, 'xview'))
+def xview(self, *what):
+if not what:
+return self._getdoubles(self.tk.call(self._w, 'xview'))
+self.tk.call((self._w, 'xview') + what)
 def xview_moveto(self, fraction):
-self.tk.call(self,'xview', 'moveto', fraction)
+self.tk.call(self._w,'xview', 'moveto', fraction)
 def xview_scroll(self, count, what="units"):
-"Scroll right (count>0) or left  of units|pages"
-self.tk.call(self, 'xview', 'scroll', count, what)
+"Scroll right (count>0) or left (count<0) of units|pages"
+self.tk.call(self._w, 'xview', 'scroll', count, what)
 
-def yview(self):
-return self._getdoubles(self.tk.call(self, 'yview'))
+def yview(self, *what):
+if not what:
+return self._getdoubles(self.tk.call(self._w, 'yview'))
+self.tk.call((self._w, 'yview') + what)
 def yview_moveto(self, fraction):
-self.tk.call(self,'ysview', 'moveto', fraction)
+self.tk.call(self._w,'yview', 'moveto', fraction)
 def yview_scroll(self, count, what="units"):
-"Scroll down (count>0) or up  of units|pages"
-self.tk.call(self, 'yview', 'scroll', count, what)
+"Scroll down (count>0) or up (count>0) of units|pages"
+self.tk.call(self._w, 'yview', 'scroll', count, what)
 
 class ScrolledGrid(Grid):
 '''Scrolled Grid widgets'''
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1135] xview/yview of Tix.Grid is broken

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

Changes by Martin v. Löwis:


--
keywords: +patch

__
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-27 Thread Jean Brouwers

Jean Brouwers added the comment:

One final comment as confirmation.  If the messages are written to a file, 
other than stdout and stderr, they do appear in unpatched 3.0a1 and 3.0a1 
behaves as expected.  The root cause of the problem was the closed stdout.

__
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-27 Thread Guido van Rossum

Guido van Rossum added the comment:

So is there even a bug? Arguably you shouldn't be writing anything that
late in the life of a shared library.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1344] subprocess.communication doc could use clarification

2007-10-27 Thread Dean Sturtevant

New submission from Dean Sturtevant:

It would be helpful for the documentation for subprocess.communicate to
point out that when Popening a process, stdin=PIPE needs to be set if
the input parameter to communicate is to have any meaning. Similary,
stdout=PIPE and stderr=PIPE need to be set in order for the respective
component of the return value not to be None. That is, if that is indeed
correct (I observed this using Python 2.5 (r25:51908, Sep 19 2006,
09:52:17) [MSC v.1310 32 bit (Intel)] on win32)

--
components: Documentation
messages: 56858
nosy: dsturtevant
severity: normal
status: open
title: subprocess.communication doc could use clarification
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



[issue1329] Different 3.0a1 exit behavior

2007-10-27 Thread Jean Brouwers

Jean Brouwers added the comment:

It is quite common to pre-load libraries into existing binaries e.g. for 
profiling  Typically, those write to stdout or stderr only if the option 
for an output file is not used.  That is how I happened to run into the 
issue the other day.

For a while, the initial symptoms looked like the different exit 
behavior in 3.0a1 might be a serious problem.  It was not obvious that  
stdout and -err might have been closed and caused the difference.  All 
the Python 2.x versions never closed stdout and -err.

Therefore, 3.0 should probably not do that either.  But that is really 
your call.

__
Tracker <[EMAIL PROTECTED]>

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



[issue1332] threading.RLock().aquire(0) fails with python-2.5.1.amd64.msi

2007-10-27 Thread Christian Heimes

Christian Heimes added the comment:

Warren DeLano wrote:
> So I guess that automatically puts me in the **highly-
> motivated/willing-to-help** camp, if there's anything useful I can 
> actually do towards 2.5.2.

You can check every bugs related to 2.5 with urgent, high or no priority
and see if the bugs needs to be fixed for 2.5.2.

http://bugs.python.org/[EMAIL 
PROTECTED],id,activity,status&@sort=activity&@group=priority&@filter=versions,status&@pagesize=50&@startwith=0&status=1&versions=2

I guess at least the urgent and high priority bugs have to be addressed
for the new release.

Christian

__
Tracker <[EMAIL PROTECTED]>

__
___
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-27 Thread Christian Heimes

Christian Heimes added the comment:

The patch is fine but you should add a short comment to avoid future
trouble. On the first glance it's not obvious why the StringIO instance
mustn't have a newline argument.

--
nosy: +gvanrossum, tiran

__
Tracker <[EMAIL PROTECTED]>

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



[issue1252] IDLE - patch Delegator to support callables

2007-10-27 Thread Kurt B. Kaiser

Kurt B. Kaiser added the comment:

First, I'm changing my mind about Percolator inheriting from
Delegator.  A Percolator acts as a container for Delegators:
it "hasa" (chain) of them.  But it fails "isa" Delegator.
It has no use for the Delegator's caching, and chaining
Percolators doesn't make sense.  Inheriting from Delegator
just confuses things further, it seems to me.

Delegator is just a mixin implementing a node in the chain.

I do support splitting TkTextPercolator off Percolator.

> 3) make Delegator able to delegate direct calls

Except that the Delegator mixin doesn't know to what function
to delegate the call.  Delegating a function call down the nodes
doesn't do anything, except possibly error out if the bottom
object isn't callable, as in delegator.txt.

> IMO, the nice thing about the Delegator class is that you can
> use an instance just as if it were the underlying object, transparently.
> The major exception from this behavior was that calling a Delegator
> never works, even if the underlying object is callable.

But it does work, if the filter that is using the Delegator mixin has
a __call__ method.  See delegator2.txt above.  Note that the Delegator
__call__ method is removed.  You have to override the latter anyway
if you want to run some code in the filter.  Do you have some 
reason for mixing callable and non-callable filter instances in the
percolator chain?

I can see adding a __call__ method to Percolator, which would call
self.top().  Then each instance in the chain would have a __call__
to appropriate code.

We have two goals: solve your specific requirement of being able to
replace a method with a percolator, and increasing the clarity of the
existing WidgetRedirector/Delegator/Percolator code.

Yes, a Percolator already has semantic overload.  Right now, there are
two ways to access the chain:
1. Since the delegate link is exposed, filters can directly call
   specific methods further down the chain, e.g. self.delegate.index()
2. The caching and __getattr__() allows a "delegator" to call
   unimplemented methods; they will be looked up on the chain.  This
   allows ColorDelegator to access its Text instance's methods without
   having been passed a reference to the instance, as you noted.
   Whether this adds or detracts from the clarity of the code is
   debatable.  Once you understand how it works, it's not a problem,
   but it would be for people new to the code.  Further, it's fragile,
   since the first method with the correct name will be called.

Adding a __call__() method to Delegator doesn't seem to do anything
that can't be accomplished better by adding it to the class
implementing the filter.  Why add complexity prematurely?

--
assignee:  -> kbk
priority:  -> normal
Added file: http://bugs.python.org/file8635/delegator2.txt

__
Tracker <[EMAIL PROTECTED]>

__##
##def __call__(self, *args, **kw):
##return self.delegate(*args, **kw)

class Hooker(Delegator):

def __init__(self, name):
Delegator.__init__(self)
self.name = name

def my_fcn(self, caller):
print "Hooker %s called via %s" % (self.name, caller)

def __call__(self, *args, **kw):
self.my_fcn(*args)
self.delegate(*args, **kw)


class Interceptor(Delegator):

def __init__(self, name):
Delegator.__init__(self)
self.name = name

def my_fcn(self, caller):
print "Interceptor %s called via %s" % (self.name, caller)

def __call__(self, *args, **kw):
self.my_fcn(*args)
#self.delegate(*args, **kw) # uncomment to propagate

def fcn(caller):
print "Fcn at base called via %s" % caller

if __name__ == "__main__":
bottom = Hooker("bottom")
bottom.setdelegate(fcn)
middle = Hooker("middle")
middle.setdelegate(bottom)
top = Interceptor("top")
top.setdelegate(middle)
print "top: ", top
print "top.delegate: ", top.delegate
print "calling top()... "
top("top()")
___
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-27 Thread Christian Heimes

New submission from Christian Heimes:

Index: Lib/test/test_netrc.py
===
--- Lib/test/test_netrc.py  (revision 58695)
+++ Lib/test/test_netrc.py  (working copy)
@@ -25,7 +25,7 @@
 mode = 'w'
 if sys.platform not in ['cygwin']:
 mode += 't'
-fp = open(temp_filename, mode)
+fp = open(temp_filename, mode, newline='')
 fp.write(TEST_NETRC)
 fp.close()

--
components: Library (Lib)
messages: 56863
nosy: tiran
severity: normal
status: open
title: Fix for test_netrc on Windows
type: behavior
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



[issue1262] IDLE does not start if windows environment variable containing 'German Umlaute: äöü' exists

2007-10-27 Thread Christian Heimes

Christian Heimes added the comment:

Confirmed!

Python 3.0 doesn't start at all on Windows when an environment variable
with non ASCII chars is present. This bug is related to
http://bugs.python.org/issue1342.

However on Linux Python 3.0 can handle unicode characters in paths and
environ vars fine.

$ UNITEST="umlauts äöü ß " ./python -c "import os;
print(os.environ['UNITEST'])"
umlauts äöü ß

--
nosy: +tiran
severity: normal -> urgent

__
Tracker <[EMAIL PROTECTED]>

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



[issue1342] Crash on Windows if Python runs from a directory with umlauts

2007-10-27 Thread Christian Heimes

Christian Heimes added the comment:

The bug is related to http://bugs.python.org/issue1262

--
nosy: +gvanrossum
severity: normal -> urgent

__
Tracker <[EMAIL PROTECTED]>

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



[issue1346] Error using >>> from OpenGL.GLUT import *

2007-10-27 Thread Dale

New submission from Dale:

I get the response shown below when trying to use OpenGL. I have Python 
2.5, PIL-1.1.6, and PyOpenGL 3.0 installed.
Any help would be greatly appreciated.

Thanks,
Dale


>>> from OpenGL.GLUT import *

Traceback (most recent call last):
  File "", line 1, in 
from OpenGL.GLUT import *
  File "build\bdist.win32\egg\OpenGL\GLUT\__init__.py", line 4, in 

  File "build\bdist.win32\egg\OpenGL\GLUT\special.py", line 73, in 

AttributeError: 'NoneType' object has no attribute 'glutDestroyWindow'
>>> 



__init__.py line 4 is;

from OpenGL.GLUT.special import *


special.py line 73 is;

_base_glutDestroyWindow = GLUT.glutDestroyWindow

--
components: Windows
messages: 56866
nosy: neuralsensor
severity: normal
status: open
title: Error using >>> from OpenGL.GLUT import *
type: compile error
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



[issue1346] Error using >>> from OpenGL.GLUT import *

2007-10-27 Thread Gabriel Genellina

Gabriel Genellina added the comment:

Looks like GLUT in special.py is None. You should ask the PyOpenGL 
author/community for help. This is not a Python bug.

--
nosy: +gagenellina

__
Tracker <[EMAIL PROTECTED]>

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



[issue1336] subprocess.Popen hangs when child writes to stderr

2007-10-27 Thread Gabriel Genellina

Changes by Gabriel Genellina:


--
nosy: +gagenellina

__
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-27 Thread Bill Janssen

New submission from Bill Janssen:

A number of places in the BaseHTTPServer got missed when converting 
between bytes and strings.  Here's a patch to fix that.

--
components: Library (Lib)
files: a
messages: 56868
nosy: janssen
severity: normal
status: open
title: BaseHTTPServer writing strings to bytes interface
type: behavior
versions: Python 3.0
Added file: http://bugs.python.org/file8636/a

__
Tracker <[EMAIL PROTECTED]>

__

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



[issue1252] IDLE - patch Delegator to support callables

2007-10-27 Thread Tal Einat

Tal Einat added the comment:

It seems we're looking at Delegators and Percolators from increasingly
different points of view. Let's back up a little.


I see a Delegator object as a transparent proxy to its "delegate". This
means that attribute access is automatically delegated to the delegate,
unless it is explicitly overridden by the Delegator. That's it.

Some use cases for such a transparent proxy are:
* override only specific attributes/methods of an object
* allow replacement of an object which is referenced in several places
without having to update every reference

(Caching is just an implementation detail, whose only purpose is to
facilitate changing a Delegator's delegate.)


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.

IMO chaining Percolators makes just as much sense as chaining Delegators
-- you're just chaining proxies. How each proxy works internally doesn't
really matter (as long as they work :).


Now, it seems to me that you aren't looking at Delegators and
Peroclators as transparent proxies at all. Specifically, what you wrote
implies that in order to proxy a callable, one should explicitly define
an __call__ method in their Delegator class/instance. But this is
exactly the opposite of the behavior with any other method/attribute,
where I can implicitly have the underlying attribute used by not
defining it in the Delegator. This is Delegator is for!


I'm attaching a Python file which will hopefully show how __call__ is
out of sync with the rest of Delegator's behavior. In its context,
"forwarded" means explicitly defined by a Delegator. "intercepted" means
that except for the interceptor and catcher, the method is not defined
(i.e. by the passers). Please take a moment to run it.


I should note that the situation is similar with other "magic" methods,
e.g. len(). This seems to make Python a bit less dynamic that I would
expect. Aside from implementation considerations such as speed, I'm not
sure I see why this is the way it is, e.g. why dynamically giving a
__call__ attribute to an instance shouldn't make it callable. I'll do
some more searching and reading on this.

Even though, I still think being able to delegate/percolate callables is
important enough to warrant such a change. After all, at the bottom
line, if the underlying object is callable then it will be called, and
if not then an appropriate exception will be raised. Isn't that the
Right Thing?

Added file: http://bugs.python.org/file8637/Delegators3.py

__
Tracker <[EMAIL PROTECTED]>

__import traceback
from Delegator import Delegator

class NamedDelegator(Delegator):
"A bit of infrastructure..."
def __init__(self, name):
Delegator.__init__(self)
self.name = name

def _forward(self, to):
return self.name + ' -> ' + to

def _catch(self):
return self.name


class Catcher(NamedDelegator):
"Just catches everything"
forwarded = intercepted = quietly_forwarded = quietly_intercepted = \
__call__ = NamedDelegator._catch

class Passer(NamedDelegator):
"Just forwards everything"
def forwarded(self):
return self._forward(self.delegate.forwarded())

def intercepted(self):
return self._forward(self.delegate.intercepted())

# forwarding quietly means letting Delegator take care of it

class Interceptor(NamedDelegator):
"Forwards or intercepts, according to method names"
def forwarded(self):
return self._forward(self.delegate.forwarded())

quietly_intercepted = NamedDelegator._catch
intercepted = NamedDelegator._catch
__call__ = NamedDelegator._catch

class CallableDelegator(Delegator):
def __call__(self, *args, **kwargs):
return self.delegate.__call__(*args, **kwargs)

# Set up a chain
bottom = b0 = Catcher("Catcher")
b1 = Passer("Passer 1")
b1.setdelegate(b0)
b2 = Interceptor("Interceptor 2")
b2.setdelegate(b1)
top = b3 = Passer("Passer 3")
b3.setdelegate(b2)

# See what happens

print '"forwarded" is only implemented by the bottom ("Catcher"):'
print 'top.forwarded() =', top.forwarded()
print
print 'but "intercepted" is also implemented by b2 ("Interceptor 2"):'
print 'top.intercepted() =', top.intercepted()
print

print 'this is how it looks without printing the chains:'
print 'top.quietly_forwarded() =', top.quietly_forwarded()
print 'top.quietly_intercepted() =', top.quietly_intercepted()
print

print "now let's try something similar with __call__:"
Callable = CallableDelegator()
Callable.setdelegate(top)
print 'Callable() =', Callable()
NonCallable = Delegator()
NonCallab

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

2007-10-27 Thread Bill Janssen

New submission from Bill Janssen:

I can't get urllib.urlopen() to work with SSL, and it seems to be due to 
a bug in the re-write of httplib.  HTTPConnection.getresponse() is 
closing the socket, but then returning a response object holding onto 
that closed socket to the caller, who then tries to read from the 
(closed) socket.  Due to the delayed closing of sockets, this error is 
masked, but in SSL, the context is torn down on close, so we see real 
failures.

--
components: Library (Lib)
keywords: py3k
messages: 56870
nosy: janssen
priority: urgent
severity: normal
status: open
title: httplib closes socket, then tries to read from it
type: behavior
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



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

2007-10-27 Thread Bill Janssen

Bill Janssen added the comment:

I believe this is all that's needed.

Added file: http://bugs.python.org/file8638/c

__
Tracker <[EMAIL PROTECTED]>

__

c
Description: Binary data
___
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-27 Thread Bill Janssen

New submission from Bill Janssen:

Neal, a patch to get rid of the other ord() calls in ic.py.

--
assignee: nnorwitz
components: Library (Lib), Macintosh
files: d
keywords: py3k
messages: 56872
nosy: janssen, nnorwitz
priority: high
severity: normal
status: open
title: more uses of ord() in plat-mac/ic.py
type: behavior
versions: Python 3.0
Added file: http://bugs.python.org/file8639/d

__
Tracker <[EMAIL PROTECTED]>

__

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



[issue1328] feature request: force BOM option

2007-10-27 Thread Gabriel Genellina

Changes by Gabriel Genellina:


--
nosy: +gagenellina

__
Tracker <[EMAIL PROTECTED]>

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



[issue1311] os.path.exists(os.devnull) regression on windows

2007-10-27 Thread Gabriel Genellina

Gabriel Genellina added the comment:

All these tests on Windows XP SP4, executing os.stat("nul")

Python 2.1 thru 2.4  raises: 
OSError: [Errno 22] Invalid argument: 'nul'

Python 2.5 gives a different error:
WindowsError: [Error 87] El parámetro no es correcto: 'nul'

--
nosy: +gagenellina

__
Tracker <[EMAIL PROTECTED]>

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



[issue1252] IDLE - patch Delegator to support callables

2007-10-27 Thread Kurt B. Kaiser

Kurt B. Kaiser added the comment:

I'll respond further shortly.  In the meantime, please notice that
Delegator3.py works the same whether or not your Delegator.__call__()
method is commented out.  That's because you needed to define __call__()
methods in your filters.

We are still suffering from semantic overload.  Let's call the instances
which are chained 'filters' and the Delegator mixin machinery 'nodes' for
the purposes of this discussion (because they act much like the nodes in
a traditional Lisp list).

__
Tracker <[EMAIL PROTECTED]>

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



[issue1334] IDLE - Fix several highlighting bugs

2007-10-27 Thread Tal Einat

Tal Einat added the comment:

The first patch contained a bug - a window opened using the "New Window"
menu option would not be colorized.

This patch removes the assumption that EditorWindow.ResetColorizer will
be called by IOBinding code, by calling ResetColorizer during __init__
anyways. This means that in some cases it will be called multiple times,
but this has no noticeable effect since the window is not shown until
afterwards. (In the worst case scenario, the colors would "blink" once
or twice.)

Added file: http://bugs.python.org/file8640/IDLE_highlighting.071028.patch

__
Tracker <[EMAIL PROTECTED]>

__

IDLE_highlighting.071028.patch
Description: Binary data
___
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-10-27 Thread Tal Einat

New submission from Tal Einat:

This (relatively speaking) simple patch allows the full doc-string of a
callable to be displayed in a textView window. Once a call-tip is being
displayed, hitting one of the keys which is bound to the
force-open-calltip virtual event (Control-backslash by default) opens
the new window. If there is no extra documentation to be shown (in
addition to what is already shown in the call-tip), the window is not
displayed.

--
components: IDLE
files: IDLE_CallTips.071028.patch
messages: 56876
nosy: kbk, taleinat
severity: minor
status: open
title: IDLE - CallTips enhancement - show full doc-string in new window
versions: Python 2.5, Python 2.6
Added file: http://bugs.python.org/file8641/IDLE_CallTips.071028.patch

__
Tracker <[EMAIL PROTECTED]>

__

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