[issue10240] dict.update.__doc__ is misleading

2010-10-30 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

I'm not sure that we should mention the fast path for dicts.  That is an 
implementation detail and may not be present in IronPython, PyPy, Jython, etc.

The current version includes:

  D.updated(E, **F) -- None.  Updated D for dict/iterable E and F.

ISTM that covers the semantics of what it does.  Your proposed modification 
gets into how it does it.

--
nosy: +rhettinger

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



[issue10240] dict.update.__doc__ is misleading

2010-10-30 Thread ivank

ivank b...@ludios.org added the comment:

CPython's dict(obj) ignores `keys` and `__iter__` if obj is a subclass of dict. 
 I thought this was an important language detail, not just an implementation 
quirk.  But, I just tested pypy 1.3, and it is calling .keys() on dicts.  Oh 
well.

I think the __doc__ can still be slightly improved; ignore my patch and just 
change the first E: to E.keys(): - that would be more accurate.

--

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



[issue10243] Packaged Pythons

2010-10-30 Thread Max Skaller

New submission from Max Skaller max.skal...@gmail.com:

Not sure if this is a bug or not. I am unable to find libpython.so for Python3 
on either my Mac or Ubuntu. Perhaps this is a packaging fault, however some 
documentation in the Wiki suggests otherwise. It appears the builders have 
reverted to an archaic linkage pattern which I helped to get rid of (lets see, 
perhaps a decade ago?). Python 2.6, for example, does ship a shared library.

Python must be shipped with code linked as follows, I will explain below why, 
but first the list:

1) The mainline (C main() function) must be a stub which calls the real 
mainline, which is located in libpython.

2) The mainline MUST be compiled with C++ not C.

3) All extension libraries and add-ons to Python provided as shared libraries 
must be explicitly linked against libpython.

In particular it is NOT acceptable for any extension or shared library 
component to expect to find its symbols in the host application executable as 
the Wiki documentation seems to suggest (in a section which explains a bit of a 
workaround for OSX frameworks).

Now the reason it MUST be this way. First, any C++ code which is to be linked 
into an application, either statically, dynamically at load time, or under 
program control at run time, may require certain stuff to be in place (RTTI, 
streams, exception handling stuff, or whatever) which can only be put in place 
in the initialisation of the main application. Although the details are 
platform specific, it is simply not safe to permit C++ extension modules unless 
this step is taken.

Legacy or embedded systems may have to make do with a C mainline, and systems 
which don't support dynamic loading can also do without C++ compilation 
provided the pre-loaded extensions are all C.

On most major platforms, however, a C++ driver stub is required.

The second issue is also quite simple. It is quite incorrect in a modern 
computing environment to assume an *application* will be hosting the python 
interpreter directly. It is not only possible, it is in fact the case for my 
project, that were the Python interpreter to be called, it would from a shared 
library loaded under program control at run time.

Such an interpreter cannot be loaded at all if it isn't present in a library: 
it either has to be statically linked into the shared library making the call, 
with some ugly linker switches to make sure no symbols are dropped, or it has 
to be loaded dynamically. The latter case is the only viable option if the run 
time linker is unable to share symbols to a loaded application, and even if 
that is possible and can be arranged it is not likely to work so well if 
multiple shared libraries try to do it.

Similarly, even if you managed to load it somehow, any dynamically loaded 
extensions may or may not be able to find the symbols.

The ONLY reliable way to ensure extensions can find libpython symbols is to 
link them against libpython.

In fact, the mainline application should not only contain NO libpython symbols 
specifically to disable this wrong practice and break any bad extensions that 
rely on it, it should also, as explained, contain exactly one reference to 
libpython, which calls Python with argv, argc[] as if it were the mainline.

Just as motivation here: my product is an ultra-high performance programming 
language with a special construction to allow Python C-extension modules to be 
built. Its target is usually a shared library and that library is produced by 
first generating C++ and then compiling it with your native C++ compiler.

For a generated program to call Python interpreter, it HAS to be available in a 
shared library, and for any extension modules that interpreter loads, they HAVE 
to get their symbols from that shared library, and, if the generated program is 
itself a Python module, then if that module is to be loaded from any C 
extension, including itself or some other extension, it HAS to be linked 
against libpython which HAS to be loaded dynamically by the loaded.

The unfortunate downside of this is that it is NOT POSSIBLE to have a huge 
statically linked Python executable which just loads C extensions and nothing 
else happens. If you're loading any C extensions dynamically libpython must be 
loaded dynamically too.

Just to be clear: I can easily build it the way I want it but this will not 
solve my problem, which is to support clients who wish to use my product to 
generate high performance Python callable modules which will just work out of 
the box with existing Python code. In particular, replacing some slow modules 
with optimised ones would be more or less entirely transparent .. except that 
at the moment it could only work with Python 2.x since Python 3.x shipments 
don't seem to have any shared libpython included (and I just changed my 
compiler to support Python 3 modules instead of Python 2).

--
components: Installation
messages: 119963
nosy: Max.Skaller
priority: normal

[issue6105] json.dumps doesn't respect OrderedDict's iteration order

2010-10-30 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

Backported to 2.7
See r85966

--
resolution:  - fixed
status: open - closed

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



[issue10243] Packaged Pythons

2010-10-30 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

 Python 2.6, for example, does ship a shared library.

That is not really the case. Python 2.6 ships in source form. It
builds with a libpython shared library only if you configure
with --enable-shared.

 In particular it is NOT acceptable for any extension or shared
 library component to expect to find its symbols in the host
 application executable as the Wiki documentation seems to suggest (in
 a section which explains a bit of a workaround for OSX frameworks).

I completely disagree with this evaluation. These statements are not
true in general, although they might be partially true for specific
operating systems and compilers.

 Although the details are platform specific, it is simply
 not safe to permit C++ extension modules unless this step is taken.

It certainly is safe on all platforms where Python does that,
i.e. primarily Linux, Windows, and OS X. Only archaic C++
implementations fail to support applications where main()
was not compiled with a C++ compiler.

 On most major platforms, however, a C++ driver stub is required.

That is not true.

 It is not only possible, it
 is in fact the case for my project, that were the Python interpreter
 to be called, it would from a shared library loaded under program
 control at run time.

Python supports embedding of the interpreter quite well. You can
choose between linking Python as a static (.a) or dynamic library.
If you use a static library, extension modules would still pick
up Python symbols from the executable.

 Such an interpreter cannot be loaded at all if it isn't present in a
 library: it either has to be statically linked into the shared
 library making the call, with some ugly linker switches to make sure
 no symbols are dropped, or it has to be loaded dynamically.

The Python build process will *always* create a library that embedding
applications can link against.

 For a generated program to call Python interpreter, it HAS to be
 available in a shared library, and for any extension modules that
 interpreter loads, they HAVE to get their symbols from that shared
 library, and, if the generated program is itself a Python module,
 then if that module is to be loaded from any C extension, including
 itself or some other extension, it HAS to be linked against libpython
 which HAS to be loaded dynamically by the loaded.

If that's your requirement, make sure you build against a Python
installation that was itself built with --enable-shared.

 The unfortunate downside of this is that it is NOT POSSIBLE to have a
 huge statically linked Python executable which just loads C
 extensions and nothing else happens. If you're loading any C
 extensions dynamically libpython must be loaded dynamically too.

That depends on the operating system. On Linux, it would be possible
to link the entire Python interpreter in your language's shared library,
and extension modules would still find their symbols.

 Just to be clear: I can easily build it the way I want it but this
 will not solve my problem, which is to support clients who wish to
 use my product to generate high performance Python callable modules
 which will just work out of the box with existing Python code. In
 particular, replacing some slow modules with optimised ones would be
 more or less entirely transparent .. except that at the moment it
 could only work with Python 2.x since Python 3.x shipments don't seem
 to have any shared libpython included (and I just changed my compiler
 to support Python 3 modules instead of Python 2).

One solution could be to ship libpythonXY.so yourself, along with your
the rest of the binaries that you provide. Or else do as I propose
above: link the Python interpreter statically into your shared library.

I fail to see the bug in this report.

--
nosy: +loewis

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



[issue10221] {}.pop('a') raises non-standard KeyError exception

2010-10-30 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

See r85967, r85968 and r85969.

--
resolution:  - fixed
status: open - closed

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



[issue10224] Build 3.x documentation using python3.x

2010-10-30 Thread Zbyszek Szmek

Changes by Zbyszek Szmek zbys...@in.waw.pl:


--
nosy: +zbysz

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



[issue10220] Make generator state easier to introspect

2010-10-30 Thread Zbyszek Szmek

Changes by Zbyszek Szmek zbys...@in.waw.pl:


--
nosy: +zbysz

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



[issue10244] PEP100 has broken links

2010-10-30 Thread Maciej Fijalkowski

New submission from Maciej Fijalkowski fij...@gmail.com:

PEP100 (http://www.python.org/dev/peps/pep-0100/) links to python starship. 
Should it just link to python.org for the newest version of this doc?

--
assignee: d...@python
components: Documentation
messages: 119967
nosy: d...@python, fijall
priority: normal
severity: normal
status: open
title: PEP100 has broken links

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



[issue10244] PEP100 has broken links

2010-10-30 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

Why do you say that the link is broken?

--
nosy: +loewis

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



[issue10244] PEP100 has broken links

2010-10-30 Thread Maciej Fijalkowski

Maciej Fijalkowski fij...@gmail.com added the comment:

Python starship is down, I thought it's permanently down, isn't it?

--

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



[issue10244] PEP100 has broken links

2010-10-30 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

The link works fine for me right now, and the starship is alive and well.

--

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



[issue10244] PEP100 has broken links

2010-10-30 Thread Maciej Fijalkowski

Maciej Fijalkowski fij...@gmail.com added the comment:

That is really weird, it definitely doesn't for me. Anyway, closing the ticket 
then.

--
status: open - closed

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




[issue10244] PEP100 has broken links

2010-10-30 Thread Georg Brandl

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

Well, obviously only the first link works (does for me too), the second needs 
to have a version filled in :)

--
nosy: +georg.brandl

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



[issue10244] PEP100 has broken links

2010-10-30 Thread Marc-Andre Lemburg

Marc-Andre Lemburg m...@egenix.com added the comment:

Maciej Fijalkowski wrote:
 
 New submission from Maciej Fijalkowski fij...@gmail.com:
 
 PEP100 (http://www.python.org/dev/peps/pep-0100/) links to python starship. 
 Should it just link to python.org for the newest version of this doc?

The starship link works for me (starship just moved to a new server,
so it'll take a while before the DNS changes propogate).

Note that the proposal was moved into the PEP list after we introduced
PEPs - the proposal itself predates PEPs as we have them now. The link
to the older versions are just there for historic reasons.

--
nosy: +lemburg

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



[issue10245] Fix resource warnings in test_telnetlib

2010-10-30 Thread Brian Brazil

New submission from Brian Brazil brian.bra...@gmail.com:

Please see attached patch and closing files and sockets in a timely manner in 
the stdlib on python-dev.

--
components: Tests
files: test_telnetlib_fd_leak.patch
keywords: patch
messages: 119974
nosy: bbrazil, brett.cannon
priority: normal
severity: normal
status: open
title: Fix resource warnings in test_telnetlib
versions: Python 3.3
Added file: http://bugs.python.org/file19424/test_telnetlib_fd_leak.patch

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



[issue10246] uu.encode fd leak if arguments are filenames

2010-10-30 Thread Brian Brazil

New submission from Brian Brazil brian.bra...@gmail.com:

Please see attached patch, I'm not sure if this is the cleanest way to fix 
this. This also fixes the resource warnings in the test.

--
components: Library (Lib)
files: uu_fd_leak.patch
keywords: patch
messages: 119975
nosy: bbrazil, brett.cannon
priority: normal
severity: normal
status: open
title: uu.encode fd leak if arguments are filenames
versions: Python 3.3
Added file: http://bugs.python.org/file19425/uu_fd_leak.patch

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



[issue10246] uu.encode fd leak if arguments are filenames

2010-10-30 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

I think there should be a try..finally block so that those files get closed 
even when there's an error in-between.

--
nosy: +pitrou

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



[issue10246] uu.encode fd leak if arguments are filenames

2010-10-30 Thread Brian Brazil

Brian Brazil brian.bra...@gmail.com added the comment:

How does v2 look?

--
Added file: http://bugs.python.org/file19426/uu_fd_leak_v2.patch

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



[issue10240] dict.update.__doc__ is misleading

2010-10-30 Thread R. David Murray

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

Maybe the fastpath should do a strict check and not be used for subclasses of 
dict?

--
nosy: +r.david.murray

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




[issue10246] uu.encode fd leak if arguments are filenames

2010-10-30 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 How does v2 look?

Nice, thank you!

--

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



[issue10237] failure in Barrier tests

2010-10-30 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

I also get a failure here:

==
FAIL: test_default_timeout (test.test_threading.BarrierTests)
--
Traceback (most recent call last):
  File /home/antoine/py3k/__svn__/Lib/test/lock_tests.py, line 784, in 
test_default_timeout
self.run_threads(f)
  File /home/antoine/py3k/__svn__/Lib/test/lock_tests.py, line 615, in 
run_threads
f()
  File /home/antoine/py3k/__svn__/Lib/test/lock_tests.py, line 783, in f
self.assertRaises(threading.BrokenBarrierError, self.barrier.wait)
AssertionError: BrokenBarrierError not raised by wait

--

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



[issue10247] mold builder

2010-10-30 Thread Lorenz Quack

New submission from Lorenz Quack d...@amberfisharts.com:

RV Plastics is your end to end partner for all your moulds and Injection 
Moulding requirements. 

Founded in 2003, RV Plastics dedicates itself to the plastic industry, 
exporting 
Plastic injection moulds and molded Components to customers spread over 20 
countries. 
We offer mould design  development services for plastic house ware, 
electrical, automobile and industrial products. 
We produce high quality moulds at attractive prices.

Tel: 86-769-8997 5802
Fax: 86-769-8458 5238
Web: www(dot)rvmold(dot)com
E-mail: rvmold(at)hotmail(dot)com / sales(at)rvmold(dot)com

--
messages: 119981
nosy: donlorenzo
priority: normal
severity: normal
status: open
title: mold builder

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



[issue10246] uu.encode fd leak if arguments are filenames

2010-10-30 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Committed in r85975 (3.2). I guess we'll do a big svnmerge to other branches 
later.

--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
versions: +Python 3.2 -Python 3.3

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



[issue10248] Fix resource warnings in test_xmlrpclib

2010-10-30 Thread Brian Brazil

New submission from Brian Brazil brian.bra...@gmail.com:

I'm not 100% comfortable with this patch as my knowledge of the xmlrpc 
interface is very limited, a simple p.close() would seem cleaner - but that 
doesn't work.

--
files: test_xmlrpclib_fd_leak.patch
keywords: patch
messages: 119983
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Fix resource warnings in test_xmlrpclib
Added file: http://bugs.python.org/file19427/test_xmlrpclib_fd_leak.patch

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



[issue10249] Fix resource warnings in test_unicodedata

2010-10-30 Thread Brian Brazil

New submission from Brian Brazil brian.bra...@gmail.com:

Please see attached.

--
components: Library (Lib)
files: test_unicodedata_fd_leak.patch
keywords: patch
messages: 119984
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Fix resource warnings in test_unicodedata
versions: Python 3.3
Added file: http://bugs.python.org/file19428/test_unicodedata_fd_leak.patch

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



[issue10250] Fix resource warnings in test_urllib2_localnet

2010-10-30 Thread Brian Brazil

New submission from Brian Brazil brian.bra...@gmail.com:

Please see attached, not sure this is quite right.

--
components: Tests
files: test_urllib2_localnet_fd_leak.patch
keywords: patch
messages: 119985
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Fix resource warnings in test_urllib2_localnet
versions: Python 3.3
Added file: http://bugs.python.org/file19429/test_urllib2_localnet_fd_leak.patch

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



[issue10248] Fix resource warnings in test_xmlrpclib

2010-10-30 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +loewis
stage:  - patch review
type:  - resource usage
versions: +Python 3.2

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



[issue10250] Fix resource warnings in test_urllib2_localnet

2010-10-30 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +orsenthil
stage:  - patch review
type:  - resource usage
versions: +Python 3.2 -Python 3.3

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



[issue10247] mold builder

2010-10-30 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
Removed message: http://bugs.python.org/msg119981

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



[issue10247] mold builder

2010-10-30 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy:  -donlorenzo
resolution:  - invalid
status: open - closed

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



[issue9340] argparse parse_known_args does not work with subparsers

2010-10-30 Thread R. David Murray

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

I've looked over this patch, and it seems to me that there is no compelling 
reason to create two new functions.  I think it would be clearer to just inline 
that code in the places it is used.  If it turns out later that the code needs 
to be reused elsewhere, it can be factored out at that time.  (Also, as it 
stands the methods are being made part of the public API, and that doesn't look 
right to me.)

Catherine, if you'd like to update the patch that would be great.  Otherwise we 
will hopefully get to it during the upcoming bug weekend.

--
nosy: +r.david.murray

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



[issue9340] argparse parse_known_args does not work with subparsers

2010-10-30 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
stage: needs patch - patch review
versions: +Python 3.1 -Python 3.3

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



[issue10251] Fix resource warnings in test_file

2010-10-30 Thread Brian Brazil

New submission from Brian Brazil brian.bra...@gmail.com:

Please see attached.

--
components: Tests
files: test_file_fd_leak.patch
keywords: patch
messages: 119987
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Fix resource warnings in test_file
versions: Python 3.3
Added file: http://bugs.python.org/file19430/test_file_fd_leak.patch

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



[issue10252] Fix resource warnings in distutil tests

2010-10-30 Thread Brian Brazil

New submission from Brian Brazil brian.bra...@gmail.com:

Please see attached.

--
assignee: tarek
components: Distutils
files: distutils_fd_leak.patch
keywords: patch
messages: 119988
nosy: bbrazil, eric.araujo, tarek
priority: normal
severity: normal
status: open
title: Fix resource warnings in distutil tests
versions: Python 3.3
Added file: http://bugs.python.org/file19431/distutils_fd_leak.patch

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



[issue10251] Fix resource warnings in test_file

2010-10-30 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Committed in r85977, thanks.

--
nosy: +pitrou
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
versions: +Python 3.2 -Python 3.3

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



[issue10249] Fix resource warnings in test_unicodedata

2010-10-30 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Fixed in r85978, thank you.

--
nosy: +pitrou
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
versions: +Python 3.2 -Python 3.3

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



[issue10252] Fix resource warnings in distutil tests

2010-10-30 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
stage:  - patch review
type:  - resource usage
versions: +Python 3.2 -Python 3.3

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



[issue10226] urlparse example is wrong

2010-10-30 Thread R. David Murray

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

How about this:

-  If the scheme value is not specified, urlparse following the syntax
-  specifications from RFC 1808, expects the netloc value to start with '//',
-  Otherwise, it is not possible to distinguish between net_loc and path
-  component and would classify the indistinguishable component as path as in
-  a relative url.

+  Following the syntax specifications in RFC 1808, urlparse recognizes
+  a netloc only if it is properly introduced by '//'.  Otherwise the
+  input must be presumed to be a relative URL and thus to start with
+  a path component.


However, it seems to me there is a bug here:

 urlparse.urlparse('www.k.com:80/path')
ParseResult(scheme='', netloc='', path='www.k.com:80/path', params='',
query='', fragment='')
 urlparse.urlparse('www.k.com:path')
ParseResult(scheme='www.k.com', netloc='', path='path', params='',
query='', fragment='')

I think the second one is correct and that the first one should produce

ParseResult(scheme='www.k.com', netloc='', path='80/path', params='',
query='', fragment='')

I haven't read all the way through the RFC again, though.  But *one*
of the above is wrong.

--
nosy: +r.david.murray

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



[issue10253] Fix fd leak in fileio.c and test resource warnings

2010-10-30 Thread Brian Brazil

New submission from Brian Brazil brian.bra...@gmail.com:

fileio_init will leak a fd if you open a file for append that isn't seekable. 
We should close this fd before returning the failure.

The attached patch fixes this and a resource warning in the tests, but I'm 
unsure if it'd be better to use internal_close. I'd want the error from the 
seek rather than any potential error from the close, so I think this is okay.

Regrtest is happy.

--
components: IO
files: fileio_fd_leak.patch
keywords: patch
messages: 119992
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Fix fd leak in fileio.c and test resource warnings
versions: Python 3.3
Added file: http://bugs.python.org/file19432/fileio_fd_leak.patch

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



[issue10253] Fix fd leak in fileio.c and test resource warnings

2010-10-30 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +amaury.forgeotdarc, benjamin.peterson
stage:  - patch review
type:  - resource usage
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 3.3

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



[issue10253] Fix fd leak in fileio.c and test resource warnings

2010-10-30 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

It should be closed only if closefd is true.
Does it fix a warning in the test suite? Otherwise I think it would need its 
own test.

--
nosy: +pitrou

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



[issue1346238] A constant folding optimization pass for the AST

2010-10-30 Thread Dave Malcolm

Changes by Dave Malcolm dmalc...@redhat.com:


--
nosy: +dmalcolm

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



[issue10253] Fix fd leak in fileio.c and test resource warnings

2010-10-30 Thread Brian Brazil

Brian Brazil brian.bra...@gmail.com added the comment:

Version 2 of the patch is attached.

This fixes a warning at line 256 in test_fileio.py:
f = _FileIO(/dev/tty, a)
on my Hardy machine.

--
Added file: http://bugs.python.org/file19433/fileio_fd_leak_v2.patch

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



[issue10254] unicodedata.normalize('NFC', s) regression

2010-10-30 Thread Merlijn van Deen

New submission from Merlijn van Deen valhall...@gmail.com:

Summary: Somewhere between 2.6.5 r79063 and 3.1 r79147 a regression in the 
unicode NFC normalization has been introduces. This regression leads to bot 
edit wars on wikipedia [1]. It is reproducable with a simple script [2]. 
Mediawiki/PHP [3] and C# [4] test scripts both show the old behaviour, which 
leads me to believe this is a python bug.
A search for older bugs shows bug #1054943 [5] which has commits in the 
suspected region.

The regression causes certain NFC-normalized strings to become mangled. Because 
of the wide range of unicode strings on wikipedia, this causes several 
problems. Details of those can be found at [1].

Example strings include: (these strings have been NFC-normalized by mediawiki)
 * u'Li\u030dt-s\u1e73\u0301'
 * u'\u092e\u093e\u0930\u094d\u0915 
\u091c\u093c\u0941\u0915\u0947\u0930\u092c\u0930\u094d\u0917'
 * 
u'\u0915\u093f\u0930\u094d\u0917\u093f\u091c\u093c\u0938\u094d\u0924\u093e\u0928'

The bug can be shown simply with
unicodedata.normalize('NFC', s) == s
where s is one of the strings above. This will return True on older python 
versions, False on newer versions. There is a script available that does this 
[2].

The bug has been tested on the following machines and python versions. OK 
indicates the bug is not present, FAIL indicates the bug is present.

Host: SunOS willow 5.10 Generic_142910-17 i86pc i386 i86pc Solaris
'2.3.3 (#1, Dec 16 2004, 14:38:56) [C]' OK
'2.6.5 (r265:79063, Jul 10 2010, 17:50:38) [C]' OK
'2.7 (r27:82500, Aug  5 2010, 04:28:45) [C]' FAIL
'3.1.2 (r312:79147, Sep 24 2010, 05:34:04) [C]' FAIL

Host: Linux nightshade 2.6.26-2-amd64 #1 SMP Thu Sep 16 15:56:38 UTC 2010 
x86_64 GNU/Linux
'2.4.6 (#2, Jan 24 2010, 12:20:41) \n[GCC 4.3.2]' OK
'2.5.2 (r252:60911, Jan 24 2010, 17:44:40) \n[GCC 4.3.2]' OK
'2.6.4+ (r264:75706, Feb 16 2010, 05:11:28) \n[GCC 4.4.3]' OK

Host: Linux dorthonion 2.6.22.18-co-0.7.4 #1 PREEMPT Wed Apr 15 18:57:39 UTC 
2009 i686 GNU/Linux
'2.5.4 (r254:67916, Jan 20 2010, 21:44:03) \n[GCC 4.3.3]' OK
'2.6.2 (release26-maint, Apr 19 2009, 01:56:41) \n[GCC 4.3.3]' OK
'3.0.1+ (r301:69556, Apr 15 2009, 15:59:22) \n[GCC 4.3.3]' OK

[1] 
https://sourceforge.net/tracker/index.php?func=detailaid=3081100group_id=93107atid=603138#
 ; 
http://fr.wikipedia.org/w/index.php?title=Mark_Zuckerbergaction=historysubmitdiff=57753004oldid=57751674
[2] http://pastebin.ca/1977285 (py2.x), http://pastebin.ca/1977287 (py3.x)
[3] http://pastebin.ca/1977292 (PHP, placed in 
http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/normal/), 
[4] http://pastebin.ca/1977261 (C#)
[5] http://bugs.python.org/issue1054943#

--
components: Unicode
messages: 119995
nosy: valhallasw
priority: normal
severity: normal
status: open
title: unicodedata.normalize('NFC', s) regression
type: behavior
versions: Python 2.7, Python 3.1

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



[issue10254] unicodedata.normalize('NFC', s) regression

2010-10-30 Thread Merlijn van Deen

Merlijn van Deen valhall...@gmail.com added the comment:

Please note: The bug might very well be present in python 3.2 and 3.3. However, 
I do not have these versions installed, so I cannot confirm this.

--

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



[issue10157] Refleaks in pythonrun.c

2010-10-30 Thread Hirokazu Yamamoto

Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment:

Thank you, I committed your patch in r85980(py3k) and
r85981(release31-maint).

--
assignee: ocean-city - 
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed
versions: +Python 3.1

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



[issue10254] unicodedata.normalize('NFC', s) regression

2010-10-30 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Confirmed on Python 3.2.

--
nosy: +haypo, loewis, pitrou
versions: +Python 3.2

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



[issue10164] Add an assertBytesEqual to unittest and use it for bytes assertEqual

2010-10-30 Thread Raymond Hettinger

Changes by Raymond Hettinger rhettin...@users.sourceforge.net:


--
assignee:  - rhettinger
nosy: +rhettinger
priority: normal - low

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



[issue1346238] A constant folding optimization pass for the AST

2010-10-30 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


--
nosy:  -georg.brandl, georg.brandl

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



[issue10253] Fix fd leak in fileio.c and test resource warnings

2010-10-30 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Committed in r85982, thank you. I will backport later.

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

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



[issue10093] Warn when files are not explicitly closed

2010-10-30 Thread R. David Murray

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

MAL wrote:
 Antoine wrote:
 MAL wrote:
 I don't follow you. Where's the difference between writing:

 s.close()
 or
 s = None

 for an open socket s ?
 
 The difference is when s is still referenced elsewhere.
 Also, the intent of the former is clear while the latter is deliberately
 obscure (while not saving any significant amount of typing).

Sure, but that's not the point. It is not a mistake to write
such code and neither is this obscure, otherwise we'd also
require explicit garbage collection for other parts of Python.

Yes it is a mistake:

In an earlier message MAL wrote:
 The only difference is with Python implementations that don't
 use synchronous garbage collection, e.g. Jython, but not with
 CPython.

This by definition makes it non-equivalent and a bad *Python* idiom,
since it depends on an acknowledged CPython *implementation detail*.
As far as I know, there is no language requirement that mandates having
garbage collection at all.

--
nosy: +r.david.murray

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



[issue10238] ctypes not building under OS X 10.6 with LLVM/Clang 2.8

2010-10-30 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Not sure this is a blocker. There are various assembler syntaxes for x86 and 
chances are LLVM uses a different one from gcc.

--
assignee:  - theller
nosy: +georg.brandl, pitrou, theller

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



[issue6706] asyncore's accept() is broken

2010-10-30 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue10236] Sporadic failures of test_ssl

2010-10-30 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

The errno printed here is just an error which is expected and tested for. The 
verbose run was ok, it's the silent run just before which produced an error (or 
several), but unfortunately:

test test_ssl failed -- multiple errors occurred; run in verbose mode for 
details

That said, it is likely to be related to a transient failure of a remote host 
used for testing.

--
nosy: +pitrou

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



[issue6706] asyncore's accept() is broken

2010-10-30 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com added the comment:

CVE-2010-3492 references this issue.
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-3492

--

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



[issue10238] ctypes not building under OS X 10.6 with LLVM/Clang 2.8

2010-10-30 Thread Georg Brandl

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

I agree, this shouldn't be a blocker.

--
priority: deferred blocker - critical

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



[issue10250] Fix resource warnings in test_urllib2_localnet

2010-10-30 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Committed in r85983, thank you.

--
nosy: +pitrou
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

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



[issue10245] Fix resource warnings in test_telnetlib

2010-10-30 Thread Jack Diederich

Changes by Jack Diederich jackd...@gmail.com:


--
assignee:  - jackdied
nosy: +jackdied
versions: +Python 3.2 -Python 3.3

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



[issue10160] operator.attrgetter slower than lambda after adding dotted names ability

2010-10-30 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Some comments about the patch:
- this seems to be some dead code:

 if (nattrs = 1) {
 if (!PyArg_UnpackTuple(args, attrgetter, 1, 1, attr))
 return NULL;

- you can't call PyUnicode_GET_SIZE or PyUnicode_AS_UNICODE before you have 
called PyUnicode_Check. If the object is not an unicode object, it triggers an 
assertion in debug mode:
python: ./Modules/operator.c:404: attrgetter_new: Assertion 
`((PyObject*)(item))-ob_type))-tp_flags  ((1L28))) != 0)' failed.

- you should also call PyUnicode_InternInPlace() on the last dotless name 
(after the for loop)

- this comment looks false:
  /* attrgetter_new code should ensure we never come here */

- in dotted_getattr, when attr is a tuple, you leak references to intermediate 
objects (because you don't decref obj before doing newobj = obj)


Other than that, looks quite worthwhile.

--
nosy: +pitrou

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



[issue10060] python.exe crashes or hangs on help() modules when bad modules found

2010-10-30 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

Éric, go ahead and consolidate to one issue if you can get to it.
Do the other issues shows problems with 3.1 or 3.2 also? I wonder because I 
have never seen the box in the posted .png and wonder if that is a new 
'feature' with 2.7 and possibly 3.2 that was not in 3.1 and possibly the cause. 
Has anyone posted a 'corrupt module' that reliably reproduces the problem? It 
is hard to investigate when 'help modules' works just fine, as it does on my 
3.1.2 install.

'Dev': your original post is way too long. The welcome message and module lists 
could have been snipped to one line plus ellipsis. Example:

 help()

Welcome 
[snip]

help modules

Please wait
[snip]

and continue with traceback.

--

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



[issue10255] refleak in initstdio

2010-10-30 Thread Neil Schemenauer

New submission from Neil Schemenauer nas-pyt...@arctrix.com:

It looks to me like initstdio leaks a reference to open.  AFAIK, 
PyObject_SetAttrString() does not steal a reference.

--
assignee: pitrou
components: Interpreter Core
files: initstdio_refleak.txt
messages: 120008
nosy: nascheme, pitrou
priority: normal
severity: normal
status: open
title: refleak in initstdio
type: resource usage
Added file: http://bugs.python.org/file19434/initstdio_refleak.txt

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



[issue10255] refleak in initstdio

2010-10-30 Thread Georg Brandl

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

LGTM.

--
nosy: +georg.brandl

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



[issue9981] let make_buildinfo use a temporary directory on windows

2010-10-30 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

Is there a reason this removes the Release x64 configuration?

--
nosy: +brian.curtin

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



[issue9981] let make_buildinfo use a temporary directory on windows

2010-10-30 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

Let me rephrase that: What makes the Release x64 configuration unnecessary, 
thus removed?

--

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



[issue10237] failure in Barrier tests

2010-10-30 Thread Stephen Hansen

Stephen Hansen me+pyt...@ixokai.io added the comment:

FWIW, my snow leopard slave isn't slow at all so I doubt there's a timeout 
related to machine speed going on here, as its failing thus:

test test_threading failed -- Traceback (most recent call last):
  File 
/Users/pythonbuildbot/buildarea/3.x.hansen-osx-x86/build/Lib/test/lock_tests.py,
 line 784, in test_default_timeout
self.run_threads(f)
  File 
/Users/pythonbuildbot/buildarea/3.x.hansen-osx-x86/build/Lib/test/lock_tests.py,
 line 615, in run_threads
f()
  File 
/Users/pythonbuildbot/buildarea/3.x.hansen-osx-x86/build/Lib/test/lock_tests.py,
 line 783, in f
self.assertRaises(threading.BrokenBarrierError, self.barrier.wait)
AssertionError: BrokenBarrierError not raised by wait

Its actually a really spammy sort of failure with a lot of errors before it, 
which may or may not shed more light on the situation: 
http://www.python.org/dev//buildbot/3.x.stable/builders/x86%20Snow%20Leopard%203.x/builds/267/steps/test/logs/stdio

This was r85883, so after the increase in the timeout.

--
nosy: +ixokai

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



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-10-30 Thread Matthew Barnett

Matthew Barnett pyt...@mrabarnett.plus.com added the comment:

issue2636-20101030a.zip is a new version of the regex module.

This bug was a bit more difficult to fix, but I think it's OK now!

--
Added file: http://bugs.python.org/file19435/issue2636-20101030a.zip

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



[issue10256] Fix resource warnings in test_pkgimport

2010-10-30 Thread Brian Brazil

New submission from Brian Brazil brian.bra...@gmail.com:

Please see attached patch.

--
components: Tests
files: test_pkgimport_fd_leak.patch
keywords: patch
messages: 120014
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Fix resource warnings in test_pkgimport
versions: Python 3.3
Added file: http://bugs.python.org/file19436/test_pkgimport_fd_leak.patch

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



[issue10257] Fix resource warnings in test_os

2010-10-30 Thread Brian Brazil

New submission from Brian Brazil brian.bra...@gmail.com:

Please see attached.

--
components: Tests
files: test_os_fd_leak.patch
keywords: patch
messages: 120015
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Fix resource warnings in test_os
versions: Python 3.3
Added file: http://bugs.python.org/file19437/test_os_fd_leak.patch

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



[issue10257] Fix resource warnings in test_os

2010-10-30 Thread Brian Brazil

Brian Brazil brian.bra...@gmail.com added the comment:

I'm used to a slightly different style guide, v2 has the right indentation.

--
Added file: http://bugs.python.org/file19438/test_os_fd_leak_v2.patch

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



[issue10257] Fix resource warnings in test_os

2010-10-30 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

I don’t see any difference :)

--
nosy: +eric.araujo

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



[issue10254] unicodedata.normalize('NFC', s) regression

2010-10-30 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

The change from issue1054943 is indeed bogus. As written, the code will happily 
run over starters, even though a blocked start means that subsequent characters 
can't possibly be combinable. That way, the code manages to combine, in 
'Li\u030dt-s\u1e73\u0301', the final U+0301 with the i - even though there are 
several starters in-between.

I think the code should work like this:

if comb!=0 and comb1==0:
  #starter after character with higher class:
  # not combinable, and all subsequent characters will be blocked
  # as well
  break
if comb!=0 and comb1==comb:
  # blocked combining character, continue searching
  i1++
  continue
# candidate pair, check whether *i and *i1 are combinable

It's unfortunate that the patch had been backported to 2.6.6; we can't fix it 
there anymore.

--

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



[issue10258] Fix resource warnings in distutil test_tokenize

2010-10-30 Thread Brian Brazil

New submission from Brian Brazil brian.bra...@gmail.com:

Please see attached patch.

--
components: Tests
files: test_tokenize_fd_leak.patch
keywords: patch
messages: 120019
nosy: bbrazil
priority: normal
severity: normal
status: open
title: Fix resource warnings in distutil test_tokenize
versions: Python 3.3
Added file: http://bugs.python.org/file19439/test_tokenize_fd_leak.patch

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



[issue10256] Fix resource warnings in test_pkgimport

2010-10-30 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

Fixed in r85984. Thanks.

--
assignee:  - brian.curtin
nosy: +brian.curtin
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
type:  - resource usage
versions: +Python 3.2 -Python 3.3

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



[issue9981] let make_buildinfo use a temporary directory on windows

2010-10-30 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

make_buildinfo is always built and run as a 32-bit binary, so I think this part 
of the change is fine (though unrelated to the objective of the change).

I think the patch is fine.

--

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



[issue10257] Fix resource warnings in test_os

2010-10-30 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

Fixed in r85987. Made both places hunks of the patch use the context manager.

--
assignee:  - brian.curtin
nosy: +brian.curtin
resolution:  - fixed
stage:  - committed/rejected
type:  - resource usage
versions: +Python 3.2 -Python 3.3

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



[issue10257] Fix resource warnings in test_os

2010-10-30 Thread Brian Curtin

Changes by Brian Curtin cur...@acm.org:


--
status: open - closed

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



[issue10160] operator.attrgetter slower than lambda after adding dotted names ability

2010-10-30 Thread Christos Georgi ou

Χρήστος Γεωργίου (Christos Georgiou) t...@users.sourceforge.net added the 
comment:

Thank you very much, Antoine, for your review. My comments in reply:

- the dead code: it's not dead, IIRC it ensures that at least one argument is 
given, otherwise it raises an exception.

- PyUnicode_GET_SIZE: you're right. The previous patch didn't have this 
problem, because there were two loops: the first one made sure in advance that 
all arguments are PyUnicode.

- the false comment: right again. A remain from the first patch.

- dotted_getattr and references: right! I should have noted better what 
Raymond's initial loop did.

Attached a corrected version of the patch according to Antoine's comments.

--
Added file: http://bugs.python.org/file19440/issue10160.diff

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



[issue10258] Fix resource warnings in distutil test_tokenize

2010-10-30 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

Fixed in r85990. Thanks.

--
assignee:  - brian.curtin
nosy: +brian.curtin
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
type:  - resource usage
versions: +Python 3.2 -Python 3.3

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



[issue7061] Improve 24.5. turtle doc

2010-10-30 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

On initialization: the json doc has 6 examples. Each starts with 'import json' 
so each is independent. However, I agree that doing the same for turtle 
examples would be a bit much. On the other hand, I think
24.5.3. *Methods of RawTurtle/Turtle and corresponding functions*
should explicitly give the needed code. So I would change Most of the examples 
in this section refer to a Turtle instance called turtle. to

The examples below that refer to a Turtle instance called turtle require 
something like the following to be run first:

 from turtle import turtle; turtle = Turtle()


The three examples above turtle.shapetransform start with
 turtle.reset()
I presume they need that to run reliably. If it is also needed for the 
shapetransform example to run correctly, then I would just added it there too.

I will post more after I compare my original post to your revision.

--

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



[issue10254] unicodedata.normalize('NFC', s) regression

2010-10-30 Thread Marc-Andre Lemburg

Marc-Andre Lemburg m...@egenix.com added the comment:

Martin v. Löwis wrote:
 It's unfortunate that the patch had been backported to 2.6.6; we can't fix it 
 there anymore.

Why not ? It looks a lot like a security fix.

--
nosy: +lemburg

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



[issue10254] unicodedata.normalize('NFC', s) regression

2010-10-30 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

 It's unfortunate that the patch had been backported to 2.6.6; we can't fix 
 it there anymore.
 
 Why not ? It looks a lot like a security fix.

Indeed, you could argue that. It's up to the 2.6 release manager, I guess.

--

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



[issue7061] Improve 24.5. turtle doc

2010-10-30 Thread Terry J. Reedy

Terry J. Reedy tjre...@udel.edu added the comment:

GREGOR, I think we need your help to answer a few of these.

Subissues from my opening post not resolved in rev85732


version of python installed with Tk support.: cap 'python' to 'Python'

Is there any standard on capitalizing 'Python'?
---

24.5.3.1. Turtle motion

?? distance units? pixel or world, depending on mode?
presume yes, but should say something here.
--

I said
'''
turtle.onclick(fun, btn=1, add=None) 
It seems that 'add=False' would be same as 'add=None' and more
consistent with below.
add – True or False – if True, a new binding will be added, otherwise
it will replace a former binding 
'''

In declining to make a change, you said

The add argument is passed unchanged to canvas' bind method which is documented 
as taking either '' or '+' string:

However, naive users are not supposed to know that, which is why you moved 
turtle doc out of tk chapter. Anyway, one has to know or guess to look for the 
doc on the generic widget bind method.

There still remains a discrepancy between signature and following doc. If you 
do not want to change the signature, change the doc. Anyway, the sentence needs 
to be expanded so it makes sense without reading the generic tkinter bind doc. 

add – True, False, or None - if True, add the new binding to any that already 
exist, otherwise replace all former bindings with the new one.

Same change is needed for onrelease and ondrag
--

You changed the title Excursus about the use of compound shapes to Compound 
shapes but did not, as far as I can see, make the same change in the reference 
in *24.5.5. The public classes of the module turtle* after
addcomponent(poly, fill, outline=None)

Also, the above should actually be
class turtle.addcomponent(poly, fill, outline=None)
to be consistent with the other entries

'''
24.5.4. Methods of TurtleScreen/Screen and corresponding functions
Most of the examples in this section refer to a TurtleScreen instance
called screen.

However, 
24.5.4.1. Window control
turtle.bgcolor(*args) 

and so on throughout the section.
??  I presume that should be 
screen.bgcolor(*args) and so on throughout the section.
'''
Not addressed as far as I can see.


.delay vs. speed is #10170

'''
Remark: in order to be able to register key-events, TurtleScreen must
have the focus. (See method listen().
 def f():
... fd(50)
... lt(60)
...
 screen.onkey(f, Up)
 screen.listen()

From the Remark, I expected the two calls to be in the opposite order.
Ditto for .onkeypress()
'''
Since the .listen doc says Set focus on TurtleScreen (in order to collect 
key-events). , I strongly suspect that 'register' in the remark should be 
changed to 'collect', 'capture', or 'respond to' for both onkeypress and 
onkeyrelease. Then the example is correct.
---

The last 3 sub-issues are still open
'''
24.5.4.5. Settings and special methods

?? .mode: 'world' like standard or logo w/r/t angles?
'''
'''
24.5.4.6. Methods specific to Screen, not inherited from TurtleScreen
turtle.exitonclick() 
Bind bye() method to mouse clicks on the Screen.

If the value “using_IDLE” in the configuration dictionary is False
(default value), also enter mainloop. Remark: If IDLE with the -n switch
(no subprocess) is used, this value should be set to True in turtle.cfg.
In this case IDLE’s own mainloop is active also for the client script.

From Windows shortcut, I cannot tell how IDLE is started, but seems to
work. Anything need to be said re IDLE/turtle on windows?

My guess is that IDLE is running normally (without -n), so that there is
a subprocess, so that 'using_IDLE' is False even though I am using it,
just not in the same process.  Correct?
'''
'''
24.5.8. Changes since Python 2.6

Sections about 2.x changes should not be in 3.x docs.
'''
---
Thanks for the other half that are fixed!

--

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



[issue7061] Improve 24.5. turtle doc

2010-10-30 Thread Alexander Belopolsky

Alexander Belopolsky belopol...@users.sourceforge.net added the comment:

On Sat, Oct 30, 2010 at 8:27 PM, Terry J. Reedy rep...@bugs.python.org wrote:
..
 version of python installed with Tk support.: cap 'python' to 'Python'

 Is there any standard on capitalizing 'Python'?

It looks like it is consistently capitalized in the Python manual.

 ---

 24.5.3.1. Turtle motion

 ?? distance units? pixel or world, depending on mode?
 presume yes, but should say something here.
 --

I would just use distance units and angle units throughout the
documentation and explain somewhere how the settings determine the
units.

..
 There still remains a discrepancy between signature and following doc. If you 
 do not want to change the signature, change the doc. Anyway, the sentence 
 needs to be expanded so it makes sense without reading the generic tkinter 
 bind doc.

 add – True, False, or None - if True, add the new binding to any that 
 already exist, otherwise replace all former bindings with the new one.

I would rather change the default to False in both documentation and
the code, but let's hear from Gregor first.


 Same change is needed for onrelease and ondrag
 --

 You changed the title Excursus about the use of compound shapes to 
 Compound shapes but did not, as far as I can see, make the same change in 
 the reference in *24.5.5. The public classes of the module turtle* after
 addcomponent(poly, fill, outline=None)

I missed that.  I'll rename that section to Public classes.


 Also, the above should actually be
 class turtle.addcomponent(poly, fill, outline=None)
 to be consistent with the other entries

I am not sure what you mean.  AFAICT, addcomponent is a method and
correctly marked as such.

..
 and so on throughout the section.
 ??  I presume that should be
 screen.bgcolor(*args) and so on throughout the section.
 '''
 Not addressed as far as I can see.

I cannot find turtle.bgcolor.  Can you post a patch with what you
want to change?

[skipped issues for which I would appreciate Gregor's input]

 ---
 Thanks for the other half that are fixed!

I thought I did better than that.

--

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



[issue10259] Entry text not set if both 'Font' and 'fg' are set

2010-10-30 Thread Ivan Razumov

New submission from Ivan Razumov iarspi...@gmail.com:

OS: Windows 7 x86
Python: 2.6.4

An Entry with both Font and Foreground properties changed (i.e. not OS-default) 
does not display text set with textvariable.set method. 

Attached an example of such behavior.

--
components: Tkinter
files: Project5.py
messages: 120030
nosy: iarspider
priority: normal
severity: normal
status: open
title: Entry text not set if both 'Font' and 'fg' are set
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file19441/Project5.py

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



[issue10259] Entry text not set if all of 'Font', 'Foreground' and 'Align' are set

2010-10-30 Thread Ivan Razumov

Changes by Ivan Razumov iarspi...@gmail.com:


--
title: Entry text not set if both 'Font' and 'fg' are set - Entry text not set 
if all of 'Font', 'Foreground' and 'Align' are set

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



[issue10259] Entry text not set if all of 'Font', 'Foreground' and 'Align' are set

2010-10-30 Thread Ivan Razumov

Ivan Razumov iarspi...@gmail.com added the comment:

The bug only appears if Align is not Left.

--

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



[issue10259] Entry text not set if all of 'Font', 'Foreground' and 'Justify' are set

2010-10-30 Thread Ivan Razumov

Changes by Ivan Razumov iarspi...@gmail.com:


--
title: Entry text not set if all of 'Font', 'Foreground' and 'Align' are set - 
Entry text not set if all of 'Font', 'Foreground' and 'Justify' are set

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



[issue10259] Entry text not set if all of 'Font', 'Foreground' and 'Justify' are set

2010-10-30 Thread Ivan Razumov

Ivan Razumov iarspi...@gmail.com added the comment:

Typo: align - Justify

--

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



[issue10237] failure in Barrier tests

2010-10-30 Thread Kristján Valur Jónsson

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

Silly me, changing the default timeout invalidated the unittest for it.
Fixed in revision 86018

--

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



[issue10164] Add an assertBytesEqual to unittest and use it for bytes assertEqual

2010-10-30 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

Am discussing this with the OP on IRC and tabling it for a while so we can 
better think out the API.

The goal is to let assertEqual(a, b) do straight-comparions of raw bytes, but 
to give a nice looking diff (possibly translated with line breaks or somesuch) 
when the test fails.  This will be helpful in testing the email module. 

The current patch requires that assertBytesEqual be exposed and called directly 
so that a user can specify a split-at argument.  The purpose of that argument 
is to approximate the line breaking that occurs naturally in text.  The OP does 
not want to decode the bytes prior to the equality test, but does want a 
readable diff whenever the bytes represent ascii text.

--
resolution:  - later

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



[issue10254] unicodedata.normalize('NFC', s) regression

2010-10-30 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +barry

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



[issue10160] operator.attrgetter slower than lambda after adding dotted names ability

2010-10-30 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

The patch looks fine.

You're overview of the process presented here in the tracker would make a nice 
comment in the code. 

If Antoine is happy with the latest patch, then it's ready to apply.

--
assignee: rhettinger - pitrou

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



[issue10260] Add a thrading.Condition.wait_for() method

2010-10-30 Thread Kristján Valur Jónsson

New submission from Kristján Valur Jónsson krist...@ccpgames.com:

The attached patch adds a wait_for method to condition objects.
It can simplify code that uses condition variables since it relieves the user 
from writing a condition loop.  In addition it simplifies timeout logic which 
otherwise has to correctly deal with non-successful wakeups.

We also modify the barrier to use it, giving more robust timeout behaviour.

(btw, the use of time.time() in threading is unfortunate, since it has low 
resolution and is affected by a user adjusting the clock. On Windows one would 
want time.clock(), but that function measures CPU time on unix.  Do we need a 
proper time.wallclock() function available on all platforms?)

--
components: Library (Lib)
files: wait_for.patch
keywords: patch
messages: 120036
nosy: georg.brandl, krisvale
priority: normal
severity: normal
status: open
title: Add a thrading.Condition.wait_for() method
type: feature request
versions: Python 3.2
Added file: http://bugs.python.org/file19442/wait_for.patch

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



[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2010-10-30 Thread Jacques Grove

Jacques Grove jacq...@tripitinc.com added the comment:

Here's one that really falls in the category of don't do that;  but I found 
this because I was limiting the system recursion level to somewhat less than 
the standard 1000 (for other reasons), and I had some shorter duplicate 
patterns in a big regex.  Here is the simplest case to make it blow up with the 
standard recursion settings:

$ cat test.py
import re, regex
regexp = 
'(abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ|abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ)'
re.compile(regexp)
regex.compile(regexp)

$ python test.py
snip big traceback except for last few lines

File /tmp/test/src/lib/_regex_core.py, line 2024, in optimise
subpattern = subpattern.optimise(info)
  File /tmp/test/src/lib/_regex_core.py, line 1552, in optimise
branches = [_Branch(branches)]
RuntimeError: maximum recursion depth exceeded

--

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