[issue9815] test_tarfile sometimes ends with error "Cannot remoe dir"

2010-09-10 Thread Hirokazu Yamamoto

New submission from Hirokazu Yamamoto :

I noticed regrtest claimed it cannot delete folder after test_tarfile
ran. It was like this.

Traceback (most recent call last):
  File "e:\python-dev\py3k\lib\runpy.py", line 160, in _run_module_as_main
"__main__", fname, loader, pkg_name)
  File "e:\python-dev\py3k\lib\runpy.py", line 73, in _run_code
exec(code, run_globals)
  File "e:\python-dev\py3k\lib\test\test_tarfile.py", line 1566, in 
test_main()
  File "e:\python-dev\py3k\lib\test\test_tarfile.py", line 1563, in test_main
shutil.rmtree(TEMPDIR)
  File "e:\python-dev\py3k\lib\shutil.py", line 283, in rmtree
onerror(os.remove, fullname, sys.exc_info())
  File "e:\python-dev\py3k\lib\shutil.py", line 281, in rmtree
os.remove(fullname)
WindowsError: [Error 32] プロセスはファイルにアクセスできません。別のプロセスが
使用中です。: 'E:\\python~1\\py3...@test_5276_tmp\\tmp.tar'

# It says "Process cannot access the file. Another process is using it."

I tried to reproduce this by running test_tarfile alone, but failed.
But I succeeded to do it with following command.
  py3k -m test.regrtest test_capi test_tarfile

(Probably there is timing problem like GC... The reason why I think
so is below)

I think _Stream object left opened after exception occured in (even
after returned from function Tarfile#open) because it lives in stack
frame. Because t._extfileobj is True by default, TarFile object won't close it 
explicitly.

--
components: Extension Modules
files: py3k_fix_tarfile.patch
keywords: patch
messages: 115984
nosy: ocean-city
priority: normal
severity: normal
status: open
title: test_tarfile sometimes ends with error "Cannot remoe dir"
versions: Python 3.1, Python 3.2
Added file: http://bugs.python.org/file18815/py3k_fix_tarfile.patch

___
Python tracker 

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



[issue9815] test_tarfile sometimes ends with error "Cannot remoe dir"

2010-09-10 Thread Hirokazu Yamamoto

Changes by Hirokazu Yamamoto :


--
stage:  -> commit review

___
Python tracker 

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



[issue9816] random.jumpahead and PRNG sequence independence

2010-09-10 Thread Joseph Schaeffer

New submission from Joseph Schaeffer :

Reading the Python 2.6 docs, it appeared that using random.jumpahead would 
allow the initialization of several generators with the same seed but having 
much different internal states. While the resulting PRNG appear to have 
different internal states, the produced random numbers [via .random()] are 
exactly the same after a small initial segment.

Attached is some example code which shows the first point at which they all 
agree - in my testing (Mac OS X, Python versions 2.5, 2.6, 2.7) the generated 
numbers all agreed on the 12th number generated. For smaller differences in 
jumpahead it was noticeable a lot earlier - n=1,2 differ only in the first 
sample from each.

The internal state of the PRNGs is indeed different even after the successive 
sampling, so it may be that this is intended - however if so the docs may cause 
confusion: my particular case was where I need random numbers for a stochastic 
markov process and in addition needed many such generators [one for each 
trajectory] and was hoping to use random.jumpahead to have indepedent PRNG's 
without having to generate [and prove] my own independent set of seeds. Thus 
having a long sequence of non-independent random numbers near the initial start 
condition causes random.jumpahead to be unusable for my situation.

It appears that Python 3.1 removed random.jumpahead - if so, it may be useful 
to note in the 2.6 docs why this was / the issues with random.jumpahead: 
reading how it changed after 2.3 made it sound like it was exactly what I 
wanted. 

Possible cause: I suspect the issue may be related to how a Mersenne Twister 
algorithm can take a while to recover from poor seeding (excessive 0's), but do 
not know enough to explore that idea.

--
components: Library (Lib)
files: random_test.py
messages: 115985
nosy: Joseph.Schaeffer
priority: normal
severity: normal
status: open
title: random.jumpahead and PRNG sequence independence
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7
Added file: http://bugs.python.org/file18816/random_test.py

___
Python tracker 

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



[issue9808] Implement os.getlogin on Windows

2010-09-10 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue9816] random.jumpahead and PRNG sequence independence

2010-09-10 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +rhettinger
versions:  -Python 2.5, Python 2.6

___
Python tracker 

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



[issue9816] random.jumpahead and PRNG sequence independence

2010-09-10 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger
priority: normal -> low

___
Python tracker 

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



[issue9817] expat copyright/license file is missing

2010-09-10 Thread Matthias Klose

New submission from Matthias Klose :

files in Modules/expat reference a file COPYING for the copyright/license, but 
this is file is not included in the Python sources.

Proposing to add the attached file, taken from the expat sources.

--
assignee: doko
components: None
files: COPYING
messages: 115986
nosy: doko
priority: normal
severity: normal
status: open
title: expat copyright/license file is missing
versions: Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file18817/COPYING

___
Python tracker 

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



[issue941346] AIX shared library fix

2010-09-10 Thread Sébastien Sablé

Sébastien Sablé  added the comment:

Antoine, I tested this patch on py3k with both gcc and xlc in static and shared 
mode and I did not notice any issue.

I attach the build and test logs.

I think you can safely commit it.

--
Added file: 
http://bugs.python.org/file18818/py3k_aix61_static_xlc_nopatch.txt.gz

___
Python tracker 

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



[issue941346] AIX shared library fix

2010-09-10 Thread Sébastien Sablé

Changes by Sébastien Sablé :


Added file: 
http://bugs.python.org/file18819/py3k_aix61_static_xlc_patchshared.txt.gz

___
Python tracker 

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



[issue941346] AIX shared library fix

2010-09-10 Thread Sébastien Sablé

Changes by Sébastien Sablé :


Added file: 
http://bugs.python.org/file18820/py3k_aix61_shared_xlc_pathshared.txt.gz

___
Python tracker 

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



[issue941346] AIX shared library fix

2010-09-10 Thread Sébastien Sablé

Changes by Sébastien Sablé :


Added file: 
http://bugs.python.org/file18821/py3k_aix61_static_gcc_patchshared.txt.gz

___
Python tracker 

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



[issue941346] AIX shared library fix

2010-09-10 Thread Sébastien Sablé

Changes by Sébastien Sablé :


Added file: 
http://bugs.python.org/file18822/py3k_aix61_shared_gcc_patchshared.txt.gz

___
Python tracker 

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



[issue9818] build files to build Lib/distutils/command/wininst-9.0* are missing

2010-09-10 Thread Matthias Klose

New submission from Matthias Klose :

PC/V[CS]* contain the information to build the wininst-[678]* files, but I 
don't see any information how to build wininst-9.0*.

--
components: Build
messages: 115988
nosy: doko
priority: normal
severity: normal
status: open
title: build files to build Lib/distutils/command/wininst-9.0* are missing
versions: Python 3.2

___
Python tracker 

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



[issue9706] ssl errors checking

2010-09-10 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
status: open -> closed

___
Python tracker 

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



[issue9819] TESTFN_UNICODE and TESTFN_UNDECODABLE

2010-09-10 Thread Hirokazu Yamamoto

New submission from Hirokazu Yamamoto :

Hello. I noticed test suite reports WARNING every time.

///

E:\python-dev>py3k -m test.regrtest test_os
WARNING: The filename '@test_464_tmp-共有される' CAN be encoded by the filesyste
m encoding (mbcs). Unicode filename tests may not be effective
(snip)

///

This happens because TESTFN_UNICODE_UNDECODABLE in Lib/test/support.py
*is* decodable on Japanese environment (cp932).

It is easy to make this really undecodable in Japanese.
Using the characters like "\u2661" or "\u2668" (Former is heart mark,
latter is "Onsen" - Hot spring mark) I could remove the warning by this.
TESTFN_UNENCODABLE = TESTFN + "-\u5171\u6709\u3055\u308c\u308b\u2661\u2668"

///

And another issue. This happens only on test_unicode_file,

///

E:\python-dev>py3k -m test.test_unicode_file
Traceback (most recent call last):
  File "e:\python-dev\py3k\lib\test\test_unicode_file.py", line 12, in 
TESTFN_UNICODE.encode(TESTFN_ENCODING)
UnicodeEncodeError: 'mbcs' codec can't encode characters in position 0--1: inval
id character

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "e:\python-dev\py3k\lib\runpy.py", line 160, in _run_module_as_main
"__main__", fname, loader, pkg_name)
  File "e:\python-dev\py3k\lib\runpy.py", line 73, in _run_code
exec(code, run_globals)
  File "e:\python-dev\py3k\lib\test\test_unicode_file.py", line 16, in 
raise unittest.SkipTest("No Unicode filesystem semantics on this platform.")

unittest.case.SkipTest: No Unicode filesystem semantics on this platform.

///

This happens because TESTFN_UNICODE cannot be encoded in Japanese.

E:\python-dev>py3k
Python 3.2a2+ (py3k:84663M, Sep 10 2010, 13:24:41) [MSC v.1400 32 bit (Intel)] o
n win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print("-\xe0\xf2")
Traceback (most recent call last):
  File "", line 1, in 
UnicodeEncodeError: 'cp932' codec can't encode character '\xe0' in position 1: i
llegal multibyte sequence

But interesting, this bytes sequence "\xe0\xf2" can be read as
cp932 multibyte characters.

E:\python-dev>python
Python 2.6.6 (r266:84297, Aug 24 2010, 18:46:32) [MSC v.1500 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print "\xe0\xf2"
瑣
>>> "\xe0\xf2".decode("cp932")
u'\u7463'

E:\python-dev>py3k
Python 3.2a2+ (py3k:84663M, Sep 10 2010, 13:24:41) [MSC v.1400 32 bit (Intel)] o
n win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print('\u7463')
瑣

I believe this value "\xe0\xf2" came from python2.x, maybe "\u7463"
should be used here? I'm not sure it can be decoded everywhere using
other encodings, though.

--
components: Tests, Unicode
messages: 115989
nosy: ocean-city
priority: normal
severity: normal
status: open
title: TESTFN_UNICODE and TESTFN_UNDECODABLE
versions: Python 3.1, Python 3.2

___
Python tracker 

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



[issue9816] random.jumpahead and PRNG sequence independence

2010-09-10 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Thanks for the report.  Something does appear to be broken.  When the states 
are different, the random numbers should be different.  Am looking in to it.

In the mean time, I recommend against using jumpahead() with MT.  It is better 
to separately seed three different generators and rely on the huge period of MT 
to keep the sequences from overlapping.

If you do use jumpahead(), it is intended to be supplied with large values of n 
(not 1, 11, or 21).

The function/method was removed in 3.x because it was an API defect.  The 
jumpahead concept as originally intended (move ahead n-steps) was something 
that could really only work with a generator like Wichmann-Hill.  Newer and 
more advanced generators aren't usually amenable to direct computation of a 
state that is n-steps forward.

--
priority: low -> high

___
Python tracker 

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



[issue9819] TESTFN_UNICODE and TESTFN_UNDECODABLE

2010-09-10 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

And one little thing. I noticed variable name varies in
python2.x and python3.x.
TESTFN_UNICODE_UNDECODEABLE (2.x)
TESTFN_UNICODE_UNDECODABLE  (3.x)

I think 2.x should be unified into 3.x name. Thanks.

--

___
Python tracker 

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



[issue9819] TESTFN_UNICODE and TESTFN_UNDECODABLE

2010-09-10 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc :


--
assignee:  -> haypo
nosy: +haypo

___
Python tracker 

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



[issue9806] no need to try loading posix extensions without SOABI

2010-09-10 Thread Georg Brandl

Georg Brandl  added the comment:

I'm not in favor of this change.  PEP 3179 was accepted because it presented an 
optional additional feature that doesn't break compatibility.

For example, build tools of third-party external modules that do not use 
distutils would break.

--
nosy: +benjamin.peterson, georg.brandl, loewis

___
Python tracker 

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



[issue9806] no need to try loading posix extensions without SOABI

2010-09-10 Thread Georg Brandl

Georg Brandl  added the comment:

Martin might be able to provide some insight from when (IIRC) Windows dynamic 
DLLs were restricted to .pyd extension only.

--

___
Python tracker 

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



[issue9819] TESTFN_UNICODE and TESTFN_UNDECODABLE

2010-09-10 Thread STINNER Victor

STINNER Victor  added the comment:

> WARNING: The filename '@test_464_tmp-共有される' CAN be encoded 
> by (...) cp932

We should find character not encodable in any Windows code page, but accepted 
as filenames.

> characters like "\u2661" or "\u2668" (...)

mbcs uses "ANSI" code pages: cp1250..cp1258 and cp874 (and maybe others because 
you wrote that your setup uses cp932):
http://en.wikipedia.org/wiki/Code_page#Windows_.28ANSI.29_code_pages

I wrote a short script to find a unencodable filename (attached to this issue). 
Output:

u'\u0301' is encodable to cp1258
u'\u0363' is not encodable to any code page
u'\u2661' is encodable to cp949
u'\u5171' is encodable to cp932, cp936, cp949, cp950

(CODE_PAGES constant of the script might be incomplete)

u'\u2661' is not a good candidate. u'\u0363' looks better. Be we can mix 
different characters to limit the probability that the whole string is 
encodable. Example:

u'\u2661\u5171' is encodable to cp949
u'\u0301\u0363\u2661\u5171' is not encodable to any code page

> TESTFN_UNICODE_UNDECODEABLE (2.x)

This is a typo fixed by r83987 in py3k.

--
Added file: http://bugs.python.org/file18823/find_unencode_filename.py

___
Python tracker 

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



[issue9820] Windows : os.listdir(b'.') doesn't raise an error for unencodable filenames

2010-09-10 Thread STINNER Victor

New submission from STINNER Victor :

In Python 3.2, mbcs encoding (default filesystem encoding on Windows) is now 
strict: raise an error on unencodable/undecodable characters/bytes. But 
os.listdir(b'.') encodes unencodable bytes as b'?'.

Example:

>>> os.mkdir('listdir')
>>> open('listdir\\xxx-\u0363', 'w').close()
>>> filename = os.listdir(b'listdir')[0]
>>> filename
b'xxx-?'
>>> open(filename, 'r').close()
IOError: [Errno 22] Invalid argument: 'xxx-?'

os.listdir(b'listdir') should raise an error (and not ignore the filename or 
replaces unencodable characters by b'?').

I think that we should list the directory using the wide character API 
(FindFirstFileW) but encode the filename using PyUnicode_EncodeFSDefault() if 
the directory name type is bytes, instead of using the ANSI API 
(FindFirstFileA).

--
components: Library (Lib), Unicode, Windows
messages: 115995
nosy: haypo, loewis
priority: normal
severity: normal
status: open
title: Windows : os.listdir(b'.') doesn't raise an error for unencodable 
filenames
versions: Python 3.2

___
Python tracker 

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



[issue9820] Windows : os.listdir(b'.') doesn't raise an error for unencodable filenames

2010-09-10 Thread STINNER Victor

STINNER Victor  added the comment:

I found this bug while trying to find an unencodable filename for #9819 
(TESTFN_UNDECODABLE).

Anyway, the bytes API should be avoided on Windows since Windows native 
filename type is unicode.

--

___
Python tracker 

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



[issue9819] TESTFN_UNICODE and TESTFN_UNDECODABLE

2010-09-10 Thread STINNER Victor

STINNER Victor  added the comment:

See also #9820.

--

___
Python tracker 

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



[issue9816] random.jumpahead and PRNG sequence independence

2010-09-10 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I see the problem now.  Random.jumpahead(n) does a very poor job of shuffling 
MT's state when n is small.  The first few numbers of the state are different 
but some of the later ones are not.  When random() crawls across parts of the 
state that are identical, it produces identical output.  Later when has wrapped 
around, the random() calls diverge again.

Fixed by salting the jumpahead value.  See r84665.

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

___
Python tracker 

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



[issue9819] TESTFN_UNICODE and TESTFN_UNDECODABLE

2010-09-10 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

Thank you for a reply.

> u'\u2661' is encodable to cp949
Doh!

I can imagine it's difficult to find out such character. ;-)

--

___
Python tracker 

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



[issue9819] TESTFN_UNICODE and TESTFN_UNDECODABLE

2010-09-10 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

I also confirmed '\u0363' can be used as filename.
"dir" command cannot print filename correctly, though.

 E:\python-dev\foo のディレクトリ

2010/09/10  19:44 .
2010/09/10  19:44 ..
2010/09/10  19:443 ͣ
   1 個のファイル   3 バイト
   2 個のディレクトリ   2,788,741,120 バイトの空き領域

--

___
Python tracker 

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



[issue9821] Support PEP 383 on Windows: mbcs support of surrogateescape error handler

2010-09-10 Thread STINNER Victor

New submission from STINNER Victor :

It would be nice to support PEP 383 (surrogateescape) on Windows, but the mbcs 
codec doesn't support it for performance reason. The Windows functions to 
encode/decode MBCS don't give the index of the unencodable/undecodable 
character/byte. For encoding, we can try to encode character by character (but 
be careful of surrogate pairs) and check that the character is a Python lone 
surrogate character or not (character in range U+DC80..U+DCFF). For decoding, 
it is more complex because MBCS can be a multibyte encoding, eg. cp65001 
(Microsoft variant of utf-8, see #6058). So it's not possible to encode byte 
per byte and we should write an heuristic to guess the right number of bytes 
for each call to the decode function.

--

A completly different solution is to get the MBCS code page and use the Python 
code page codec (eg. "cp1252") instead of "mbcs" encoding, because Python 
cp codecs support all Python error handlers. Example (with Python 2.6):

>>> print(u"abcŁdef".encode("cp1252", "replace"))
abc?def
>>> print(u"abcŁdef".encode("cp1252", "ignore"))
abcdef
>>> print(u"abcŁdef".encode("cp1252", "backslashreplace"))
abc\u0141def

See also #8611 for the problem if the Python path cannot be encoded to mbcs 
(work in progress, see #9425).

--
components: Interpreter Core, Library (Lib), Unicode, Windows
messages: 116001
nosy: haypo, loewis
priority: normal
severity: normal
status: open
title: Support PEP 383 on Windows: mbcs support of surrogateescape error handler
versions: Python 3.2

___
Python tracker 

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



[issue9820] Windows : os.listdir(b'.') doesn't raise an error for unencodable filenames

2010-09-10 Thread STINNER Victor

STINNER Victor  added the comment:

> os.listdir(b'listdir') should raise an error (and not ignore 
> the filename or replaces unencodable characters by b'?').

To avoid the error, a solution is to support the PEP 383 on Windows (for the 
mbcs encoding). I opened a separated issue for that: #9821.

But support PEP 383 will not fix this issue because the current implementation 
of listdir(b'.') doesn't use the Python codec, but use raw bytes filenames (use 
the ANSI API).

--

___
Python tracker 

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



[issue8533] regrtest: use backslashreplace error handler for stdout

2010-09-10 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

Hello. How about this patch? I just mimicked create_stdio() in
Python/pythonrun.c. (Mostly) Newlines looks correct as well as
python2.x. I tested this on windows.

--
nosy: +ocean-city
Added file: http://bugs.python.org/file18824/py3k_regrtest_newline.patch

___
Python tracker 

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



[issue8533] regrtest: use backslashreplace error handler for stdout

2010-09-10 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

And here is more advanced (?) patch. More closer to Python/pythonrun.c
's implementaion.

I tried regrtest_stdout_newline.patch, but it doesn't work.
# AttributeError: '_io.TextIOWrapper' object has no attribute '_writenl'

--
Added file: http://bugs.python.org/file18825/py3k_regrtest_newline_more.patch

___
Python tracker 

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



[issue9295] test_close_open_print_buffered(test_file) sometimes crashes

2010-09-10 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

I believe attached patch will fix this issue. Please forget
previous patch.

--
Added file: http://bugs.python.org/file18826/py27_fix_threaded_file_close.patch

___
Python tracker 

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



[issue9821] Support PEP 383 on Windows: mbcs support of surrogateescape error handler

2010-09-10 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

STINNER Victor wrote:
> 
> New submission from STINNER Victor :
> 
> It would be nice to support PEP 383 (surrogateescape) on Windows, but the 
> mbcs codec doesn't support it for performance reason. The Windows functions 
> to encode/decode MBCS don't give the index of the unencodable/undecodable 
> character/byte. For encoding, we can try to encode character by character 
> (but be careful of surrogate pairs) and check that the character is a Python 
> lone surrogate character or not (character in range U+DC80..U+DCFF). For 
> decoding, it is more complex because MBCS can be a multibyte encoding, eg. 
> cp65001 (Microsoft variant of utf-8, see #6058). So it's not possible to 
> encode byte per byte and we should write an heuristic to guess the right 
> number of bytes for each call to the decode function.
> 
> --
> 
> A completly different solution is to get the MBCS code page and use the 
> Python code page codec (eg. "cp1252") instead of "mbcs" encoding, because 
> Python cp codecs support all Python error handlers. Example (with Python 
> 2.6):
> 
 print(u"abcŁdef".encode("cp1252", "replace"))
> abc?def
 print(u"abcŁdef".encode("cp1252", "ignore"))
> abcdef
 print(u"abcŁdef".encode("cp1252", "backslashreplace"))
> abc\u0141def

That would certainly be a better approach, provided that our
cp-encodings are indeed compatible with the Windows variants
(which unfortunately tend to often use slightly different
mappings).

We could then also alias 'mbcs' to the cp-encoding (sort of
like the reverse of what we do in site.py:aliasmbcs().

--
nosy: +lemburg
title: Support PEP 383 on Windows: mbcs support of surrogateescape error 
handler -> Support PEP 383 on Windows: mbcs support of surrogateescape error 
handler

___
Python tracker 

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



[issue9819] TESTFN_UNICODE and TESTFN_UNDECODABLE

2010-09-10 Thread STINNER Victor

STINNER Victor  added the comment:

> "dir" command cannot print filename correctly, though.

Who cares? We just have to be able to create a file with a name containing non 
encodable characters, list the directory, and then remove this evil file.

--

With r84666, Python uses "-\u5171\u6709\u3055\u308c\u308b" suffix for 
TESTFN_UNENCODABLE. Does it fix the issue on your host?

I attached an improved version of find_unencode_filename.py (with more code 
pages).

--

> > TESTFN_UNICODE_UNDECODEABLE (2.x)
> This is a typo fixed by r83987 in py3k.

I backported the fix to 2.7 (r84667).

--
Added file: http://bugs.python.org/file18827/find_unencode_filename-2.py

___
Python tracker 

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



[issue9819] TESTFN_UNICODE and TESTFN_UNDECODABLE

2010-09-10 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file18823/find_unencode_filename.py

___
Python tracker 

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



[issue9116] test_capi.test_no_FatalError_infinite_loop crash on Windows

2010-09-10 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

Maybe is #5619 related?

--
dependencies: +Pass MS CRT debug flags into subprocesses

___
Python tracker 

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



[issue9822] windows batch files are dependent on cmd current directory

2010-09-10 Thread sorin

New submission from sorin :

Currently most batch files from Tools\buildbot do fail to run if you do not 
call them from the python source root directory.


I already have patched files, but the question is against which branch should I 
make them, considering that this bug is valid for all versions?

Do you prefer patch or just the entire files?

--
components: Build
messages: 116009
nosy: sorin
priority: normal
severity: normal
status: open
title: windows batch files are dependent on cmd current directory
type: compile error
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

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



[issue9822] windows batch files are dependent on cmd current directory

2010-09-10 Thread sorin

Changes by sorin :


--
keywords: +patch
Added file: http://bugs.python.org/file18828/buildbot_curdir.patch

___
Python tracker 

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



[issue9819] TESTFN_UNICODE and TESTFN_UNDECODABLE

2010-09-10 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

Thank you for the fix.

> Who cares? We just have to be able to create a file with a name
> containing non encodable characters, list the directory, and then
> remove this evil file.

I won't. ;-)
Sorry, that was not compliant. I just thought it's
interesting to see such a white box in console, and see it can be
opened and deleted correctly.

--

___
Python tracker 

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



[issue9821] Support PEP 383 on Windows: mbcs support of surrogateescape error handler

2010-09-10 Thread STINNER Victor

STINNER Victor  added the comment:

Oh wait. PEP 383 is a solution to store undecodable bytes in an unicode string, 
but for mbcs I'm trying to get the opposite: store unicode in bytes and this is 
not possible (at least with PEP 383).

Example with Python 3.1:

>>> print("abcŁdef".encode("cp1252", "surrogateescape"))
...
UnicodeEncodeError: 'charmap' codec can't encode character '\u0141' in position 
3: character maps to 

--

___
Python tracker 

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



[issue9819] TESTFN_UNICODE and TESTFN_UNDECODABLE

2010-09-10 Thread STINNER Victor

STINNER Victor  added the comment:

> With r84666, Python uses "-\u5171\u6709\u3055\u308c\u308b" 
> suffix for TESTFN_UNENCODABLE.

Backported to 3.1 as r84668. I don't want to patch Python 2.x (its unicode 
support is lower and the code is too different than Python3) and so I close the 
issue.

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

___
Python tracker 

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



[issue9822] windows batch files are dependent on cmd current directory

2010-09-10 Thread R. David Murray

R. David Murray  added the comment:

The general rule for submitting patches is to make them against development 
trunk (which is currently the py3k branch).  Unified diffs from the top level 
of the checkout are preferred; whole files are not useful.

However, it is not clear what bug you are trying to fix here.  Why would the 
buildbot scripts ever get executed from anywhere except the checkout directory? 
 They are obviously working just fine as they are, since the buildbots are 
using them successfully.

--
nosy: +r.david.murray
versions:  -Python 2.6, Python 3.3

___
Python tracker 

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



[issue9806] no need to try loading posix extensions without SOABI

2010-09-10 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Indeed, PEP 3179 is only supposed to add support for people who wish to version 
their modules.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue9822] windows batch files are dependent on cmd current directory

2010-09-10 Thread sorin

sorin  added the comment:

In this case I made the patch on the right branch (py3k).

These scripts could be called manually and it doesn't make any sense not to 
make them work in all cases.

Not every Windows developer is using Visual Studio to build things, 'some' of 
them are using the command line, and in this case it does make a sense to be 
able to call this scripts without these 'strange' limitations.

Implementing this would simplify dev setup/usage on Windows. Also I updated the 
PCbuild/readme.txt file.

--
Added file: http://bugs.python.org/file18829/readme.txt.patch

___
Python tracker 

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



[issue4026] fcntl extension fails to build on AIX 6.1

2010-09-10 Thread Sébastien Sablé

Sébastien Sablé  added the comment:

I tested Michael test in msg115868 on my AIX system (AIX 6.1 with flock 
correctly present in libbsd) with py3k and it works fine:

checking for flock declaration... yes
checking for flock... no
checking for flock in -lbsd... yes

[103/344] test_fcntl
= OK

I attach it as a patch against py3k.

--
Added file: 
http://bugs.python.org/file18830/patch_Michael_Haubenwallner_flock_msg115868.diff

___
Python tracker 

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



[issue9806] no need to try loading posix extensions without SOABI

2010-09-10 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

s/3179/3149/ 

:)

The point about building w/o distutils is a good one and touches on my concerns 
in my comment above.  It would be nice to know whether there's any measurable 
practical benefit to the change, i.e. measure startup time for an application 
that loads lots of modules.

--

___
Python tracker 

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



[issue9213] range purports to implement the Sequence ABC, but is missing index and count methods

2010-09-10 Thread Daniel Urban

Daniel Urban  added the comment:

> Attached is a greatly revised patch, with two significant changes:
> - Adds support for !PyLong_CheckExact (using _PySequence_IterSearch)

Thanks, indeed, we should support that.

> Any strong feelings on whether range.index should support the start and
> stop arguments provided by list.index, tuple.index, and str.index, but
> not by collections.Sequence.index?

I don't think that this is very important.

--

___
Python tracker 

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



[issue8699] Equality and hashing for functools.partial

2010-09-10 Thread Daniel Urban

Daniel Urban  added the comment:

Is there anybody, who is interested in this?
There are some substantial problems with it (hashing a dict), so I suggest that 
this should be closed, unless somebody is interested.

--
status: open -> pending

___
Python tracker 

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



[issue9822] windows batch files are dependent on cmd current directory

2010-09-10 Thread R. David Murray

R. David Murray  added the comment:

I did not realize the build instructions recommended using the buildbot tool.  
It is clearly past time I got around to doing windows build myself.  

Please regenerate the diffs from the top level of the checkout, and we'll see 
if one of the windows devs feels like checking it in.

--
nosy: +brian.curtin, loewis, tim.golden
type: compile error -> feature request
versions:  -Python 2.7, Python 3.1

___
Python tracker 

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



[issue9822] windows batch files are dependent on cmd current directory

2010-09-10 Thread Brian Curtin

Brian Curtin  added the comment:

This is just a guess, but it might have to do with how buildbot works, so I'd 
be careful of changing this. A lot of things (everything?) in that 
Tools\buildbot folder depend on being run from the top-level directory in order 
to work correctly.

Another example: If you run Tools\buildbot\external.bat from a directory other 
than the top-level, the checkouts will end up in a place that pcbuild.sln 
doesn't know about, thus various subprojects will not build because they can't 
find the source.

--

___
Python tracker 

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



[issue9813] Module Name Changed

2010-09-10 Thread Charles M Norton

Charles M Norton  added the comment:

Solved. I needed to download a separate packed. Thanks.

--

___
Python tracker 

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



[issue9822] windows batch files are dependent on cmd current directory

2010-09-10 Thread sorin

sorin  added the comment:

This is true, that this can impact the build process but the changes are 
assuring that it will always chdir to the right directory.

BTW, %~dp0 is the directory when the batch file is located.

--
Added file: http://bugs.python.org/file18831/path_for_bug_9822_v1.patch

___
Python tracker 

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



[issue9822] windows batch files are dependent on cmd current directory

2010-09-10 Thread sorin

Changes by sorin :


Removed file: http://bugs.python.org/file18829/readme.txt.patch

___
Python tracker 

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



[issue9822] windows batch files are dependent on cmd current directory

2010-09-10 Thread sorin

Changes by sorin :


Removed file: http://bugs.python.org/file18828/buildbot_curdir.patch

___
Python tracker 

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



[issue4617] SyntaxError when free variable name is also an exception target

2010-09-10 Thread Amaury Forgeot d'Arc

Changes by Amaury Forgeot d'Arc :


--
assignee:  -> amaury.forgeotdarc
resolution:  -> accepted

___
Python tracker 

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



[issue941346] AIX shared library fix

2010-09-10 Thread Sébastien Sablé

Changes by Sébastien Sablé :


Removed file: 
http://bugs.python.org/file18820/py3k_aix61_shared_xlc_pathshared.txt.gz

___
Python tracker 

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



[issue941346] AIX shared library fix

2010-09-10 Thread Sébastien Sablé

Changes by Sébastien Sablé :


Added file: 
http://bugs.python.org/file18832/py3k_aix61_shared_xlc_pathshared.txt.gz

___
Python tracker 

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



[issue3876] multiprocessing does not compile on systems which do not define sem_timedwait

2010-09-10 Thread Sébastien Sablé

Sébastien Sablé  added the comment:

For info: I have no problem compiling _multiprocessing and passing the unittest 
test_multiprocessing with py3k rev84631 on AIX 6.1 with xlc_r compiler without 
the patch proposed here.

I don't know if this is due to some updates in Python (3.2alpha2+) or AIX (6.1).

--
nosy: +sable

___
Python tracker 

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



[issue6742] Embedding python into shared library crash on AIX

2010-09-10 Thread Sébastien Sablé

Sébastien Sablé  added the comment:

You may want to take a look at issue 941346 in order to compile libpython2.6.so 
on AIX.

I also embed python in my AIX application, and I had no problem once python was 
compiled as share thanks to the patch provided in the other issue.

--
nosy: +sable

___
Python tracker 

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



[issue3053] test_shutil fails under AIX

2010-09-10 Thread Sébastien Sablé

Sébastien Sablé  added the comment:

For info: I have no problem with test_shutil on AIX 6.1 with python 2.6.6 or 
python 3.2alpha2.
There may be no problem anymore.

--
nosy: +sable

___
Python tracker 

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



[issue9823] OrderedDict is comparable to dict

2010-09-10 Thread Ram Rachum

New submission from Ram Rachum :

OrderedDict is currently comparable to dict.

I think this is not logical, because a dict doesn't have order, and having an 
identical order is a necessary condition for a match.

I think that comparing an OrderedDict with a dict makes as much sense as 
comparing a tuple with a set, and that's currently not allowed. (Always returns 
False)

Here's a disturbing code snippet executed in Python 3.2a1:

>>> from collections import OrderedDict
>>> d1 = OrderedDict(((1, 2), (3, 4)))
>>> d2 = OrderedDict(((3, 4), (1, 2)))
>>> d1 == d2
False
>>> d1 == {1: 2, 3: 4} == d2
True

--
components: Library (Lib)
messages: 116027
nosy: cool-RR
priority: normal
severity: normal
status: open
title: OrderedDict is comparable to dict
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

___
Python tracker 

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



[issue9823] OrderedDict is comparable to dict

2010-09-10 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

This was purposeful. See PEP 372.

--
nosy: +benjamin.peterson
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue9823] OrderedDict is comparable to dict

2010-09-10 Thread Ram Rachum

Ram Rachum  added the comment:

Thanks Benjamin. Was there a discussion about this in the mailing list? If so 
can you give me a link to it?

--

___
Python tracker 

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



[issue9824] SimpleCookie should escape commas and semi-colons

2010-09-10 Thread Luke Plant

New submission from Luke Plant :

In developing Django, we found that some browsers don't treat commas and 
semi-colons in cookie values (i.e. the Set-Cookie header) the way that RFC 2109 
says they should. (Safari splits the header on a comma followed by space, 
Internet Explorer splits on semi-colons - both irrespective of any 'quoting').

The result is that if you use SimpleCookie to create Set-Cookie headers, where 
the cookie value contains a comma or semi-colon, you can get all kinds of 
breakage. 

In the end, we realised that the RFCs are kind of irrelevant, and we have to 
look at what browsers actually do.  So, it would be much more useful if 
semi-colons and commas were escaped the way that other characters are by 
SimpleCookie.

Our discussion/findings are here:
http://code.djangoproject.com/ticket/12470#comment:4
http://groups.google.com/group/django-developers/msg/2cb729938e8e67ca

The patch to Cookie.py (Python 2.X) or http/cookies.py (Python 3.X) is simple 
and follows. I'm assuming that this applies to Python 3.2 and 3.3, but I 
haven't checked.

--
components: Library (Lib)
files: simplecookie_fix.diff
keywords: patch
messages: 116030
nosy: spookylukey
priority: normal
severity: normal
status: open
title: SimpleCookie should escape commas and semi-colons
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file18833/simplecookie_fix.diff

___
Python tracker 

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



[issue9824] SimpleCookie should escape commas and semi-colons

2010-09-10 Thread Luke Plant

Luke Plant  added the comment:

I forgot to mention backwards compatibility:

In the context of Cookie being used in a web application, if developers were 
relying on literal commas and semi-colons being present in the client side 
cookie value (e.g. in javascript), the patch will introduce an incompatibility.

A quick review of cookies on my computer shows that 22 out of 3079 have commas 
in them, and none have semi-colons in them.  For those with commas, there would 
still only be a problem if they were reading them client side, or not using 
Python's Cookie library to decode the values server side.

--

___
Python tracker 

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



[issue3053] test_shutil fails under AIX

2010-09-10 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ok, closing. The original install was on a rather strange setup.

--
resolution:  -> works for me
status: open -> closed

___
Python tracker 

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



[issue8699] Equality and hashing for functools.partial

2010-09-10 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Thanks for the interesting thread.
I do agree with your suggestion to close this one though.

--
nosy: +rhettinger
resolution:  -> rejected
status: pending -> closed

___
Python tracker 

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



[issue9823] OrderedDict is comparable to dict

2010-09-10 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

That is the documented and tested behavior:  
http://docs.python.org/library/collections.html#ordereddict-objects

"""
Equality tests between OrderedDict objects are order-sensitive and are 
implemented as list(od1.items())==list(od2.items()). Equality tests between 
OrderedDict objects and other Mapping objects are order-insensitive like 
regular dictionaries. This allows OrderedDict objects to be substituted 
anywhere a regular dictionary is used.
"""

It was a basic design objective for OrderedDicts to be substitutable for 
regular dictionaries (that is why it subclasses from dict).  This lets an OD be 
used just about anywhere in Python where a regular dict is expected.

Also look at:  http://en.wikipedia.org/wiki/Liskov_substitution_principle

--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue4026] fcntl extension fails to build on AIX 6.1

2010-09-10 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ok, thank you. The improvement has been committed in all three branches (3.2, 
3.1, 2.7).

--
stage:  -> committed/rejected
status: open -> closed
versions:  -Python 2.6, Python 3.3

___
Python tracker 

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



[issue9825] OrderedDict ref cycles cause memory leak

2010-09-10 Thread jason kirtland

New submission from jason kirtland :

Circular graphs of collections.OrderedDict are uncollectable due to the 
presence of OrderedDict.__del__.

>>> from collections import OrderedDict
>>> import gc
>>> left, right = OrderedDict(), OrderedDict()
>>> left['other'] = right
>>> right['other'] = left
>>> assert not gc.garbage
>>> del left, right
>>> gc.collect()
10
>>> assert not gc.garbage
Traceback (most recent call last):
  File "", line 1, in 
AssertionError

Not an issue in 3.1.1, have not verified with 3.1.2.

--
components: Library (Lib)
files: odicttest.py
messages: 116036
nosy: jek
priority: normal
severity: normal
status: open
title: OrderedDict ref cycles cause memory leak
type: resource usage
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file18834/odicttest.py

___
Python tracker 

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



[issue9826] OrderedDict ref cycles break repr()

2010-09-10 Thread jason kirtland

New submission from jason kirtland :

repr of circular graphs of collections.OrderedDicts fails with 'RuntimeError: 
maximum recursion depth exceeded while calling a Python object'.

>>> from collections import OrderedDict
>>> left, right = OrderedDict(), OrderedDict()
>>> left['other'] = right
>>> right['other'] = left
>>> left
Traceback (most recent call last):
  File "", line 1, in 
  ...
  File "lib/python2.7/collections.py", line 137, in __repr__
return '%s(%r)' % (self.__class__.__name__, self.items())
RuntimeError: maximum recursion depth exceeded in __subclasscheck__

--
components: Library (Lib)
files: odictcyclerepr.py
messages: 116037
nosy: jek
priority: normal
severity: normal
status: open
title: OrderedDict ref cycles break repr()
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file18835/odictcyclerepr.py

___
Python tracker 

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



[issue9825] OrderedDict ref cycles cause memory leak

2010-09-10 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue9826] OrderedDict ref cycles break repr()

2010-09-10 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue9826] OrderedDict ref cycles break repr()

2010-09-10 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Patch?

--
priority: normal -> low

___
Python tracker 

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



[issue9825] OrderedDict ref cycles cause memory leak

2010-09-10 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

This is an unfortunate aspect of using __del__.
I don't see a way around it without reintroducing
weak references.

Of course, your code can also use weak ref proxies
to avoid creating uncollectible circular garbage.

--
priority: normal -> low

___
Python tracker 

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



[issue941346] AIX shared library fix

2010-09-10 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I've committed the latest patch in r84680 (3.x), r84682 (3.1) and r84683 (2.7). 
Perhaps you want to check it's ok. Thank you anyway!

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue9825] OrderedDict ref cycles cause memory leak

2010-09-10 Thread jason kirtland

jason kirtland  added the comment:

I find the behavior surprising compared to dict and other containers, where 
this is not an issue and weakrefs are not required in user code.  I would not 
be surprised, however, to have to wait for a gc.collect() to clean up my cycles 
like I do for regular objects.

For what it's worth, the pure-python alternative linked in the docs uses 
neither __del__ nor weakrefs, though it is undoubtably less efficient than this 
implementation.  And the workaround 'del OrderedDict.__del__' seems to work as 
well, if one is willing to wait for a gc collection.

--

___
Python tracker 

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



[issue941346] AIX shared library fix

2010-09-10 Thread Sébastien Sablé

Sébastien Sablé  added the comment:

Great! Thanks Antoine.

I checked quickly and there is a small correction to do on the 2.7 branch: this 
branch is different because there has been a change between python 2.x and 3.x 
in pep-3121 concerning the name of the entry function in a module 
(init to PyInit_)

So you need to change this line in Modules/ld_so_aix.in from:
  entry=PyInit_`echo $filename | sed "s/module.*//"`
to
  entry=init`echo $filename | sed "s/module.*//"`

Except for that it looks fine.

I will continue to try to make all unitary tests pass on AIX. And I would like 
to setup a buildbot that will compile and test the trunk every day and post the 
log on a public web site, in order to help keep this platform well supported.

--

___
Python tracker 

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



[issue9820] Windows : os.listdir(b'.') doesn't raise an error for unencodable filenames

2010-09-10 Thread STINNER Victor

STINNER Victor  added the comment:

Patch:
 - Remove the bytes version of listdir(): reuse the unicode version but 
converts the filename to bytes using PyUnicode_EncodeFSDefault() if the 
directory name is not unicode
 - use Py_XDECREF(d) instead of Py_DECREF(d) at the end (because d=NULL on 
error)
 - use Py_CLEAR(d) instead of "Py_DECREF(d); d=NULL;"
 - remove "char namebuf[MAX_PATH+5]" buffer (use less stack memory)

--
keywords: +patch
Added file: http://bugs.python.org/file18836/listdir_windows_bytes.patch

___
Python tracker 

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



[issue9821] Support PEP 383 on Windows: mbcs support of surrogateescape error handler

2010-09-10 Thread STINNER Victor

STINNER Victor  added the comment:

Close this issue: PEP 383 is specific to filesystem using bytes, it is useless 
on Windows (the problem on Windows is on encoding, not on decoding).

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

___
Python tracker 

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



[issue9769] PyUnicode_FromFormatV() doesn't handle non-ascii text correctly

2010-09-10 Thread STINNER Victor

STINNER Victor  added the comment:

@amaury: Do you agree to reject non-ascii bytes?

TODO: document format encoding in Doc/c-api/*.rst.

--

___
Python tracker 

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



[issue9769] PyUnicode_FromFormatV() doesn't handle non-ascii text correctly

2010-09-10 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Yes, let's be conservative and reject non-ascii bytes in the format string.

--

___
Python tracker 

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



[issue9632] Remove sys.setfilesystemencoding()

2010-09-10 Thread STINNER Victor

STINNER Victor  added the comment:

I didn't proposed to add a new parameter to Py_InitializeEx() (which means 
create a new function to not break the API), I just wrote that 
_Py_SetFileSystemEncoding() doesn't work for your use case.

> If you embed Python into another application, say as scripting
> language for that application, that other application may have
> completely different requirements for the user setup than Python
> expects, e.g. for a Windows GUI application it's not feasible to
> ask the user to change the environment variables via the registry
> in order for Python to pick up the right encoding information.

Is this usecase really realistic? Except you, nobody asked for this feature.

> The application will likely have its own way
> of configuring things like file system or I/O stream encodings.
> Think of e.g. GTK or Qt applications as example.

Qt uses the unicode API on Windows: nativeOpen() uses CreateFile() (in wide 
chararacter mode), see src/corelib/io/qfsengine_win.cpp.

Gtk+ (glib) uses also the unicode API on Windows: g_fopen() uses _wfopen(), see 
glib/gstdio.c.

Python3 doesn't support your usecase currently (it doesn't work). If you 
consider it important, please open a new issue.

--

I commited my patch to 3.2 (r84687).

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

___
Python tracker 

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



[issue4617] SyntaxError when free variable name is also an exception target

2010-09-10 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Fixed in r84685, with tests and doc updates.

--
resolution: accepted -> fixed
stage: unit test needed -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue1466065] base64 module ignores non-alphabet characters

2010-09-10 Thread Neil Tallim

Neil Tallim  added the comment:

I agree that it does look like RFC 3548 implicitly denies the use of \r and \n. 
A few *very* simple tests also makes it look like ommitting them breaks 
nothing, but we'd need to add a test that includes them before applying the 
patch.

Other than that, I agree with everything and find the email6 notes intruiging.

Would you like me to update the patch, or do you want to do it?

--

___
Python tracker 

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



[issue8835] buildbot: support.transient_internet() doesn't catch DNS socket.gaierror

2010-09-10 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
resolution:  -> out of date
status: open -> closed

___
Python tracker 

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



[issue8603] Create a bytes version of os.environ and getenvb()

2010-09-10 Thread STINNER Victor

STINNER Victor  added the comment:

> If you still consider that the change on .data as a bug, 
> I think that the fix is to remove .data (mark it as 
> protected: environ.data => environ._data).

r84690 marks os.environ.data as protected. Close this issue again.

--
status: open -> closed

___
Python tracker 

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



[issue9402] pyexpat: replace PyObject_DEL() by Py_DECREF() to fix a crash in pydebug mode

2010-09-10 Thread STINNER Victor

STINNER Victor  added the comment:

Fixed by r84692.

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

___
Python tracker 

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



[issue8197] Fatal error on thread creation in low memory condition: local storage

2010-09-10 Thread STINNER Victor

STINNER Victor  added the comment:

I don't know how to fix this issue, and I don't know if it can be fixed. As the 
issue is very unlikely, I prefer to close it.

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue8746] os.chflags() and os.lchflags() are not built when they should be be

2010-09-10 Thread Ned Deily

Ned Deily  added the comment:

Thanks Garrett for reporting the problem and thank Nick for the patches.  It 
turns out the problem is more involved though the solution is similar. I've 
spent some time figuring out what went wrong here and documenting it in this 
issue so that no one else has to.  Ugh.

The relevant checkin events:

(1) (2009-07-16) r74038 changed the autoconf tests for chflags and lchflags to 
be m4a double-quoted (from '[' to '[[') to "ensure they don't get mangled".  
The test continues to use the AC_TRY_RUN macro and is working correctly.

(2) (2009-11-02) r76050 checked in a modified version of a patch from Gentoo to 
help support cross-compiling. The original patch was against a pre-r74038 
version; it wrapped the AC_TRY_RUN macro in an AC_CACHE_CHECK and a layer of 
quotes. In updating the patch for the then-current trunk (2.7), the 
significance of the r74038 change was apparently overlooked, resulting in an 
extra and faulty level of [...] quotes which end up in the configure test C 
source.  The test now gets compile errors on all Unix-y platforms but it is 
only significant on those that do support chflags and/or lchflags, i.e. BSD 
ones and OS X.

(3) (2010-01-30) The buggy test from trunk is merged into py3k (3.2) r77862, 
3.1 r77863, and 2.6 r77864.

(4) (2010-05-08) As part of Issue8510 updates to configure.in to work with 
autoconf 2.65, r80478 for py3k (3.2) and r80969 for trunk (2.7) converted the 
AC_TRY_RUN macro calls to ones using AC_RUN_IFELSE and AC_LANG_SOURCE. An extra 
level of quoting is added to preserve the existing, albeit buggy syntax.  The 
net effect is that the configure test C code generated is the same and still 
always fails with a compile error.

While I have not tested this on any BSD-like systems other than OS X, I believe 
this means that os.chflags and/or os.lchflags have been missing-in-action from 
builds on OSes where they should be supported for the following releases (i.e 
since 2009-11-02):

2.6.5
2.6.6
2.7
3.1.2
3.2a2

A side note for OS X: Apple first introduced lchflags() support in OS X 10.5.  
Since the python.org OS X installer pythons are traditionally built to an 
10.3/10.4 ABI, none of the OS X installers for the above Python releases would 
have had os.lchflags anyway (only os.chflags), except for the new 2.7 
32-bit/64-bit installer if the 2.7 test weren't otherwise broken.

The solution is to fix the buggy configure.in macros along the lines suggested 
by Nick.  I have created and tested three new patches to do this:

issue8746-py3k.patchfor py3k (3.2a2+)
issue8746-27.patch  for release-27-maint (2.7+)
issue8746-31.patch  for release-31-maint (3.1.2+)

A variant of the 3.1 patch should apply to release-26-maint (2.6.6+) however 
2.6 is now in security-fix-only mode.

In each case, the patch only modifies configure.in.  It is necessary to run 
autoreconf after applying and before checkin.  A simple test of the fix is to 
do ./configure before and after:

$ rm -f config.log config.status
$ ./configure
$ grep "expected identifier or '(' before " config.log
conftest.c:191: error: expected identifier or '(' before '[' token
conftest.c:200: error: expected identifier or '(' before ']' token
conftest.c:191: error: expected identifier or '(' before '[' token
conftest.c:200: error: expected identifier or '(' before ']' token
$ patch  release blocker
stage: unit test needed -> patch review
title: *chflags detection broken on FreeBSD 9-CURRENT -> os.chflags() and 
os.lchflags() are not built when they should be be
Added file: http://bugs.python.org/file18837/issue8746-py3k.patch

___
Python tracker 

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



[issue8746] os.chflags() and os.lchflags() are not built when they should be be

2010-09-10 Thread Ned Deily

Changes by Ned Deily :


Added file: http://bugs.python.org/file18838/issue8746-31.patch

___
Python tracker 

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



[issue7093] xmlrpclib.ServerProxy() doesn't support unicode uri

2010-09-10 Thread STINNER Victor

STINNER Victor  added the comment:

Well, it was trivial to workaround this bug in my application (convert host to 
bytes using explicit host = str(host)). Python3 doesn't have this issue and 
Python 2.7 is released, I prefer to close this bug as wont fix.

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

___
Python tracker 

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



[issue8746] os.chflags() and os.lchflags() are not built when they should be be

2010-09-10 Thread Ned Deily

Changes by Ned Deily :


Added file: http://bugs.python.org/file18839/issue8746-27.patch

___
Python tracker 

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



[issue7093] xmlrpclib.ServerProxy() doesn't support unicode uri

2010-09-10 Thread STINNER Victor

Changes by STINNER Victor :


--
resolution: fixed -> wont fix

___
Python tracker 

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



[issue8746] os.chflags() and os.lchflags() are not built when they should be be

2010-09-10 Thread Ned Deily

Changes by Ned Deily :


Removed file: http://bugs.python.org/file18736/8746-3.1.2.patch

___
Python tracker 

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



[issue8746] os.chflags() and os.lchflags() are not built when they should be be

2010-09-10 Thread Ned Deily

Changes by Ned Deily :


Removed file: http://bugs.python.org/file18737/8746-2.7.patch

___
Python tracker 

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



[issue8746] os.chflags() and os.lchflags() are not built when they should be be

2010-09-10 Thread Ned Deily

Changes by Ned Deily :


Removed file: http://bugs.python.org/file18738/8746-2.6.6.patch

___
Python tracker 

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



[issue5934] fix gcc warnings: explicit type conversion for uid/gid in posix

2010-09-10 Thread STINNER Victor

STINNER Victor  added the comment:

Well, it's not a bug, just a gcc warning. We don't need this patch.

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue9408] curses: Link against libncursesw instead of libncurses

2010-09-10 Thread STINNER Victor

STINNER Victor  added the comment:

Does anyone agree with me?

--

___
Python tracker 

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



[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal

2010-09-10 Thread STINNER Victor

STINNER Victor  added the comment:

It should be fixed by r84694.

--
status: open -> closed

___
Python tracker 

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



  1   2   >