[issue6543] traceback presented in wrong encoding

2009-07-22 Thread Fan Decheng

New submission from Fan Decheng fandech...@gmail.com:

traceback information is wrongly encoded.
Steps to reproduce:
1. Use a version of Windows that supports CP936 (Simplified Chinese) as 
the default encoding.
2. Create a directory containing Chinese characters. Such as C:\测试
3. In the directory create a python file such as C:\测试\test.py
4. In the python file enter the following lines
import traceback
try:
aaa # create a non-existent name
except Exception as ex:
traceback.print_exc()
5. Run the program with this command line (remember to use full path to 
the test.py file):
C:\Python31\python.exe C:\测试\test.py
6. See the output.

Expected result:
There is correct output without encoding problems. Such as:

Traceback (most recent call last):
  File C:\测试\test.py, line 3, in module
NameError: name 'aaa' is not defined

Actual result:
UTF-8 encoded string is decoded using CP936 so the output is incorrect.

Traceback (most recent call last):
  File C:\娴嬭瘯\test.py, line 3, in module
NameError: name 'aaa' is not defined

Additional information:
In Python 3.0, such test would generate:
File decoding error, line 221, in main
In Python 3.1, the test generates the output mentioned in the repro 
steps.  As I tried traceback.format_exc(), it seems the original 
characters 测试 have become three Unicode characters when returned by 
format_exc().

--
components: Interpreter Core
messages: 90803
nosy: r_mosaic
severity: normal
status: open
title: traceback presented in wrong encoding
type: behavior
versions: Python 3.1

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



[issue6544] Fix refleak in kqueue implementation

2009-07-22 Thread Georg Brandl

New submission from Georg Brandl ge...@python.org:

This patch should fix leaking it in some error conditions.  Christian,
can you please review?

--
assignee: christian.heimes
components: Extension Modules
files: select-refleak.diff
keywords: patch
messages: 90804
nosy: christian.heimes, georg.brandl
severity: normal
status: open
title: Fix refleak in kqueue implementation
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file14536/select-refleak.diff

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



[issue6423] The cgi docs should advertize using in instead of has_key

2009-07-22 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Metoo :) Go ahead.

--

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



[issue6545] test fails in distutils.tests.test_extensions if -O is used

2009-07-22 Thread Tarek Ziadé

New submission from Tarek Ziadé ziade.ta...@gmail.com:

That's because the Extension class has some assert statement, I'll
remove them.

--
assignee: tarek
components: Distutils
messages: 90806
nosy: tarek
severity: normal
status: open
title: test fails in distutils.tests.test_extensions if -O is used
versions: Python 2.7, Python 3.1, Python 3.2

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



[issue6545] test fails in distutils.tests.test_extensions if -O is used

2009-07-22 Thread Tarek Ziadé

Tarek Ziadé ziade.ta...@gmail.com added the comment:

Fixed in r74163, r74164, r74165.

--
status: open - closed

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



[issue6499] Can't import xmlrpclib, DocXMLRPCServer and SimpleXMLRPCServer when zlib is not available

2009-07-22 Thread Kristján Valur Jónsson

Kristján Valur Jónsson krist...@ccpgames.com added the comment:

I can't reproduce this, no.  I only have access to a windows machine 
and you appear to have a custom build (no zlib).  I need your help to 
get the error message, so you need to try harder.  (there are probably 
at least two problems, one causing an exeption and one causing the 
error output to fail)

Try adding something like this into the file, after the except 
socket.timeout clause:
except:
import traceback
traceback.print_exc(100, open(rc:/tmp/err.txt, a, 0))
raise

--

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



[issue2698] Extension module build fails for MinGW: missing vcvarsall.bat

2009-07-22 Thread Eric Devolder

Changes by Eric Devolder eric.devol...@gmail.com:


--
nosy: +keldonin

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



[issue6525] Problem with string.lowercase in Windows XP

2009-07-22 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

This behavior is not a bug - when setting the locale, string.lowercase
and friends are augmented by whatever the locale considers uppercase and
lowercase letters, as byte strings.  This will lead to decoding errors
when these strings are combined with Unicode strings.

Either you use string.ascii_lowercase and friends, or you make sure you
know what encoding the strings will be in, and decode accordingly.

--
nosy: +georg.brandl
resolution:  - wont fix
status: open - closed

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



[issue6540] bytearray.translate(): error in error handling

2009-07-22 Thread Georg Brandl

Georg Brandl ge...@python.org added the comment:

Thanks, fixed in r74167.

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

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



[issue6525] Problem with string.lowercase in Windows XP

2009-07-22 Thread Peter Landgren

Peter Landgren peter.tal...@telia.com added the comment:

OK,
Agreed for 2.6.

But for 2.5 many of the characters returned by string.lowercase:
âܣ׬Á║▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷°¨·¹³²■ 
are not lowercase letters at all, but that is history now, as 2.5 is history.
We solved it by using ascii_lowercase.
Thanks,
Peter Landgren

 Georg Brandl ge...@python.org added the comment:

 This behavior is not a bug - when setting the locale, string.lowercase
 and friends are augmented by whatever the locale considers uppercase and
 lowercase letters, as byte strings.  This will lead to decoding errors
 when these strings are combined with Unicode strings.

 Either you use string.ascii_lowercase and friends, or you make sure you
 know what encoding the strings will be in, and decode accordingly.

 --
 nosy: +georg.brandl
 resolution:  - wont fix
 status: open - closed

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue6525
 ___

--

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



[issue2698] Extension module build fails for MinGW: missing vcvarsall.bat

2009-07-22 Thread Eric Devolder

Eric Devolder eric.devol...@gmail.com added the comment:

Same problem under WinXP, using mingw compiler. Works for my package
under Python 3.0, ceases functioning under 3.1, with same error message.

--

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



[issue6501] Fatal LookupError: unknown encoding: cp0 on Windows embedded startup.

2009-07-22 Thread Graham Dumpleton

Graham Dumpleton graham.dumple...@gmail.com added the comment:

The workaround of using:

#if defined(WIN32)  PY_MAJOR_VERSION = 3
_wputenv(LPYTHONIOENCODING=cp1252:backslashreplace);
#endif

Py_Initialize();

gets around the crash on startup.

I haven't done sufficient testing to know if this may introduce any other 
problems given that one is overriding default I/O encoding for whole 
process.

--

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



[issue6546] [Distutils][PATCH] Add bdist_rpm option to select the name of the resulting package

2009-07-22 Thread OG7

New submission from OG7 ony...@users.sourceforge.net:

This simple Distutils patch allows choosing the name of the rpm built by
bdist_rpm.
It leaves the name of the source tarball alone, and changes the name of
the resulting spec file and rpm.

It was tested with distutils nightlies, and applies to at least python
2.5 through 2.7dev .

--
assignee: tarek
components: Distutils
files: 0001-Add-bdist_rpm-option-to-select-the-name-of-the-resul.patch
keywords: patch
messages: 90814
nosy: OG7, tarek
severity: normal
status: open
title: [Distutils][PATCH] Add bdist_rpm option to select the name of the 
resulting package
type: feature request
versions: Python 2.7
Added file: 
http://bugs.python.org/file14537/0001-Add-bdist_rpm-option-to-select-the-name-of-the-resul.patch

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



[issue6543] traceback presented in wrong encoding

2009-07-22 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

This also happens on a Western Windows (cp437, mbcs==cp1252) with a
filename like café.py.

The attached patch corrects three problems:

- in compile.c, the c_filename member has utf8 encoding, and must not be
decoded with PyUnicode_DecodeFSDefault. This is the reported issue.

- Same thing in pythonrun.c, if you want print(__file__) to work.

- in traceback.c, the content of the file is not shown.


Tested with this script:
=
print(file name:, __file__)
import traceback
try:
aaa
except:
traceback.print_exc()
raise
=

The output should be:
=
file name: c:\temp\café.py
Traceback (most recent call last):
  File c:\temp\café.py, line 4, in module
aaa
NameError: name 'aaa' is not defined
Traceback (most recent call last):
  File c:\temp\café.py, line 4, in module
aaa
NameError: name 'aaa' is not defined
=

--
keywords: +patch
nosy: +amaury.forgeotdarc
Added file: http://bugs.python.org/file14538/traceback-encoding.patch

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



[issue6543] traceback presented in wrong encoding

2009-07-22 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc amaur...@gmail.com:


--
keywords: +needs review

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



[issue6542] test_os TestInvalidFD.test_closerange causes test_pipes hang in certain circumstances on linux

2009-07-22 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Applied in r74171 to py3k and r74172 to 3.1.

It occurs to me that I should backport this to trunk, so I'm leaving the
issue open until I do that.

--
resolution:  - fixed
stage: patch review - committed/rejected
versions: +Python 2.6, Python 2.7

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



[issue5210] zlib does not indicate end of compressed stream properly

2009-07-22 Thread Travis H.

Travis H. travis+w-python@subspacefield.org added the comment:

What kind of tests did you have in mind?

Unit tests in python, or something else?

--
nosy: +solinym

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




[issue3754] minimal cross-compilation support for configure

2009-07-22 Thread Roumen Petrov

Changes by Roumen Petrov bugtr...@roumenpetrov.info:


Removed file: http://bugs.python.org/file12677/python-trunk.patch-CROSS-20090110

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



[issue3754] minimal cross-compilation support for configure

2009-07-22 Thread Roumen Petrov

Changes by Roumen Petrov bugtr...@roumenpetrov.info:


Removed file: http://bugs.python.org/file14277/python-trunk-20090612-CROSS.patch

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



[issue3754] minimal cross-compilation support for configure

2009-07-22 Thread Roumen Petrov

Changes by Roumen Petrov bugtr...@roumenpetrov.info:


--
components: +Build
type:  - feature request

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



[issue3871] cross and native build of python for mingw32 with distutils

2009-07-22 Thread Roumen Petrov

Changes by Roumen Petrov bugtr...@roumenpetrov.info:


Added file: http://bugs.python.org/file14540/python-trunk-20090722-MINGW.patch

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



[issue3871] cross and native build of python for mingw32 with distutils

2009-07-22 Thread Roumen Petrov

Changes by Roumen Petrov bugtr...@roumenpetrov.info:


Removed file: http://bugs.python.org/file13089/python-trunk-20090214-MINGW.patch

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



[issue3871] cross and native build of python for mingw32 with distutils

2009-07-22 Thread Roumen Petrov

Changes by Roumen Petrov bugtr...@roumenpetrov.info:


Removed file: http://bugs.python.org/file13694/python-trunk-20090416-MINGW.patch

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



[issue3871] cross and native build of python for mingw32 with distutils

2009-07-22 Thread Roumen Petrov

Changes by Roumen Petrov bugtr...@roumenpetrov.info:


Removed file: http://bugs.python.org/file14279/python-trunk-20090612-MINGW.patch

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



[issue3871] cross and native build of python for mingw32 with distutils

2009-07-22 Thread Roumen Petrov

Roumen Petrov bugtr...@roumenpetrov.info added the comment:

The last patch is updated to support build with GNU C Compiler v 4.4.0
for windows.

--

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



[issue5210] zlib does not indicate end of compressed stream properly

2009-07-22 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

Yes, I think that the right place where to add the tests is
Lib/test/test_zlib.py

--

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



[issue6547] shutil.copytree fails on dangling symlinks

2009-07-22 Thread Timothee Besset

New submission from Timothee Besset tt...@idsoftware.com:

shutil.copytree fails if there is a dangling symlink and symlink is set
to False (which is the default). It will raise an exception when trying
to get to the content of the symlink.

Tested on Debian Etch amd64, python 2.5.2

  File /usr/lib/python2.5/shutil.py, line 138, in copytree
raise Error, errors
shutil.Error: [('/opt/daemons/gameslave/.#fabfile.py',
'/tmp/tmphxInsp/gameslave/.#fabfile.py', [Errno 2] No such file or
directory: '/opt/daemons/gameslave/.#fabfile.py')]

$ ls -1l /opt/daemons/gameslave/.#fabfile.py
lrwxrwxrwx 1 timo quakelive 20 Jul 22 14:32
/opt/daemons/gameslave/.#fabfile.py - t...@localhost.12341

(the link is created by emacs - means file being edited I'm guessing)

--
components: Library (Lib)
messages: 90821
nosy: TTimo
severity: normal
status: open
title: shutil.copytree fails on dangling symlinks
type: behavior
versions: Python 2.5

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



[issue6423] The cgi docs should advertize using in instead of has_key

2009-07-22 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

Fixed in r74179 (trunk) and r74180 (py3k).
Thanks!

--
keywords:  -needs review
resolution: accepted - fixed
stage: patch review - committed/rejected
status: open - closed

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



[issue6541] SpooledTemporaryFile Cleanups

2009-07-22 Thread Leon Matthews

Changes by Leon Matthews l...@lost.co.nz:


--
title: SpooledTemporaryFile operates differently to TemporaryFile - 
SpooledTemporaryFile Cleanups

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



[issue6541] SpooledTemporaryFile cleanups

2009-07-22 Thread Leon Matthews

Changes by Leon Matthews l...@lost.co.nz:


--
title: SpooledTemporaryFile Cleanups - SpooledTemporaryFile cleanups

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



[issue6525] Problem with string.lowercase in Windows XP

2009-07-22 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

I did some test as well and here is what I got:
Python2.4 WinXP:
 import locale
 import string
 locale.setlocale(locale.LC_ALL, '')
'Italian_Italy.1252'
 string.lowercase
'abcdefghijklmnopqrstuvwxyz\x83\x9a\x9c\x9e\xaa\xb5\xba\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff'
 print string.lowercase
abcdefghijklmnopqrstuvwxyzâܣ׬Á║▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷°¨·¹³²■ 
 import unicodedata
 set(map(unicodedata.category, string.lowercase.decode('windows-1252')))
set(['Ll'])

Python2.6 WinXP:
 import locale
 import string
 locale.setlocale(locale.LC_ALL, '')
'Italian_Italy.1252'
 string.lowercase
'abcdefghijklmnopqrstuvwxyz\x83\x9a\x9c\x9e\xaa\xb5\xba\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff'
 print string.lowercase
abcdefghijklmnopqrstuvwxyzƒsozªµºßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ
 import unicodedata
 set(map(unicodedata.category, string.lowercase.decode('windows-1252')))
set(['Ll'])

As you can see both the strings are equivalent and all the chars
correctly belong to the Ll (letter, lowercase) Unicode category. For
some reason they look different only when they are printed.

If these chars are not added to string.lowercase on Linux when you
change the locale, then it's a bug.
Can you reproduce it with recent versions of Python?

--

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



[issue6548] cmath documentation misleading: suggests existence of real() and imag() functions

2009-07-22 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +ezio.melotti

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



[issue6029] FAIL: test_longdouble (ctypes.test.test_callbacks.Callbacks) [SPARC/64-bit]

2009-07-22 Thread Peter Bray

Peter Bray pdb...@yahoo.com.au added the comment:

Sorry for the internet lifetime I've been away.

I have tested the patch provided against the released 3.1 distribution
and all tests pass without coredumping or failing on Solaris 10 Update 6
with gcc 4.1.2. The 3.1 distribution with the patch was built and tested
on both 32-bit and 64-bit SPARC and X86.

The patch was rejected by GNU patch, but applying by hand (copy/paste)
worked fine against 3.1.

Like the patch's author I can't say if this right approach to take, that
is for others to say but it does not break any of my builds.

Regards,
Peter

And sorry for the delay.

--

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