[issue4678] Unicode: multiple chars for high code points

2008-12-16 Thread Eric Eisner

New submission from Eric Eisner :

I discovered this when trying to splice a string containing unicode
codepoints higher than U+


all examples on 32-bit Ubuntu Linux

python 2.5.2 (for comparison):
sys.maxunicode # 1114111
len(unichr(66674)) # 1
len(u'\U00010472') # 1
len(u'𐑲')  # 2
unichr(66674)[0]   # u'\U00010472'


python 3.0: (same behavior on ubuntu's rc1 package and my build(r67781)
from svn)
sys.maxunicode# 65535
len(chr(66674))   # 2
len('\U00010472') # 2
len('𐑲')  # 2
chr(66674)[0] # '\ud801'

I expect the nth element of a string to be the nth codepoint, regardless
of unicode settings. I don't know why the maxunicode is configured
differently (both compiled by ubuntu), but is this the expected behavior?

If this is actually the expected behavior, how can I configure a build
of python to use the larger maxunicode value?

--
components: Unicode
messages: 77940
nosy: ede
severity: normal
status: open
title: Unicode: multiple chars for high code points
versions: Python 3.0

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



[issue6433] multiprocessing: pool.map hangs on empty list

2009-07-07 Thread Eric Eisner

New submission from Eric Eisner :

In multiprocessing, if you give a pool.map a zero-length iterator and
specify a nonzero chunksize, the process hangs indefinitely. Example:

import multiprocessing
pool = multiprocessing.Pool()
pool.map(len, [], chunksize=1)
# hang forever

Attached simple testcase and simple fix. I observed this behavior on 2.6
and 3.1, but only verified the patch on 3.1. Unless the line numbers
changed it will probably fix it on 2.6 as well.

--
components: Library (Lib)
files: map_testandfix.patch
keywords: patch
messages: 90228
nosy: ede
severity: normal
status: open
title: multiprocessing: pool.map hangs on empty list
type: crash
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1
Added file: http://bugs.python.org/file14467/map_testandfix.patch

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



[issue6433] multiprocessing: pool.map hangs on empty list

2009-07-07 Thread Eric Eisner

Eric Eisner  added the comment:

A few lines before this patch the code turns iterable into a list if it
does not hasattr('__len__') for the purpose of calculating the chunksize.

--

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



[issue6440] 2to3: convert deprecated string.maketrans to str.maketrans

2009-07-08 Thread Eric Eisner

New submission from Eric Eisner :

string.maketrans has been deprecated in 3.x in favor of the more
specific bytes.maketrans and str.maketrans (see issue5675). It would be
nice if 2to3 would automatically translate this to one of those two
(probably str.maketrans).

I briefly looked at lib2to3/fixes/fix_renames.py, but this only seems to
convert things of the form module.X to module.Y. Is there another script
that deals with these jumping-around functions?

--
components: 2to3 (2.x to 3.0 conversion tool)
messages: 90268
nosy: ede
severity: normal
status: open
title: 2to3: convert deprecated string.maketrans to str.maketrans
type: feature request

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



[issue6433] multiprocessing: pool.map hangs on empty list

2009-07-13 Thread Eric Eisner

Eric Eisner  added the comment:

Can anyone review this patch? It is a very simple fix to catch this one
edge case. As this can cause multiprocessing to enter a state where it
needs to be externally killed, it would be good if this made 2.6.3.

--

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



[issue1023290] proposed struct module format code addition

2009-08-15 Thread Eric Eisner

Eric Eisner  added the comment:

Is there some pre-existing naming convention of as_X and fromX? It seems 
strange that two related functions would have a different use of 
underscores.

--
nosy: +ede

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