[issue14059] Implement multiprocessing.Barrier

2012-02-20 Thread Charles-François Natali

Charles-François Natali  added the comment:

> Here is an initial implementation.

Wouldn't it be simpler with a mp.Condition?

Otherwise, this should be added to Lib/multiprocesing.synchronize.py, and the 
tests to test_multiprocessing.

--
nosy: +neologix

___
Python tracker 

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



[issue14060] Implement a CSP-style channel

2012-02-20 Thread Matt Joiner

Matt Joiner  added the comment:

As I see it, here are the desirable features of CSP-style concurrency as it 
pertains to channels:

1) At least an unbuffered mode
2) Can be marked closed
3) Block on multiple send/receives until one can proceed

Specifically features 1 and 2 could be bolted onto queue.Queue with excellent 
backward compatibility with existing usage of Queue. As mentioned on the 
mailing list, maxsize=None would mean infinite queue, and maxsize=0 would 
become the unbuffered mode Currently maxsize<=0 means infinite. Existing code 
that assumed one or the other and explicitly created Queues this way would have 
to change (I'd suspect almost no code would be affected).

Feature 3 allows for all the awesomeness of CSP channels, but I think it 
requires a redesign under the covers of Queue to allow waiters to be woken from 
arbitrary Queues to which they are subscribed. The synchronization internals 
are quite complex.

There appears to be several ways to proceed:

1) Add unbuffered mode, closing, and other syntactical sugar to queue.Queue.
2) Do (1) and additionally rework the internals to allow blocking on on several 
Queue actions at once.
3) Add an unbuffered-only, closable threading.Channel for use with higher level 
primitives (as Guido suggested).
4) Make no changes to queue, and create a brand-new module with full blown CSP 
channels.

--

___
Python tracker 

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



[issue14071] allow more than one hash seed per process (move _Py_HashSecret into PyInterpreterState)

2012-02-20 Thread Gregory P. Smith

New submission from Gregory P. Smith :

The newly added hash randomization seed (issue 13703) is a global defined in 
object/object.c that is initialized only once within a process by a call from 
Py_InitializeEx().

For applications embedding Python interpreters it may be useful for them to NOT 
share a hash randomization seed across all interpreter instances within that 
process.  That way long living processes or processes serving many independent 
tasks can avoid using the same hash seed for separate tasks.

--
components: Interpreter Core
messages: 153855
nosy: gregory.p.smith
priority: normal
severity: normal
status: open
title: allow more than one hash seed per process (move _Py_HashSecret into 
PyInterpreterState)
type: enhancement
versions: Python 3.3

___
Python tracker 

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



[issue13703] Hash collision security issue

2012-02-20 Thread Georg Brandl

Georg Brandl  added the comment:

That is a good question.  I don't really care either way, but let's say +0 for 
turning it off when seed == 0.

-R still needs to be made default in 3.3 - that's one reason this issue is 
still open.

--

___
Python tracker 

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



[issue13703] Hash collision security issue

2012-02-20 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

Question: Should sys.flags.hash_randomization be True (1) when 
PYTHONHASHSEED=0?  It is now.

Saying yes "working as intended" is fine by me.

sys.flags.hash_randomization seems to simply indicate that doing something with 
the hash seed was explicitly specified as opposed to defaulting to off, not 
that the hash seed was actually chosen randomly.

What this implies for 3.3 after we make hash randomization default to on is 
that sys.flags.hash_randomization will always be 1.

--

___
Python tracker 

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



[issue13703] Hash collision security issue

2012-02-20 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

The bug report is the easiest thing to search for and follow when checking when 
something is resolved so it is nice to have a link to the relevant patch(es) 
for each branch.  I just wanted to note the major commit here so that all 
planned branches had a note recorded.  I don't care that it wasn't automatic. :)

For observers: There have been several more commits related to fixing this 
(test dict/set order fixes, bug/typo/merge oops fixes for the linked to 
patches, etc). Anyone interested in seeing the full list of diffs should look 
at their specific branch on our around the time of the linked to changelists.  
Too many to list here.

--

___
Python tracker 

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



[issue13605] document argparse's nargs=REMAINDER

2012-02-20 Thread Georg Brandl

Georg Brandl  added the comment:

Yes, that's correct.

--

___
Python tracker 

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



[issue13703] Hash collision security issue

2012-02-20 Thread Georg Brandl

Georg Brandl  added the comment:

But since our workflow is such that commits in X.Y branches always show up in 
X.Y+1, it doesn't really matter.

--

___
Python tracker 

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



[issue13703] Hash collision security issue

2012-02-20 Thread Éric Araujo

Éric Araujo  added the comment:

Yep, the bot only looks at commit messages, it does not inspect merges or other 
topographical information.  That’s why some of us make sure to repeat bug 
numbers in our merge commit messages.

--

___
Python tracker 

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



[issue13703] Hash collision security issue

2012-02-20 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

Roundup Robot didn't seem to notice it, but this has also been committed in 2.7:

http://hg.python.org/cpython/rev/a0f43f4481e0

--

___
Python tracker 

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



[issue13641] decoding functions in the base64 module could accept unicode strings

2012-02-20 Thread Guido van Rossum

Guido van Rossum  added the comment:

Aside: I, too, at first thought this would be a bad idea because it brings back 
the Python 2 issue of accepting some but not all Unicode strings. But then I 
realized that by their nature these functions only accepts a very specific set 
of characters -- so the restriction to (a subset of) ASCII is intrinsic to the 
functionality, and there is no possibility of confusion. If anything, accepting 
bytes is more likely to be confusing (they could be EBCDIC! :-). So no 
objection here. And a slight preference for ValueError.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue14068] problem with re split

2012-02-20 Thread 启朗 杨

启朗 杨  added the comment:

sure,here is an simple string from the news1.xml

--
Added file: http://bugs.python.org/file24589/news1.xml

___
Python tracker 

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



[issue8942] __path__ attribute of modules loaded by zipimporter is untested

2012-02-20 Thread Éric Araujo

Changes by Éric Araujo :


--
keywords: +easy
nosy: +brett.cannon, eric.snow, ncoghlan
stage:  -> needs patch
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



[issue3213] "pydoc -p" should listen to [::] if IPv6 is supported

2012-02-20 Thread Éric Araujo

Changes by Éric Araujo :


--
type: behavior -> enhancement
versions: +Python 3.3 -Python 2.6, Python 2.7, 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



[issue7966] mhlib does not emit deprecation warning

2012-02-20 Thread Éric Araujo

Éric Araujo  added the comment:

This was fixed by r63030.

--
nosy: +eric.araujo
resolution:  -> fixed
stage: test needed -> committed/rejected
status: open -> closed
versions:  -Python 2.6

___
Python tracker 

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



[issue14068] problem with re split

2012-02-20 Thread Ezio Melotti

Ezio Melotti  added the comment:

Can you paste (or upload) a minimal working example (with a short sample 
string) that uses re.split and str.split and shows how re.split is failing?

--

___
Python tracker 

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



[issue2661] Mapping tests cannot be passed by user implementations

2012-02-20 Thread Éric Araujo

Éric Araujo  added the comment:

> I think it would be great to test the stdlib’s mapping classes against common 
> tests
grep told me that most of them already do.  Sorry for the noise, it’s late/soon 
here.

--

___
Python tracker 

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



[issue7438] Allow to use a part of subprocess module during building Python

2012-02-20 Thread Éric Araujo

Éric Araujo  added the comment:

> It is sometimes useful to call subprocess.Popen() in setup.py of Python.

What use cases do you have in mind?  Maybe you want to remove the half-dozen 
calls to os.system?

--
nosy: +eric.araujo
versions: +Python 3.3 -Python 2.7, Python 3.2

___
Python tracker 

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



[issue7562] Custom order for the subcommands of build

2012-02-20 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

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



[issue7813] Bug in command-line module launcher

2012-02-20 Thread Éric Araujo

Éric Araujo  added the comment:

Sorry, 2.6 only gets security fixes now, closing.  Thanks for the report anyway!

--
nosy: +eric.araujo
resolution:  -> out of date
stage: 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



[issue14067] Avoid more stat() calls in importlib

2012-02-20 Thread Nick Coghlan

Nick Coghlan  added the comment:

FWIW, I doubt you'd get many objections if you ended up wanting to make time a 
builtin module and inject it into the bootstrapping namespace.

While I don't think the delay in noticing filesystem changes is reasonable as 
the default behaviour, it might be interesting to see how tricky it would be to 
create a custom importer (for either meta_path or path_hooks) that did this.

--

___
Python tracker 

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



[issue14070] reload(module, ignore_pyc=True) flag

2012-02-20 Thread Tim McNamara

New submission from Tim McNamara :

When developing Python code, I often find myself needing to run "rm *.pyc" so 
that the interpreter will ignore any new changes that I have made to source 
files. It's really frustrating when forgotten.

Adding a flag to the reload builtin would go a long way to simplify this 
process.

--
components: IO
messages: 153839
nosy: timClicks
priority: normal
severity: normal
status: open
title: reload(module, ignore_pyc=True) flag

___
Python tracker 

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



[issue14068] problem with re split

2012-02-20 Thread 启朗 杨

启朗 杨  added the comment:

i use python to handle some string. 
here is my code:
# -*- coding: utf-8 -*- 
from lxml import etree
import collectcorpus
import re


doc = etree.parse("news1.xml")

root = doc.getroot()
children = root.getchildren()
flag = 1
for child in children:
if flag == len(children):
content = child.find("content").text
pattern = re.compile('。')
sentences = re.split(pattern, content)
print "*"
for s in sentences:
print s
print "**"
#collectcorpus.collectCorpusFromString(content)
flag = flag + 1
when i use re split it print that: *
南澳大利亚,这里的每一寸土地,都是那么的温柔与清新。阿德莱德、芭萝莎、袋鼠岛……你真正面对它们时,总会有种难以名状的美好——那连绵的山峰、起伏的山谷、葱郁的牧场、飘香的田园、平静的湖泊还有那4800公里的海滩,定会让你的梦想在这里启程!南澳大利亚州是澳大利亚面积第四大州,也被称为“节日之州”。它是澳大利亚大陆唯一1个与所有的州和领地接壤的州,首府位于阿德莱德。阿德莱德街景【阿德莱德】阿德莱德(Adelaide)可以说是一座“爱情之城”。因为最初的命名便是威廉四世由他的妻子的名字而得来。阿德莱德对于长期生活在北京、上海这样动辄上千万人口的城市来说,真的一点也不算大。但对于只有160万人口的南澳,能拥有其四分之三人口的比重,在当地人看来已经是非常了不起的事了。但俗话说,麻雀虽小,却五脏俱全。阿德莱德在城市规划以及便民设计上却相当的令人称赞。市区免费巴士市中心有免费得巴士及轻轨可供市民出行使用,大街上随处可见的引用自来水管,干净且便捷。还有遍布市区的草坪绿地,无论你是散步或是运动,都会是一种绝佳的享受。这里的城市规划不仅实用,还挺有意思:市政府规定,只需在城中心建造商业区,而出了很小范围的中心后,是不允许建造高楼的,主要目的就是保护市民的居住环境不必受损。而同样,市民也很乐于居住在郊外,理由同样很简单:“舒服”。阿德莱德大学阿德莱德大学是该市最著名的学校,位于市中心城市图书馆附近。它是一所开放式大学,没有围墙,没有保安,任何人都可以在其中感受学术的氛围。这座城市虽然历史并非多么久远,但他们非常重视保护历史遗迹,无论是旧图书馆还是宴会厅,都保留着古老的建筑。甚至在山上还存有被烧毁的木楼,以来警示后人。阿德莱德著名的商业街在阿城有一条街值得一提,它叫Rundle
 mall,是这个城市的商业中心,白天熙熙攘攘的人群川流不息,各类时尚品牌尽在其中,和它相连接的一条是亨德利街Hindle 
St,这里集酒吧,餐馆,咖啡馆于一体,是夜生活集中区域。纵观这座依山傍水的城市,真不愧为澳大利亚最优美、最有格调的城,它的天然美景与优雅气质,绝对让人一见倾心。
**
done!

when i switch to use str split, it print that: *
南澳大利亚,这里的每一寸土地,都是那么的温柔与清新
阿德莱德、芭萝莎、袋鼠岛……你真正面对它们时,总会有种难以名状的美好——那连绵的山峰、起伏的山谷、葱郁的牧场、飘香的田园、平静的湖泊还有那4800公里的海滩,定会让你的梦想在这里启程!南澳大利亚州是澳大利亚面积第四大州,也被称为“节日之州”
它是澳大利亚大陆唯一1个与所有的州和领地接壤的州,首府位于阿德莱德
阿德莱德街景【阿德莱德】阿德莱德(Adelaide)可以说是一座“爱情之城”
因为最初的命名便是威廉四世由他的妻子的名字而得来
阿德莱德对于长期生活在北京、上海这样动辄上千万人口的城市来说,真的一点也不算大
但对于只有160万人口的南澳,能拥有其四分之三人口的比重,在当地人看来已经是非常了不起的事了
但俗话说,麻雀虽小,却五脏俱全
阿德莱德在城市规划以及便民设计上却相当的令人称赞
市区免费巴士市中心有免费得巴士及轻轨可供市民出行使用,大街上随处可见的引用自来水管,干净且便捷
还有遍布市区的草坪绿地,无论你是散步或是运动,都会是一种绝佳的享受
这里的城市规划不仅实用,还挺有意思:市政府规定,只需在城中心建造商业区,而出了很小范围的中心后,是不允许建造高楼的,主要目的就是保护市民的居住环境不必受损
而同样,市民也很乐于居住在郊外,理由同样很简单:“舒服”
阿德莱德大学阿德莱德大学是该市最著名的学校,位于市中心城市图书馆附近
它是一所开放式大学,没有围墙,没有保安,任何人都可以在其中感受学术的氛围
这座城市虽然历史并非多么久远,但他们非常重视保护历史遗迹,无论是旧图书馆还是宴会厅,都保留着古老的建筑
甚至在山上还存有被烧毁的木楼,以来警示后人
阿德莱德著名的商业街在阿城有一条街值得一提,它叫Rundle 
mall,是这个城市的商业中心,白天熙熙攘攘的人群川流不息,各类时尚品牌尽在其中,和它相连接的一条是亨德利街Hindle 
St,这里集酒吧,餐馆,咖啡馆于一体,是夜生活集中区域
纵观这座依山傍水的城市,真不愧为澳大利亚最优美、最有格调的城,它的天然美景与优雅气质,绝对让人一见倾心

**
done!

it means that re's split does not work!!

--

___
Python tracker 

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



[issue14069] In extensions (?...) the lookbehind assertion cannot choose between the beginning of string and a letter

2012-02-20 Thread py.user

New submission from py.user :

>>> import re
>>> re.search(r'(?<=(a|b))(\w+)', 'abc').groups()
('a', 'bc')
>>> re.search(r'(?<=(^))(\w+)', 'abc').groups()
('', 'abc')
>>> re.search(r'(?<=(^|$))(\w+)', 'abc').groups()
('', 'abc')
>>> re.search(r'(?<=($|^))(\w+)', 'abc').groups()
('', 'abc')
>>> re.search(r'(?<=(^|a))(\w+)', 'abc').groups()
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/functools.py", line 176, in wrapper
result = cache[key]
KeyError: (, '(?<=(^|a))(\\w+)', 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.2/re.py", line 158, in search
return _compile(pattern, flags).search(string)
  File "/usr/local/lib/python3.2/re.py", line 255, in _compile
return _compile_typed(type(pattern), pattern, flags)
  File "/usr/local/lib/python3.2/functools.py", line 180, in wrapper
result = user_function(*args, **kwds)
  File "/usr/local/lib/python3.2/re.py", line 267, in _compile_typed
return sre_compile.compile(pattern, flags)
  File "/usr/local/lib/python3.2/sre_compile.py", line 495, in compile
code = _code(p, flags)
  File "/usr/local/lib/python3.2/sre_compile.py", line 480, in _code
_compile(code, p.data, flags)
  File "/usr/local/lib/python3.2/sre_compile.py", line 115, in _compile
raise error("look-behind requires fixed-width pattern")
sre_constants.error: look-behind requires fixed-width pattern
>>>

--
components: Library (Lib), Regular Expressions
messages: 153836
nosy: ezio.melotti, py.user
priority: normal
severity: normal
status: open
title: In extensions (?...) the lookbehind assertion cannot choose between the 
beginning of string and a letter
type: behavior
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



[issue14068] problem with re

2012-02-20 Thread 启朗 杨

Changes by 启朗 杨 :


--
nosy: 启朗.杨
priority: normal
severity: normal
status: open
title: problem with re

___
Python tracker 

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



[issue14068] problem with re split

2012-02-20 Thread 启朗 杨

New submission from 启朗 杨 :

i use python to handle some string. 
here is my code:
# -*- coding: utf-8 -*- 
from lxml import etree
import collectcorpus
import re


doc = etree.parse("/home/harveyang/workspace/corpus/newsscrapy/news1.xml")

root = doc.getroot()
children = root.getchildren()
flag = 1
for child in children:
if flag == len(children):
content = child.find("content").text
pattern = re.compile('。')
sentences = re.split(pattern, content)
print "*"
for s in sentences:
print s
print "**"
#collectcorpus.collectCorpusFromString(content)
flag = flag + 1
when i use re split it print that: *
南澳大利亚,这里的每一寸土地,都是那么的温柔与清新。阿德莱德、芭萝莎、袋鼠岛……你真正面对它们时,总会有种难以名状的美好——那连绵的山峰、起伏的山谷、葱郁的牧场、飘香的田园、平静的湖泊还有那4800公里的海滩,定会让你的梦想在这里启程!南澳大利亚州是澳大利亚面积第四大州,也被称为“节日之州”。它是澳大利亚大陆唯一1个与所有的州和领地接壤的州,首府位于阿德莱德。阿德莱德街景【阿德莱德】阿德莱德(Adelaide)可以说是一座“爱情之城”。因为最初的命名便是威廉四世由他的妻子的名字而得来。阿德莱德对于长期生活在北京、上海这样动辄上千万人口的城市来说,真的一点也不算大。但对于只有160万人口的南澳,能拥有其四分之三人口的比重,在当地人看来已经是非常了不起的事了。但俗话说,麻雀虽小,却五脏俱全。阿德莱德在城市规划以及便民设计上却相当的令人称赞。市区免费巴士市中心有免费得巴士及轻轨可供市民出行使用,大街上随处可见的引用自来水管,干净且便捷。还有遍布市区的草坪绿地,无论你是散步或是运动,都会是一种绝佳的享受。这里的城市规划不仅实用,还挺有意思:市政府规定,只需在城中心建造商业区,而出了很小范围的中心后,是不允许建造高楼的,主要目的就是保护市民的居住环境不必受损。而同样,市民也很乐于居住在郊外,理由同样很简单:“舒服”。阿德莱德大学阿德莱德大学是该市最著名的学校,位于市中心城市图书馆附近。它是一所开放式大学,没有围墙,没有保安,任何人都可以在其中感受学术的氛围。这座城市虽然历史并非多么久远,但他们非常重视保护历史遗迹,无论是旧图书馆还是宴会厅,都保留着古老的建筑。甚至在山上还存有被烧毁的木楼,以来警示后人。阿德莱德著名的商业街在阿城有一条街值得一提,它叫Rundle
 mall,是这个城市的商业中心,白天熙熙攘攘的人群川流不息,各类时尚品牌尽在其中,和它相连接的一条是亨德利街Hindle 
St,这里集酒吧,餐馆,咖啡馆于一体,是夜生活集中区域。纵观这座依山傍水的城市,真不愧为澳大利亚最优美、最有格调的城,它的天然美景与优雅气质,绝对让人一见倾心。上一页12345下一页转发此文至微博【新浪旅游声明】本文未经授权许可,任何单位及个人不得转载、摘编或以其它方式使用。
**
done!

when i switch to use str split, it print that: *
南澳大利亚,这里的每一寸土地,都是那么的温柔与清新
阿德莱德、芭萝莎、袋鼠岛……你真正面对它们时,总会有种难以名状的美好——那连绵的山峰、起伏的山谷、葱郁的牧场、飘香的田园、平静的湖泊还有那4800公里的海滩,定会让你的梦想在这里启程!南澳大利亚州是澳大利亚面积第四大州,也被称为“节日之州”
它是澳大利亚大陆唯一1个与所有的州和领地接壤的州,首府位于阿德莱德
阿德莱德街景【阿德莱德】阿德莱德(Adelaide)可以说是一座“爱情之城”
因为最初的命名便是威廉四世由他的妻子的名字而得来
阿德莱德对于长期生活在北京、上海这样动辄上千万人口的城市来说,真的一点也不算大
但对于只有160万人口的南澳,能拥有其四分之三人口的比重,在当地人看来已经是非常了不起的事了
但俗话说,麻雀虽小,却五脏俱全
阿德莱德在城市规划以及便民设计上却相当的令人称赞
市区免费巴士市中心有免费得巴士及轻轨可供市民出行使用,大街上随处可见的引用自来水管,干净且便捷
还有遍布市区的草坪绿地,无论你是散步或是运动,都会是一种绝佳的享受
这里的城市规划不仅实用,还挺有意思:市政府规定,只需在城中心建造商业区,而出了很小范围的中心后,是不允许建造高楼的,主要目的就是保护市民的居住环境不必受损
而同样,市民也很乐于居住在郊外,理由同样很简单:“舒服”
阿德莱德大学阿德莱德大学是该市最著名的学校,位于市中心城市图书馆附近
它是一所开放式大学,没有围墙,没有保安,任何人都可以在其中感受学术的氛围
这座城市虽然历史并非多么久远,但他们非常重视保护历史遗迹,无论是旧图书馆还是宴会厅,都保留着古老的建筑
甚至在山上还存有被烧毁的木楼,以来警示后人
阿德莱德著名的商业街在阿城有一条街值得一提,它叫Rundle 
mall,是这个城市的商业中心,白天熙熙攘攘的人群川流不息,各类时尚品牌尽在其中,和它相连接的一条是亨德利街Hindle 
St,这里集酒吧,餐馆,咖啡馆于一体,是夜生活集中区域
纵观这座依山傍水的城市,真不愧为澳大利亚最优美、最有格调的城,它的天然美景与优雅气质,绝对让人一见倾心
上一页12345下一页转发此文至微博【新浪旅游声明】本文未经授权许可,任何单位及个人不得转载、摘编或以其它方式使用

**
done!

it means that re's split does not work!!

--
components: +Regular Expressions
nosy: +ezio.melotti
title: problem with re -> problem with re split
type:  -> behavior
versions: +Python 2.7

___
Python tracker 

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



[issue2661] Mapping tests cannot be passed by user implementations

2012-02-20 Thread Éric Araujo

Éric Araujo  added the comment:

I think it would be great to test the stdlib’s mapping classes against common 
tests; there is a patch to add more MutableMapping methods to dbm classes for 
example, and it was not trivial to get good test coverage.

Not sure about the status of the module though, i.e. if we should officially 
support people using mapping_tests to check their code; it would be very useful 
for classes that don’t inherit from an ABC, but the whole test package is not 
intended for public use.

--
nosy: +eric.araujo
stage:  -> needs patch
versions: +Python 2.7, Python 3.2, Python 3.3 -Python 3.1

___
Python tracker 

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



[issue3354] Improve error reporting for the argument parsing C API

2012-02-20 Thread Éric Araujo

Changes by Éric Araujo :


--
title: Improve error reporting for the argument parsing API -> Improve error 
reporting for the argument parsing C API
versions: +Python 3.3 -Python 2.7, Python 3.2

___
Python tracker 

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



[issue5411] Add xz support to shutil

2012-02-20 Thread Éric Araujo

Éric Araujo  added the comment:

Note that there is a way to get fully automated support for tar formats: 
tarfile could expose, in addition to the list compression_formats, another 
structure with the descriptions (e.g. “gzip’ed tar file”) and file extensions 
(e.g. ['.gz', '.tgz'] —no, it’s not '.tar.gz', which is unfortunate, and could 
cause Lars to reject that idea).  I’m just putting this here for reference, but 
my preference is still for the second idea I talk about in my precedent message.

--

___
Python tracker 

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



[issue13703] Hash collision security issue

2012-02-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 6b7704fe1be1 by Barry Warsaw in branch '2.6':
- Issue #13703: oCERT-2011-003: add -R command-line option and PYTHONHASHSEED
http://hg.python.org/cpython/rev/6b7704fe1be1

--

___
Python tracker 

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



[issue5411] Add xz support to shutil

2012-02-20 Thread Éric Araujo

Éric Araujo  added the comment:

I have a working updated shutil module, tests pass and the documentation is 
improved.  I will make sure to make different commits for improving the tests, 
cleaning up some things, adding tarfile.compression_formats and removing 
duplication in shutil (see dep bugs), to be sure not to introduce regressions.

Before I finish and post the patch, I’d like feedback on a choice I made.  I 
don’t think it’s possible to have shutil automatically support all the formats 
that tarfile does, because of the spelling issue I mentioned.  Here’s what the 
code would look like (let me know if I should post it elsewhere or as a file to 
let you get syntax coloring):
  
  _ARCHIVE_FORMATS = {}
  _UNPACK_FORMATS = {}

  for fmt in tarfile.compression_formats:
  code = fmt + 'tar'
  ext = '.' + fmt
  desc = "%s'ed tar file" % fmt
  _ARCHIVE_FORMATS[code] = (_make_tarball, [('compress', fmt)], desc)
  _UNPACK_FORMATS[code] = ([ext], _unpack_tarfile, [], desc)

  # kludge to add alternate extension
  if 'gztar' in _ARCHIVE_FORMATS:
  _UNPACK_FORMATS['gztar'][0].append('.tgz')
  # XXX desc should say "gzip'ed tar file", not "gz'ed"

  # rectify naming incompatibility
  if 'bz2tar' in _ARCHIVE_FORMATS:
  # XXX alternative: make 'bztar' alias for 'bz2tar', but would complicate
  # manipulating the registries
  del _ARCHIVE_FORMATS['bz2tar']
  del _UNPACK_FORMATS['bz2tar']
  desc = "bzip2'ed tar file"
  _ARCHIVE_FORMATS['bztar'] = (_make_tarball, [('compress', 'bz2')], desc)
  _UNPACK_FORMATS['bztar'] = (['.bz2'], _unpack_tarfile, [], desc)

  # now add uncompressed tar and zip file

I really don’t like that code.  Given that tarfile is not extensible at run 
time, it is not a big deal to have to update shutil whenever we add a 
compression format to tarfile.  Therefore, I backtracked on my “automatic 
support” idea but kept a lot of cleanup in did in the code.  Here’s what the 
code looks like:

  _ARCHIVE_FORMATS = {}
  _UNPACK_FORMATS = {}

  if 'xz' in tarfile.compression_formats:
  desc = "xz'ed tar file"
  # XXX '.xz' is not great, '.tar.xz' would be better
  _ARCHIVE_FORMATS['xztar'] = (_make_tarball, [('compress', 'xz')], desc)
  _UNPACK_FORMATS['xztar'] = (['.xz'], _unpack_tarfile, [], desc)

  if 'bz2' in tarfile.compression_formats:
  desc = "bzip2'ed tar file"
  _ARCHIVE_FORMATS['bztar'] = (_make_tarball, [('compress', 'bz2')], desc)
  _UNPACK_FORMATS['bztar'] = (['.bz2'], _unpack_tarfile, [], desc)

  if 'gz' in tarfile.compression_formats:
  desc = "gzip'ed tar file"
  _ARCHIVE_FORMATS['gztar'] = (_make_tarball, [('compress', 'gz')], desc)
  _UNPACK_FORMATS['gztar'] = (['.gz', '.tgz'], _unpack_tarfile, [], desc)

So, do you agree that “not automated but not ugly” is better than “automated 
with ugly klutches”?

--
title: shutil should support all formats supported by tarfile automatically -> 
Add xz support to shutil

___
Python tracker 

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



[issue5411] Add xz support to shutil

2012-02-20 Thread Éric Araujo

Éric Araujo  added the comment:

s/cleanup in did in the code/cleanup I did in the code/

--

___
Python tracker 

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



[issue13641] decoding functions in the base64 module could accept unicode strings

2012-02-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Non-ascii binary data should not be being rejected unless validate
> is true.  So what are you going to do with non-ascii-range unicode in
> that case?  Ignore it as well?  That can't be right.

It's not ignored, it raises ValueError. Since the common case it to feed
valid (not invalid) baseXX data to these functions, that's a very benign
limitation.

--

___
Python tracker 

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



[issue13637] binascii.a2b_* functions could accept unicode strings

2012-02-20 Thread R. David Murray

R. David Murray  added the comment:

I disagree with this feature.  Reopening pending discussion on python-dev.

--
nosy: +r.david.murray
status: closed -> open

___
Python tracker 

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



[issue13641] decoding functions in the base64 module could accept unicode strings

2012-02-20 Thread R. David Murray

R. David Murray  added the comment:

I disagree with this commit.  Reopening pending discussion on python-dev.

--
status: closed -> open

___
Python tracker 

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



[issue13641] decoding functions in the base64 module could accept unicode strings

2012-02-20 Thread R. David Murray

R. David Murray  added the comment:

Non-ascii binary data should not be being rejected unless validate
is true.  So what are you going to do with non-ascii-range unicode in
that case?  Ignore it as well?  That can't be right.

I believe this should be discussed on python-dev.

--

___
Python tracker 

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



[issue14026] test_cmd_line_script should include more sys.argv checks

2012-02-20 Thread Jason Yeo

Changes by Jason Yeo :


--
keywords: +patch
Added file: http://bugs.python.org/file24588/14026v2.patch

___
Python tracker 

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



[issue14026] test_cmd_line_script should include more sys.argv checks

2012-02-20 Thread Jason Yeo

Changes by Jason Yeo :


Removed file: http://bugs.python.org/file24556/14026patch

___
Python tracker 

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



[issue14026] test_cmd_line_script should include more sys.argv checks

2012-02-20 Thread Jason Yeo

Changes by Jason Yeo :


Removed file: http://bugs.python.org/file24587/mypatch

___
Python tracker 

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



[issue14026] test_cmd_line_script should include more sys.argv checks

2012-02-20 Thread Jason Yeo

Jason Yeo  added the comment:

>For the two failures, I suggest modifying _check_script() to return the 
>"rc, out, err" from the underlying assert_python_ok() call

I've decided to simple pass in *example_args into the assert_python_ok() in 
those two offending tests. There are less changes this way. Please let me know 
if I am doing this correctly. Thanks. ;)

--
Added file: http://bugs.python.org/file24587/mypatch

___
Python tracker 

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



[issue13964] os.utimensat() and os.futimes() should accept Decimal, drop os.futimens()

2012-02-20 Thread STINNER Victor

STINNER Victor  added the comment:

Here is a first step: add _PyTime_ObjectToTimespec() to pytime.h and use it for 
signal.sigtimedwait().

signal.sigtimedwait(sigwait, (timeout_sec, timeout_nsec)) becomes 
signal.sigtimedwait(sigwait, timeout).

I chose pytime.h instead of timefuncs.h because I plan to use 
_PyTime_ObjectToTimespec() in the posix module. I don't want to have a copy of 
this function in each module: timefuncs.h requires to compile the module with 
_time.c.

--
keywords: +patch
Added file: http://bugs.python.org/file24586/pytime.patch

___
Python tracker 

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



[issue13605] document argparse's nargs=REMAINDER

2012-02-20 Thread Éric Araujo

Éric Araujo  added the comment:

> Blocks not introduced by "::" are *NOT* code blocks.
> If they happen to begin with ">>> ", they are recognized as doctest blocks
> and colorized as doctests.

Ah, that’s it!  Thanks.  So we have two valid ways of marking up doctest-like 
blocks, “::” ° indent and implicit markup, right?

--

___
Python tracker 

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



[issue1521950] shlex.split() does not tokenize like the shell

2012-02-20 Thread Éric Araujo

Éric Araujo  added the comment:

This time you should have received an email from Rietveld, I made sure that 
your ID was expanded to an email address.

I like all the suggestions you made in reply to my comments.

--

___
Python tracker 

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



[issue14053] Make patchcheck work with MQ

2012-02-20 Thread Francisco Martín Brugué

Francisco Martín Brugué  added the comment:

Updated.

Interesting: I saw that repetition but due “[…] Ideally, it
should distinguish between this and other errors by checking the
subprocess's stderr, so that if a different error occurs, we can still
print out the error message. […]” I just wanted to keep cmd's separated first 
:-)

Let me know what can be done …

Cheers,
francis

--
Added file: http://bugs.python.org/file24585/issue14053_3297dcdad196.patch

___
Python tracker 

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



[issue14050] Tutorial, list.sort() and items comparability

2012-02-20 Thread Éric Araujo

Éric Araujo  added the comment:

Nope, the expression would be hyphenated only when used as an adjective:

- “This sorts the sequence in place”
vs.
‑ “Performs an in-place rearrangement by birthdate”

--

___
Python tracker 

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



[issue14047] UTF-8 Email Header

2012-02-20 Thread Éric Araujo

Éric Araujo  added the comment:

I had written a message which read much like Martin’s and wanted to reopen this 
report, but apparently my flaky connection did not let it go through and now 
it’s lost.  My apologies for not understanding your report for what it was, and 
thanks for persevering.

--

___
Python tracker 

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



[issue14034] Add argparse howto

2012-02-20 Thread Éric Araujo

Éric Araujo  added the comment:

Nice.  I’ll find time to review later; Steven, do you have objections on the 
idea of adding an argparse howto?  Do you want to review it yourself?

--
nosy: +bethard
title: first example in argparse doc is too complicated -> Add argparse howto

___
Python tracker 

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



[issue13447] Add tests for some scripts in Tools/scripts

2012-02-20 Thread Éric Araujo

Éric Araujo  added the comment:

I’m pushing this higher on my todo list then.  I’ll certainly upload a patch 
for review here with the basic machinery, then commit it, and then we’ll be 
able to add tests for the tools we like.

--
assignee:  -> eric.araujo

___
Python tracker 

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



[issue14062] UTF-8 Email Subject problem

2012-02-20 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +r.david.murray

___
Python tracker 

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



[issue14053] Make patchcheck work with MQ

2012-02-20 Thread Éric Araujo

Changes by Éric Araujo :


--
title: Make Tools/scripts/patchcheck.py compatible with mercurial mqueues. -> 
Make patchcheck work with MQ

___
Python tracker 

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



[issue13703] Hash collision security issue

2012-02-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset ed76dc34b39d by Georg Brandl in branch 'default':
Merge 3.2: Issue #13703 plus some related test suite fixes.
http://hg.python.org/cpython/rev/ed76dc34b39d

--

___
Python tracker 

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



[issue14067] Avoid more stat() calls in importlib

2012-02-20 Thread Brett Cannon

Brett Cannon  added the comment:

On Mon, Feb 20, 2012 at 18:06, Antoine Pitrou wrote:

>
> Antoine Pitrou  added the comment:
>
> > The patch uses the time module which is not a built-in, so it breaks
> > bootstrapping by directly importing a module, and an extension at
> > that. At best you could switch to a modified _FileFinder after
> > importlib is initially running and able to import extension modules.
>
> Yup, as I said it's more of a proof-of-concept.
> (I was actually surprised that time is not a built-in module)

Yeah, I had to double-check myself.

--

___
Python tracker 

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



[issue14067] Avoid more stat() calls in importlib

2012-02-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> The patch uses the time module which is not a built-in, so it breaks
> bootstrapping by directly importing a module, and an extension at
> that. At best you could switch to a modified _FileFinder after
> importlib is initially running and able to import extension modules.

Yup, as I said it's more of a proof-of-concept.
(I was actually surprised that time is not a built-in module)

--

___
Python tracker 

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



[issue14067] Avoid more stat() calls in importlib

2012-02-20 Thread Brett Cannon

Brett Cannon  added the comment:

The patch uses the time module which is not a built-in, so it breaks 
bootstrapping by directly importing a module, and an extension at that. At best 
you could switch to a modified _FileFinder after importlib is initially running 
and able to import extension modules.

--

___
Python tracker 

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



[issue14053] Make Tools/scripts/patchcheck.py compatible with mercurial mqueues.

2012-02-20 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

Hmm... it looks like mq_changed_files() duplicates a chunk of logic from
the existing changed_files() code. You can get rid of this redundancy by
replacing mq_changed_files() with a function that checks for applied MQ
patches; let's call it mq_patches_applied(). Then you can say:

if mq_patches_applied():
cmd += ' --rev qparent'

before the call to Popen in changed_files(), and leave the rest of the
function unmodified. The basic logic that the code will follow is this:

if :
return files listed by 'hg status --added --modified --no-status --rev 
qparent'
else:
return files listed by 'hg status --added --modified --no-status'


The mq_patches_applied() function can be implemented by running
'hg qapplied' and checking whether it (a) prints at least one patch name,
(b) prints out nothing, or (c) gives an error.

--

___
Python tracker 

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



[issue14067] Avoid more stat() calls in importlib

2012-02-20 Thread Eric Snow

Changes by Eric Snow :


--
nosy: +eric.snow

___
Python tracker 

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



[issue14067] Avoid more stat() calls in importlib

2012-02-20 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Removed file: http://bugs.python.org/file24583/imptime.patch

___
Python tracker 

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



[issue14067] Avoid more stat() calls in importlib

2012-02-20 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Added file: http://bugs.python.org/file24584/imptime.patch

___
Python tracker 

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



[issue13405] Add DTrace probes

2012-02-20 Thread Dave Malcolm

Dave Malcolm  added the comment:

jcea: BTW, will you be at PyCon US this year?  if so, can we sprint on getting 
the DTrace and SystemTap hooks into CPython in some form acceptable to the rest 
of the CPython maintainers?

--

___
Python tracker 

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



[issue13447] Add tests for some scripts in Tools/scripts

2012-02-20 Thread Francisco Martín Brugué

Francisco Martín Brugué  added the comment:

+1

while working on #issue14053 I missed the test for the scripts (in this case 
some kind of mocking is needed).

--

___
Python tracker 

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



[issue10112] Use -Wl, --dynamic-list=x.list, not -Xlinker -export-dynamic

2012-02-20 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue10112] Use -Wl, --dynamic-list=x.list, not -Xlinker -export-dynamic

2012-02-20 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

The patch is fairly incomplete: it assumes that the compiler supports 
__attribute__((visibility())), but it really needs to check for that.

Also, there is no chance that this can go into Python 2.7; retargetting for 3.3.

--
versions: +Python 3.3 -Python 2.7

___
Python tracker 

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



[issue14067] Avoid more stat() calls in importlib

2012-02-20 Thread Antoine Pitrou

New submission from Antoine Pitrou :

This is an experimental patch that limits the frequency of stat() calls in 
_FileFinder.find_module(). It speeds up finding modules by 2x here, but 
unfortunately breaks some tests (which expect modules to appear immediately 
when created).

--
components: Library (Lib)
files: imptime.patch
keywords: patch
messages: 153809
nosy: brett.cannon, ncoghlan, pitrou
priority: low
severity: normal
status: open
title: Avoid more stat() calls in importlib
type: performance
versions: Python 3.3
Added file: http://bugs.python.org/file24583/imptime.patch

___
Python tracker 

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



[issue14053] Make Tools/scripts/patchcheck.py compatible with mercurial mqueues.

2012-02-20 Thread Francisco Martín Brugué

Francisco Martín Brugué  added the comment:

The patch is updated. Notice about:
[...]Ideally, it
  should distinguish between this and other errors by checking the
  subprocess's stderr, so that if a different error occurs, we can still
  print out the error message.
[…]
that should be improved as now stderr is ignored in 'mq_changed_files'
(user case: 'no mq extension enabled'). Suggestions are welcome!

> [..] but this is a bit orthogonal.
IMHO the MQ feature works very well for pydev newbies (as I'm) and it's
a good recommendation (it's a taste thing ...)

> The easiest thing to do is to make some changes and use
> "hg diff>  patch.diff" and the devguide should advertise this IMHO.  This 
> also works fine with `make patchcheck`.

There is some small differences between diff, qdiff and status but if one uses 
MQ then diff isn't enough. One really wants to know the changes from qparent to 
qtip and using 'status' as proposed I thing that it's the best solution.

Cheers,
francis

--
Added file: http://bugs.python.org/file24582/issue14053_1f9461ef6312.patch

___
Python tracker 

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



[issue14060] Implement a CSP-style channel

2012-02-20 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

I think zero-sized queues are exactly the right answer here.

--
nosy: +loewis

___
Python tracker 

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



[issue14063] test_importlib failure on Mac OS X

2012-02-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Ok, thanks for testing!

--
resolution:  -> fixed
stage:  -> 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



[issue14063] test_importlib failure on Mac OS X

2012-02-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 3297dcdad196 by Antoine Pitrou in branch 'default':
Issue #14063: fix test_importlib failure under OS X case-insensitive filesystems
http://hg.python.org/cpython/rev/3297dcdad196

--
nosy: +python-dev

___
Python tracker 

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



[issue14063] test_importlib failure on Mac OS X

2012-02-20 Thread Ned Deily

Ned Deily  added the comment:

With impcasing.patch applied, test_importlib passes on OS X (10.7 with 
case-insensitive fs).

--

___
Python tracker 

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



[issue14063] test_importlib failure on Mac OS X

2012-02-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Can you please try this patch?

--
assignee: brett.cannon -> 
keywords: +patch
Added file: http://bugs.python.org/file24581/impcasing.patch

___
Python tracker 

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



[issue13703] Hash collision security issue

2012-02-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 4a31f6b11e7a by Georg Brandl in branch '3.2':
Merge from 3.1: Issue #13703: add a way to randomize the hash values of basic 
types (str, bytes, datetime)
http://hg.python.org/cpython/rev/4a31f6b11e7a

--

___
Python tracker 

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



[issue14066] Crash in imputil.imp.find_module when a *directory* exists with the given name due to double-close of FILE*

2012-02-20 Thread Dave Malcolm

Dave Malcolm  added the comment:

Duplicate of issue 7732

--
resolution:  -> duplicate
status: open -> closed
superseder:  -> imp.find_module crashes Python if there exists a directory 
named "__init__.py"

___
Python tracker 

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



[issue14063] test_importlib failure on Mac OS X

2012-02-20 Thread Ned Deily

Ned Deily  added the comment:

The first bad revision is:
changeset:   75048:bbaab666e6c7
parent:  75045:5b4b70bd2b6f
user:Antoine Pitrou 
date:Mon Feb 20 01:48:16 2012 +0100
summary: Issue #14043: Speed up importlib's _FileFinder by at least 8x, and 
add a new importlib.invalidate_caches() function.

--

___
Python tracker 

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



[issue14066] Crash in imputil.imp.find_module when a *directory* exists with the given name due to double-close of FILE*

2012-02-20 Thread Dave Malcolm

New submission from Dave Malcolm :

$ mkdir some_directory_ending_with_a.py
$ python -c "import imputil; 
imputil.imp.find_module('some_directory_ending_with_a')"
*** glibc detected *** python: double free or corruption (!prev): 
0x01589bf0 ***
Aborted

What's happening is that call_find_module opens fp, and tries to create a 
PyFileObject from it:

  2844 if (fp != NULL) {
>>2845 fob = PyFile_FromFile(fp, pathname, fdp->mode, fclose);
  2846 if (fob == NULL) {
  2847 fclose(fp);
  2848 return NULL;
  2849 }
  2850 }

The call fails at the very end of fill_file_fields() inside the call to 
dircheck() here:
   180  f->f_fp = fp;
   181  f = dircheck(f);
   182  return (PyObject *) f;
   183  }
   184  

but f->fp == fp

Hence when fill_file_fields returns NULL, and f is cleaned up here:
   484  if (fill_file_fields(f, fp, o_name, mode, close) == NULL) {
>> 485  Py_DECREF(f);
   486  Py_DECREF(o_name);
   487  return NULL;
   488  }

then f->fp is closed within file_dealloc()

Then, when PyFile_FromFile returns NULL, call_find_module calls fclose(fp):
  2844 if (fp != NULL) {
  2845 fob = PyFile_FromFile(fp, pathname, fdp->mode, fclose);
  2846 if (fob == NULL) {
>>2847 fclose(fp);
  2848 return NULL;
  2849 }
  2850 }

and it attempts to close fp for the second time.

The documentation for PyFile_FromFile:
  http://docs.python.org/c-api/file.html#PyFile_FromFile
says:
"Return NULL and close the file using close on failure".

It therefore looks like call_find_module's fclose(fp) is incorrect here, and is 
what leads to the double-free.

--
components: Library (Lib)
messages: 153799
nosy: dmalcolm
priority: normal
severity: normal
status: open
title: Crash in imputil.imp.find_module when a *directory* exists with the 
given name due to double-close of FILE*
type: crash
versions: Python 2.7

___
Python tracker 

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



[issue13703] Hash collision security issue

2012-02-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset f4b7ecf8a5f8 by Georg Brandl in branch '3.1':
Issue #13703: add a way to randomize the hash values of basic types (str, 
bytes, datetime)
http://hg.python.org/cpython/rev/f4b7ecf8a5f8

--
nosy: +python-dev

___
Python tracker 

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



[issue14040] Deprecate some of the module file formats

2012-02-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I've now committed the suffix removal patch with a what's new entry. Thanks!

--
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



[issue14053] Make Tools/scripts/patchcheck.py compatible with mercurial mqueues.

2012-02-20 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

> Shouldn't be --rev qparent ?

Yes, that's right. I seem to confuse qbase and qparent often...

--

___
Python tracker 

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



[issue14040] Deprecate some of the module file formats

2012-02-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 42f61304f77d by Antoine Pitrou in branch 'default':
Issue #14040: Remove rarely used file name suffixes for C extensions (under 
POSIX mainly).
http://hg.python.org/cpython/rev/42f61304f77d

--
nosy: +python-dev

___
Python tracker 

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



[issue13641] decoding functions in the base64 module could accept unicode strings

2012-02-20 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
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



[issue13641] decoding functions in the base64 module could accept unicode strings

2012-02-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I've committed issue13641-alternative-v1.patch. I really think practicality 
beats purity here and, furthermore, there's no associated danger (non-ASCII 
data is rejected both as bytes and str).

--

___
Python tracker 

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



[issue13641] decoding functions in the base64 module could accept unicode strings

2012-02-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset c760bd844222 by Antoine Pitrou in branch 'default':
Issue #13641: Decoding functions in the base64 module now accept ASCII-only 
unicode strings.
http://hg.python.org/cpython/rev/c760bd844222

--
nosy: +python-dev

___
Python tracker 

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



[issue14063] test_importlib failure on Mac OS X

2012-02-20 Thread Brett Cannon

Brett Cannon  added the comment:

I have a Mac, but I'm heading out the door; I will see if I can diagnose it and 
fix it tonight or tomorrow (unless someone beats me to it).

--

___
Python tracker 

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



[issue14063] test_importlib failure on Mac OS X

2012-02-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Antoine, do you think this may have been triggered by your latest patch?

I don't know, perhaps Vinay can bisect to find the offending commit?
(I don't have a Mac)

--

___
Python tracker 

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



[issue14052] importlib mixes up '.' and os.getcwd()

2012-02-20 Thread Brett Cannon

Changes by Brett Cannon :


--
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



[issue14052] importlib mixes up '.' and os.getcwd()

2012-02-20 Thread Brett Cannon

Brett Cannon  added the comment:

The test suite does use importlib for some imports as finders from importlib 
for some packages stick around. I brought this up a way back but people thought 
it was actually a good idea to let importlib handle imports to stress test it.

Anyway, if it can't be reproduced then I don't think this is worth worrying 
about. As Nick pointed out, everything should be absolute anyway.

--

___
Python tracker 

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



[issue14063] test_importlib failure on Mac OS X

2012-02-20 Thread Brett Cannon

Brett Cannon  added the comment:

Antoine, do you think this may have been triggered by your latest patch?

--
nosy: +pitrou

___
Python tracker 

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



[issue14052] importlib mixes up '.' and os.getcwd()

2012-02-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

[...]

And I can't reproduce, even when using --randseed.

--

___
Python tracker 

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



[issue14057] Speedup sysconfig startup

2012-02-20 Thread Eric Snow

Changes by Eric Snow :


--
nosy: +eric.snow

___
Python tracker 

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



[issue14053] Make Tools/scripts/patchcheck.py compatible with mercurial mqueues.

2012-02-20 Thread Francisco Martín Brugué

Francisco Martín Brugué  added the comment:

Nice feedback !

One question :

>
>An alternative approach that solves all three of these problems is to
>check whether we have any patches applied (using "hg qapplied"), and if
>this is the case, then add "--rev qbase" to the "hg status" command
>line. This will list all files added/modified by patches as well as by
>uncommitted changes.
>

Shouldn't be --rev qparent ? with --rev qbase the first MQ patch applied 
changes are not listed ... (one wants the changes between
qparent and qtip)

--
title: Make patchcheck compatible with MQ -> Make Tools/scripts/patchcheck.py 
compatible with mercurial mqueues.

___
Python tracker 

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



[issue13447] Add tests for some scripts in Tools/scripts

2012-02-20 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +francismb
type:  -> enhancement

___
Python tracker 

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



[issue14059] Implement multiprocessing.Barrier

2012-02-20 Thread sbt

sbt  added the comment:

barrier_tests.py contains minor modifications of the unit tests for
threading.Barrier.  (The two tests using reset() are commented out.)

The implementation passes for me on Linux and Windows.

--
Added file: http://bugs.python.org/file24580/barrier_tests.py

___
Python tracker 

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



[issue14059] Implement multiprocessing.Barrier

2012-02-20 Thread sbt

sbt  added the comment:

Here is an initial implementation.  Differences from threading.Barrier:

- I have not implemented reset().

- wait() returns 0 or -1.  One thread returns 0, the remainder return -1.
  This is different to threading.Barrier where each of the N threads 
  returns a unique index in range(N).

- I added an "action_args" parameter to the constructor.  This is a tuple 
  which provides argument to the "action" callback.  (This is because closures
  are not picklable, making no-argument callbacks rather limiting for 
  multiprocessing.)

--
nosy: +sbt
Added file: http://bugs.python.org/file24579/barrier.py

___
Python tracker 

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



[issue14065] Element should support cyclic GC

2012-02-20 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
components: +Library (Lib)
nosy: +flox
stage:  -> needs patch
type:  -> behavior
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



[issue14065] Element should support cyclic GC

2012-02-20 Thread Jesús Cea Avión

Changes by Jesús Cea Avión :


--
nosy: +jcea

___
Python tracker 

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



[issue14065] Element should support cyclic GC

2012-02-20 Thread Martin v . Löwis

New submission from Martin v. Löwis :

The C implementation of xml.etree.ElementTree.Element needs to support cyclic 
GC. The attached script demonstrates the lack to support that: in 3.2, the 
script passes; in 3.3 (7697223df6df) it fails with an AssertionError as the 
cycle was not cleared. 

This is an incompatible change from 3.2.

--
files: a.py
messages: 153784
nosy: loewis
priority: normal
severity: normal
status: open
title: Element should support cyclic GC
versions: Python 3.3
Added file: http://bugs.python.org/file24578/a.py

___
Python tracker 

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



[issue14062] UTF-8 Email Subject problem

2012-02-20 Thread Martin v . Löwis

Changes by Martin v. Löwis :


--
nosy: +loewis

___
Python tracker 

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



[issue14064] collections module imported twice in urllib/parse.py

2012-02-20 Thread Bithin A

Changes by Bithin A :


Removed file: http://bugs.python.org/file24577/multiple_imports.patch

___
Python tracker 

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



[issue14064] collections module imported twice in urllib/parse.py

2012-02-20 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

This is perfectly fine the way it is. PEP 8 has nothing to say about it.

--
nosy: +benjamin.peterson
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



[issue14052] importlib mixes up '.' and os.getcwd()

2012-02-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

There was the following sporadic buildbot failure:


==
FAIL: test_package___file__ (test.test_imp.PEP3147Tests)
--
Traceback (most recent call last):
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_imp.py", 
line 333, in test_package___file__
os.sep.join(('.', 'pep3147', '__init__.py')))
AssertionError: 'pep3147/__init__.py' != './pep3147/__init__.py'
- pep3147/__init__.py
+ ./pep3147/__init__.py
? ++


I wonder if the test suite is playing games and sometimes using importlib :-/

--

___
Python tracker 

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



[issue6884] Impossible to include file in sdist that starts with 'build' on Win32

2012-02-20 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

> (2.7.2 doesn’t include neither Antoine’s changeset nor mine, right?)

Correct; it dates back to June last year, before issue 13193 was filed.


> Can you reproduce the “include buildout.cfg” bug too?

Yes, that problem is present in 2.7.2, but not in the current revision of
the 2.7 branch. In 2.7.2, the offending regex is r'^build\.*' (since
translate_pattern() uses os.path.join, and doesn't escape the separator),
whereas in 2.7-head the regex is r'^build/.*' (using a hardcoded "/").
2.7-head with your patch applied gives r'^build\\.*' (the correct value).

In this case (unlike #9691 and #14004), the problem was fixed by the
changes in issue 13193, since the offending code is in the
"if prefix is not None:" codepath of translate_pattern(), rather than in
glob_to_re().


While we're talking about translate_pattern(), I have a question about
this line:

pattern_re = "^%s/.*%s" % (prefix_re, pattern_re)

It seems that if you specify both a prefix and a (nonempty) pattern, the
resulting regexp is something like "/.*", using the
pattern argument as a suffix. Is this the intended behavior? I would have
expected something like "/(.*/)?", defaulting to
"/.*" if pattern is empty. For example, it seems wrong that
"recursive-include foo bar.*" matches foo/test_bar.py.

--

___
Python tracker 

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



[issue14064] collections module imported twice in urllib/parse.py

2012-02-20 Thread Bithin A

Changes by Bithin A :


--
type:  -> enhancement

___
Python tracker 

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



  1   2   >