[issue1091] [patch] py3k Mac installation errors

2007-09-03 Thread Humberto Diogenes

Humberto Diogenes added the comment:

One more patch, for:
 1. Writing str to binary file;
 2. Using string exceptions.

Traceback for #2:
/usr/bin/install -c -s ../python.exe 
/Library/Frameworks/Python.framework/Versions/3.0/Resources/Python.app/
Contents/MacOS/Python
DYLD_FRAMEWORK_PATH=/Users/humberto/src/open/py3k: ../python.exe 
./scripts/BuildApplet.py \
--destroot  \
--python 
/Library/Frameworks/Python.framework/Versions/3.0/Resources/Python.app/C
ontents/MacOS/Python \
--output /Applications/MacPython 3.0/Build Applet.app \
./scripts/BuildApplet.py
./scripts/BuildApplet.py:16: DeprecationWarning: the buildtools module 
is deprecated
  import buildtools
Traceback (most recent call last):
  File ./scripts/BuildApplet.py, line 149, in module
main()
  File ./scripts/BuildApplet.py, line 34, in main
except buildtools.BuildError as detail:
TypeError: catching classes that do not inherit from BaseException is 
not allowed
make[1]: *** [install_BuildApplet] Error 1
make: *** [frameworkinstallapps] Error 2

After applying those two attached patches, I was able to succesfully run 
make altinstall (not without some other warnings, though).

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1091
__Index: Lib/plat-mac/buildtools.py
===
--- Lib/plat-mac/buildtools.py  (revision 57912)
+++ Lib/plat-mac/buildtools.py  (working copy)
@@ -17,7 +17,8 @@
 warnings.warn(the buildtools module is deprecated, DeprecationWarning, 2)
 
 
-BuildError = BuildError
+class BuildError(BaseException):
+pass
 
 # .pyc file (and 'PYC ' resource magic number)
 MAGIC = imp.get_magic()
Index: Lib/plat-mac/bundlebuilder.py
===
--- Lib/plat-mac/bundlebuilder.py   (revision 57912)
+++ Lib/plat-mac/bundlebuilder.py   (working copy)
@@ -180,8 +180,9 @@
 assert len(self.type) == len(self.creator) == 4, \
 type and creator must be 4-byte strings.
 pkginfo = pathjoin(contents, PkgInfo)
+data = bytes(self.type + self.creator, encoding='ascii')
 f = open(pkginfo, wb)
-f.write(self.type + self.creator)
+f.write(data)
 f.close()
 #
 # Write Contents/Info.plist
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1092] Unexpected results in Tutorial about Unicode

2007-09-03 Thread Georg Brandl

Georg Brandl added the comment:

Vizcaynot schrieb:
 New submission from Vizcaynot:
 
 When trying the tutorial example about unicode  I have:
 Äpfel.encode('utf-8')
   File stdin, line 1
 SyntaxError: (unicode error) unexpected code byte

This is definitely a bug. Assigning to Martin to investigate.

--
assignee:  - loewis
nosy: +georg.brandl, loewis

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1092
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1091] [patch] py3k Mac installation errors

2007-09-03 Thread Humberto Diogenes

Humberto Diogenes added the comment:

Patch 3: some more trivial fixes: new syntax for print() and octal 
numbers.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1091
__Index: Mac/PythonLauncher/Makefile.in
===
--- Mac/PythonLauncher/Makefile.in  (revision 57912)
+++ Mac/PythonLauncher/Makefile.in  (working copy)
@@ -78,4 +78,4 @@
$(CC) $(LDFLAGS) -o Python Launcher $(OBJECTS) -framework AppKit 
-framework Carbon
 
 Info.plist: $(srcdir)/Info.plist.in
-   sed 's/%VERSION%/'`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; 
print platform.python_version()'`'/g'  $(srcdir)/Info.plist.in  Info.plist
+   sed 's/%VERSION%/'`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; 
print(platform.python_version())'`'/g'  $(srcdir)/Info.plist.in  Info.plist
Index: Mac/IDLE/Makefile.in
===
--- Mac/IDLE/Makefile.in(revision 57912)
+++ Mac/IDLE/Makefile.in(working copy)
@@ -55,5 +55,5 @@
 
 
 Info.plist: $(srcdir)/Info.plist.in
-   sed 's/%VERSION%/'`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; 
print platform.python_version()'`'/g'  $(srcdir)/Info.plist.in  Info.plist
+   sed 's/%VERSION%/'`$(RUNSHARED) $(BUILDPYTHON) -c 'import platform; 
print(platform.python_version())'`'/g'  $(srcdir)/Info.plist.in  Info.plist
 
Index: Mac/Tools/fixapplepython23.py
===
--- Mac/Tools/fixapplepython23.py   (revision 57912)
+++ Mac/Tools/fixapplepython23.py   (working copy)
@@ -80,11 +80,11 @@
 Create a wrapper script for a compiler
 dirname = os.path.split(filename)[0]
 if not os.access(dirname, os.X_OK):
-os.mkdir(dirname, 0755)
+os.mkdir(dirname, 0o755)
 fp = open(filename, 'w')
 fp.write(SCRIPT % compiler)
 fp.close()
-os.chmod(filename, 0755)
+os.chmod(filename, 0o755)
 print('fixapplepython23: Created', filename)
 
 def main():
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue883466] quopri encoding Unicode

2007-09-03 Thread Georg Brandl

Georg Brandl added the comment:

Okay, changed in rev. 57925. Closing this as fixed.

--
resolution:  - fixed
status: open - closed


Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue883466

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



[issue1078] cachersrc.py using tuple unpacking args

2007-09-03 Thread Georg Brandl

Georg Brandl added the comment:

Superseded by #1091 patches.

--
nosy: +georg.brandl
resolution:  - duplicate
status: open - closed
superseder:  - [patch] py3k Mac installation errors

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1078
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1043] test_builtin failure on Windows

2007-09-03 Thread Georg Brandl

Georg Brandl added the comment:

This was apparently fixed by Thomas with rev. 57828.

--
nosy: +georg.brandl
resolution:  - fixed
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1043
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1091] py3k Mac installation errors

2007-09-03 Thread Georg Brandl

Georg Brandl added the comment:

Thanks for the patches, I've applied them as rev. 57926.

--
nosy: +georg.brandl
resolution:  - accepted
status: open - closed
title: [patch] py3k Mac installation errors - py3k Mac installation errors

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1091
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1045] Performance regression in 2.5

2007-09-03 Thread Georg Brandl

Georg Brandl added the comment:

May this be a byproduct of the new generator features in 2.5?

--
nosy: +georg.brandl

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1045
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1077] itertools missing, causes interactive help to break

2007-09-03 Thread Georg Brandl

New submission from Georg Brandl:

Python 3.0a1 includes itertools and normally builds it, so the
interesting thing would be why it isn't present on your system :)

Have you built Python yourself? If so, can you provide build logs and/or
error messages?

--
nosy: +georg.brandl

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1077
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1075] py3k: Unicode error in os.stat on Windows

2007-09-03 Thread Martin v. Löwis

Martin v. Löwis added the comment:

I could not quite reproduce this on the German version (the error text
reads  Das System kann die angegebene Datei nicht finden on XP),
however, the patch looks good and it fixes the same problem for the
registry functions (where I get Das Handle ist ungültig), so I
committed it as r57927.

--
nosy: +loewis
resolution:  - accepted
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1075
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1071] unicode.translate() doesn't error out on invalid translation table

2007-09-03 Thread Georg Brandl

Georg Brandl added the comment:

Yes, that makes sense.
New patch attached, copying the dict and using PyDict_Next.

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1071
__Index: Doc/library/stdtypes.rst
===
--- Doc/library/stdtypes.rst(Revision 57875)
+++ Doc/library/stdtypes.rst(Arbeitskopie)
@@ -948,9 +948,10 @@
 .. method:: str.translate(map)
 
Return a copy of the *s* where all characters have been mapped through the
-   *map* which must be a mapping of Unicode ordinals (integers) to Unicode
-   ordinals, strings or ``None``.  Unmapped characters are left
-   untouched. Characters mapped to ``None`` are deleted.
+   *map* which must be a dictionary of characters (strings of length 1) or
+   Unicode ordinals (integers) to Unicode ordinals, strings or ``None``.
+   Unmapped characters are left untouched. Characters mapped to ``None`` are
+   deleted.
 
.. note::
 
Index: Objects/unicodeobject.c
===
--- Objects/unicodeobject.c (Revision 57871)
+++ Objects/unicodeobject.c (Arbeitskopie)
@@ -7763,10 +7763,54 @@
 static PyObject*
 unicode_translate(PyUnicodeObject *self, PyObject *table)
 {
-return PyUnicode_TranslateCharmap(self-str,
- self-length,
- table,
- ignore);
+PyObject *newtable = NULL;
+Py_ssize_t i = 0;
+PyObject *key, *value, *result;
+
+if (!PyDict_Check(table)) {
+PyErr_SetString(PyExc_TypeError, translate argument must be a dict);
+return NULL;
+}
+/* fixup the table -- allow size-1 string keys instead of only int keys */
+newtable = PyDict_Copy(table);
+if (!newtable) return NULL;
+while (PyDict_Next(table, i, key, value)) {
+if (PyUnicode_Check(key)) {
+/* convert string keys to integer keys */
+PyObject *newkey;
+int res;
+if (PyUnicode_GET_SIZE(key) != 1) {
+PyErr_SetString(PyExc_ValueError, string items in translate 
+table must be 1 element long);
+goto err;
+}
+newkey = PyInt_FromLong(PyUnicode_AS_UNICODE(key)[0]);
+if (!newkey)
+goto err;
+res = PyDict_SetItem(newtable, newkey, value);
+Py_DECREF(newkey);
+if (res  0)
+goto err;
+} else if (PyInt_Check(key)) {
+/* just keep integer keys */
+if (PyDict_SetItem(newtable, key, value)  0)
+goto err;
+} else {
+PyErr_SetString(PyExc_TypeError, items in translate table must be 

+strings or integers);
+goto err;
+}
+}
+
+result = PyUnicode_TranslateCharmap(self-str,
+self-length,
+newtable,
+ignore);
+Py_DECREF(newtable);
+return result;
+  err:
+Py_DECREF(newtable);
+return NULL;
 }
 
 PyDoc_STRVAR(upper__doc__,
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1076] py3 patch: full Unicode version for winreg module

2007-09-03 Thread Martin v. Löwis

Martin v. Löwis added the comment:

Thanks for the patch. Committed as r57928

--
resolution:  - accepted
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1076
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1089] ever considered adding static typing to python?

2007-09-03 Thread Martin v. Löwis

New submission from Martin v. Löwis:

Yes.

--
nosy: +loewis
resolution:  - wont fix
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1089
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1091] py3k Mac installation errors

2007-09-03 Thread Humberto Diogenes

Humberto Diogenes added the comment:

And thanks for accepting them! (without complaining about my errors :-)

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1091
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1094] TypeError in poplib.py

2007-09-03 Thread Serge Julien

New submission from Serge Julien:

In poplib.py, lines 137-138, bytes and str are compared, leading to a
TypeError:

[...]
137while line != '.':
138if line[:2] == '..':
[...]

where type(line) = type 'bytes'

--
components: Library (Lib)
messages: 55617
nosy: serge.julien
severity: normal
status: open
title: TypeError in poplib.py
versions: Python 3.0

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1094
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1094] TypeError in poplib.py

2007-09-03 Thread Serge Julien

Serge Julien added the comment:

Patch proposal.

Tell me if it's right to submit it here: this is the first patch I submit

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1094
__

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



[issue1094] TypeError in poplib.py

2007-09-03 Thread Martin v. Löwis

Changes by Martin v. Löwis:


--
keywords: +patch

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1094
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1114345] Add SSL certificate validation

2007-09-03 Thread vila-sf


vila-sf
 added the comment:

Using CERT_NONE or adding the cert covers my needs, thanks.

Any hope this will be backported to python 2.5 ?

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1114345
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1114345] Add SSL certificate validation

2007-09-03 Thread Martin v. Löwis

Martin v. Löwis added the comment:

There definitely won't be any new features in 2.5.x. However, I think
Bill said he might make this available separately.

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1114345
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1777530] ctypes on Solaris

2007-09-03 Thread Thomas Heller

Thomas Heller added the comment:

This is an experimental patch (solaris.patch).  Can you please proofread
it and try it out on the solaris machine?

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1777530
_Index: util.py
===
--- util.py	(revision 57552)
+++ util.py	(working copy)
@@ -70,11 +70,18 @@
 # assuming GNU binutils / ELF
 if not f:
 return None
-cmd = objdump -p -j .dynamic 2/dev/null  + f
-res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read())
-if not res:
-return None
-return res.group(1)
+if sys.platform.startswith(solaris):
+cmd = elfdump -d 2/dev/null  + f
+res = re.search(r'\sSONAME\s+([^\s]+)\s+([^\s]+)', os.popen(cmd).read())
+if not res:
+return None
+return res.group(2)
+else:
+cmd = objdump -p -j .dynamic 2/dev/null  + f
+res = re.search(r'\sSONAME\s+([^\s]+)', os.popen(cmd).read())
+if not res:
+return None
+return res.group(1)
 
 if (sys.platform.startswith(freebsd)
 or sys.platform.startswith(openbsd)
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1114345] Add SSL certificate validation

2007-09-03 Thread Bill Janssen

Bill Janssen added the comment:

I'm planning to do a package for 2.3...

Sent from my iPhone

On Sep 3, 2007, at 5:32 AM,
vila-sf
[EMAIL PROTECTED] wrote:



vila-sf
 added the comment:

 Using CERT_NONE or adding the cert covers my needs, thanks.

 Any hope this will be backported to python 2.5 ?

 _
 Tracker [EMAIL PROTECTED]
 http://bugs.python.org/issue1114345
 _

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1114345
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1777530] ctypes on Solaris

2007-09-03 Thread Aki

Aki added the comment:

Hello Thomas,

Thank you for creating the patch.
Unfortunately, it didn't work.
(I rerun the whole installation process)

You used the following to check if the os is Solaris:

if sys.platform.startswith(solaris):

Under Solaris 2.x sys.platform returns sunos5.
You could use ...startswith(sunos) but things may be different under
sunos6 so I usually prefer to use sys.platform == sunos5.

After fixing this, my application with ctypes works okay.

I'm happy to try out if you create another patch.

Thank you,
Aki-

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1777530
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1095] make install failed

2007-09-03 Thread Aki

New submission from Aki:

I thought this was already reported but I didn't see it in the list.
If this issue is already addressed, please discard.

The 'make install' failed if I re-run the installation again because
python-config under /usr/local/bin was already there.

Removing /usr/local/lib/python2.5/lib-dynload/Python-2.5.1-py2.5.egg-info
Writing /usr/local/lib/python2.5/lib-dynload/Python-2.5.1-py2.5.egg-info
if test -f /usr/local/bin/python -o -h /usr/local/bin/python; \
then rm -f /usr/local/bin/python; \
else true; \
fi
(cd /usr/local/bin; ln python2.5 python)
(cd /usr/local/bin; ln -sf python2.5-config python-config)
ln: cannot create python-config: File exists
make: *** [bininstall] Error 2

I didn't see such problem under 2.4.

Aki-

--
components: Installation
messages: 55624
nosy: akineko
severity: normal
status: open
title: make install failed
versions: Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1095
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1097] input() should respect sys.stdin.encoding when in interactive mode

2007-09-03 Thread Sangpil Yoon

New submission from Sangpil Yoon:

Currently in interactive mode, when you try to input non-ascii
characters using input() builtin function, you get UnicodeDecodeError.

 print(input())
윤상필
Traceback (most recent call last):
  File stdin, line 1, in module
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 0-1:
illegal encoding

The error says that input() function is trying to decode the byte string
using the utf8 codec, when sys.stdin.encoding is not 'utf8'.

 import sys; print(sys.stdin.encoding)
cp949

In non-interactive mode, input() works just fine.

--
components: Unicode
messages: 55627
nosy: philyoon
severity: normal
status: open
title: input() should respect sys.stdin.encoding when in interactive mode
type: behavior
versions: Python 3.0

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1097
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1762561] unable to serialize Infinity or NaN on ARM using marshal

2007-09-03 Thread Martin v. Löwis

Martin v. Löwis added the comment:

I'm not sure like the naming of the format. mixed-endian could mean
anything. I doubt IEEE specifies this as a possible byte representation
(but then, I'm uncertain whether IEEE specifies big-endian and
little-endian, either).

One option would be to call it ARM, mixed-endian, assuming this can be
only found on ARM.

Another option would be to call it IEEE,
bytes-big-words-little-endian, describing precisely how the format
works (IIUC).

Tim, any opinion?

--
assignee:  - tim_one
nosy: +loewis, tim_one

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1762561
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1097] input() should respect sys.stdin.encoding when in interactive mode

2007-09-03 Thread Martin v. Löwis

Martin v. Löwis added the comment:

Thanks for the report. This is now fixed in r57947

--
nosy: +loewis
resolution:  - fixed
status: open - closed

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1097
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1098] decode_unicode doesn't nul-terminate

2007-09-03 Thread Adam Olsen

New submission from Adam Olsen:

In the large else branch in decode_unicode (if encoding is not NULL or
iso-8859-1), the new string it produces is not nul-terminated.  This
then hits PyUnicode_DecodeUnicodeEscape's octal escape case, which reads
past the end of the string (but would stop if there was a nul there.)

I found this via valgrind.

--
messages: 55630
nosy: rhamphoryncus
severity: normal
status: open
title: decode_unicode doesn't nul-terminate

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1098
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com