[issue14089] Patch to increase fractions lib test coverage

2012-02-24 Thread Éric Araujo

Éric Araujo  added the comment:

LGTM

--
nosy: +eric.araujo
versions: +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



[issue14074] argparse allows nargs>1 for positional arguments but doesn't allow metavar to be a tuple

2012-02-24 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
title: argparse does not allow nargs>1 for positional arguments but doesn't 
allow metavar to be a tuple -> argparse allows nargs>1 for positional arguments 
but doesn't allow metavar to be a tuple

___
Python tracker 

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



[issue14114] 2.7.3rc1 chm gives JS error

2012-02-24 Thread Ezio Melotti

Ezio Melotti  added the comment:

"$" refers to JQuery, and should be defined in 
http://docs.python.org/_static/jquery.js.
Maybe you have to import/include that file before 
http://docs.python.org/_static/copybutton.js?
There are also other js scripts there that use JQuery so I'm not sure why it's 
failing with the copybutton.

The copy button (the one on the top-right in the code examples) is a fairly new 
addition and it's not vital for the docs, so if we can't find a solution we can 
probably just skip that file and build the chm without copy button.

--

___
Python tracker 

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



[issue14112] tutorial intro talks of "shallow copy" concept without explanation

2012-02-24 Thread Éric Araujo

Éric Araujo  added the comment:

I think it’s a common English term (i.e. “shallow water” to describe a small 
lake-like thing where you can go without swimming), but non-native speakers may 
not know it (I don’t remember if I knew it before learning Python, for example).

What about this:

 All slice operations return a new list containing the requested elements.  This
-means that the following slice returns a shallow copy of the list *a*::
+means that the following slice returns a shallow copy (see the documentation of
+the :mod:`copy` module for a definition) of the list *a*::

(BTW, you can use syntax like Doc/tutorial/introduction.rst:487 to have links 
generated; see 
http://docs.python.org/devguide/triaging#generating-special-links-in-a-comment 
—also linked from the “Comment” label in the form, but it isn’t obvious that 
it’s a link).

--
nosy: +eric.araujo, ezio.melotti, terry.reedy
versions: +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



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

2012-02-24 Thread Éric Araujo

Éric Araujo  added the comment:

Good points.

New docstring:

  Tests for scripts in the Tools directory.

  This file contains regression tests for some of the scripts found in the
  Tools directory of a Python checkout or tarball, such as reindent.py.

When I commit I’ll also send to python-dev a reply to the python-checkins email 
to advertise the new file.

New skip message:

  test irrelevant for an installed Python

Better?

--

___
Python tracker 

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



[issue14116] Lock.__enter__() method returns True instead of self

2012-02-24 Thread Éric Araujo

Éric Araujo  added the comment:

IIUC returning True is not incorrect, only useless.  In the stdlib I usually 
see “with lock:”.  Can you tell what is the use case for accessing the 
condition object inside the context block?  Does it apply only to Condition or 
also to *Lock and Semaphore?

--
nosy: +eric.araujo, ncoghlan, pitrou

___
Python tracker 

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



[issue1116520] Prefix search is filesystem-centric

2012-02-24 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +carljm, eric.araujo
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



[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2012-02-24 Thread Éric Araujo

Éric Araujo  added the comment:

+1 to Antoine’s proposal of removal.

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

___
Python tracker 

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



[issue14081] Allow "maxsplit" argument to str.split() to be passed as a keyword argument

2012-02-24 Thread Éric Araujo

Éric Araujo  added the comment:

LGTM.

(Nick: I think the author directly translated the regex function calls from 
other languages to using re in Python.)

--
nosy: +eric.araujo

___
Python tracker 

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



[issue13973] urllib.parse is imported twice in xmlrpc.client

2012-02-24 Thread Éric Araujo

Changes by Éric Araujo :


--
status: open -> closed

___
Python tracker 

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



[issue13491] Fixes for sqlite3 doc

2012-02-24 Thread Éric Araujo

Changes by Éric Araujo :


Added file: http://bugs.python.org/file24635/sqlite-doc-tweaks-3.2.diff

___
Python tracker 

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



[issue13491] Fixes for sqlite3 doc

2012-02-24 Thread Éric Araujo

Éric Araujo  added the comment:

Here’s a patch for 2.7.  I haven’t changed the text_factory example.

The second patch is for 3.2 and contains a few additional changes that I did in 
my first patch.

--
Added file: http://bugs.python.org/file24634/sqlite-doc-tweaks-2.7.diff

___
Python tracker 

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



[issue14097] Improve the "introduction" page of the tutorial

2012-02-24 Thread Éric Araujo

Éric Araujo  added the comment:

Be careful with whitespace changes.  Sometimes not putting whitespace around an 
operator helps to see the grouping of operations, for example.  The important 
thing is “Readability counts”, not “Always put whitespace around operators”.  A 
huge part of understanding PEP 8 is to know when not to follow PEP 8 (PEP 20 is 
not called a Zen for no reason :)

About 5)-6): I really wish the docs wouldn’t use the term “variable”, which 
means something else in most other programming languages and always cause 
beginners to stumble upon unexpected-for-them binding behavior.

A remark that’s probably culture-dependent: “degenerate” nearly sounds like a 
racist insult to me (see 11).

--

___
Python tracker 

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



[issue1112955] move_file()'s return value when dry_run=1 unclear

2012-02-24 Thread Éric Araujo

Éric Araujo  added the comment:

My opinion about dry-run modes is that the goal is to be as close as possible 
to the real operation, but leave the world in a clean state.  Therefore, 
testing for file existence is okay (nevermind about modifying the last accessed 
time, it isn’t important IMO), but creating a file is not okay.  So I’m 
perfectly fine if calling the function with dry_run=1 will now not always 
succeed.  You want to see that error when running in dry-run mode.

I’ll improve the test and commit the patch.

packaging uses shutil.move directly, which does not return anything; I will 
check if packaging does not need it or if we have a regression and need to 
improve shutil.move in 3.3.

--
assignee: tarek -> eric.araujo

___
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-24 Thread Éric Araujo

Éric Araujo  added the comment:

> - test_glob_to_re() was doing two levels of escaping (r'\' -> r'')
>   for its expected output when it should only do one (r'\' -> r'\\').
Fix merged.  I don’t fully understand why one place needs two escapes and the 
others just one.

> - test_process_template() was not converting some of its expected
>   results to use the native directory separator.
Overlooked paths fixed.

> I also took the liberty of changing the checks for whether the separator 
> needs to be escaped
> - it's better to escape everything except "/", just in case someone decides 
> to port Python to
> some platform using a weird directory separator that is neither "/" nor r"\".
I didn’t take that part.  If someone wants to port Python with a new style of 
os.sep or os.extsep, I’ll deal with it when they report that.

The buildout.cfg and VCS dirs issues are covered by unit tests for both 
filelist and sdist, but thanks for testing manually with a real setup.py too.  
The third problem you mention (inclusion of unwanted module in a subdir) is 
also covered by test_filelist.

On a related subject, the code in sdist that excludes VCS dirs uses r'/|\\'; I 
thought that os.altsep was an alternate *accepted* separator, but not actually 
produced by OS calls.  IOW, I’m asking if os.walk (used to create 
filelist.allfiles) can ever give paths with '/' on Windows.  If not, then the 
regex is redundant, and I can clean it in packaging.  My patch removes the 
redundancy, just for curiosity, but I won’t actually commit that part to 
distutils.

--
Added file: http://bugs.python.org/file24633/filelist-regex-bugs-v3.diff

___
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-24 Thread Nick Coghlan

Changes by Nick Coghlan :


--
assignee:  -> ncoghlan

___
Python tracker 

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



[issue14032] test_cmd_line_script prints undefined 'data' variable

2012-02-24 Thread Nick Coghlan

Changes by Nick Coghlan :


--
assignee:  -> ncoghlan

___
Python tracker 

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



[issue14102] argparse: add ability to create a man page

2012-02-24 Thread Éric Araujo

Éric Araujo  added the comment:

Alright :)  I’ve contacted the author of the blog article to ask him if we can 
reuse his code.

--
stage:  -> needs 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-24 Thread Éric Araujo

Éric Araujo  added the comment:

I saw nothing wrong.  Give Nick a week to find time to review :)

--

___
Python tracker 

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



[issue14106] Distutils manifest: recursive-(include|exclude) matches suffix instead of full filename

2012-02-24 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks, will look into it.

--
assignee:  -> eric.araujo
components: +Distutils, Distutils2
nosy: +alexis
versions: +3rd party

___
Python tracker 

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



[issue4256] argparse: provide a simple way to get a programmatically useful list of options

2012-02-24 Thread Éric Araujo

Éric Araujo  added the comment:

> zsh completion is much more powerful.
I beg to differ :)  bash completion can also list more that files, for example 
only .bz2 files when I complete the bunzip2 command, or Mercurial branch and 
tag names when I complete hg update, etc.  It all depends on the completion 
script.

I think that there may be enough common ground between the two shells that 
argparse could print out enough information for both systems.  I haven’t read 
the code of genzshcomp, though.

--

___
Python tracker 

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



[issue14103] argparse: add ability to create a bash completion script

2012-02-24 Thread Éric Araujo

Éric Araujo  added the comment:

Closing as rejected for now.

--
resolution:  -> rejected
stage:  -> committed/rejected
status: open -> closed
title: argparse: add ability to create a bash_completion script -> argparse: 
add ability to create a bash completion script

___
Python tracker 

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



[issue13974] packaging: test for set_platform()

2012-02-24 Thread Éric Araujo

Éric Araujo  added the comment:

BTW I’m wondering if set_platform is really useful; no code currently uses it.

--

___
Python tracker 

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



[issue14075] argparse: unused method?

2012-02-24 Thread Éric Araujo

Éric Araujo  added the comment:

Following Steven’s message, I will remove the unused function.

--
assignee:  -> eric.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



[issue14082] shutil doesn't copy extended attributes

2012-02-24 Thread Éric Araujo

Éric Araujo  added the comment:

> copy2() claims to work like "cp -p"
It probably does, for a behavior of “cp -p” that predates extended attributes 
.

Do you think the best way is to always copy xattrs, add a new parameter, add a 
new copy function?

--
nosy: +eric.araujo
title: shutil doesn't support extended attributes -> shutil doesn't copy 
extended attributes

___
Python tracker 

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



[issue14072] urlparse on tel: URI-s misses the scheme in some cases

2012-02-24 Thread Éric Araujo

Éric Araujo  added the comment:

urlparse doesn’t actually implement generic parsing rules according to the most 
recent RFCs; it has hard-coded registries of supported schemes.  tel is not 
currently supported.  That said, it’s strange that the parsing differs in your 
two examples.

--
components: +Library (Lib) -None
nosy: +eric.araujo

___
Python tracker 

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



[issue13557] exec of list comprehension fails on NameError

2012-02-24 Thread Éric Araujo

Éric Araujo  added the comment:

Stefan: This fell off my radar, sorry I haven’t reviewed your patch yet.

Terry: +1

--

___
Python tracker 

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



[issue2377] Replace __import__ w/ importlib.__import__

2012-02-24 Thread Brett Cannon

Brett Cannon  added the comment:

Then if you want to give it a review that would be great!

I still need to solve the test_pydoc failure (either with Brian's patch to add 
a name attribute to ImportError or implement importlib.find_module()). 
Otherwise all other failures at the moment are because of mtime race conditions 
(as you know =) or exist in the default branch. And I still need to integrate 
rebuilding importlib.h into the Makefile, but that should be easy since it will 
probably be a separate command so you don't accidentally break import by 
busting importlib.

--

___
Python tracker 

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



[issue2377] Replace __import__ w/ importlib.__import__

2012-02-24 Thread Brett Cannon

Changes by Brett Cannon :


Added file: http://bugs.python.org/file24632/c011ff345a78.diff

___
Python tracker 

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



[issue14105] Breakpoints in debug lost if line is inserted; IDLE

2012-02-24 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +terry.reedy

___
Python tracker 

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



[issue14092] __name__ inconsistently applied in class definition

2012-02-24 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

This is not a bug report, as Python works as documented. 
Double underscore names are defined as *reserved* for the interpreter, with the 
ones actually in use having defined meanings.

type.__new__ sets several internally used attributes on new classes. The 
attribute look-up mechanism for classes looks at them first before looking in 
__dict__, which is for attributes of both the class and its instances. Here is 
another example similar to yours.

>>> class C: __dict__ = 1

>>> C.__dict__
dict_proxy({'__dict__': 1, '__module__': '__main__', '__weakref__': , '__doc__': None})
>>> C().__dict__
1

__dict__ is not writable, but __class__ is. You can already rename a class if 
you really want:

>>> C.__name__ = 'bizarre'
>>> C.__name__
'bizarre'

Conceptually, this seems the right way as one normally would not want the name 
of the class to be the default name for every instance.

>>> C().__name__
Traceback (most recent call last):
  File "", line 1, in 
C().__name__
AttributeError: 'bizarre' object has no attribute '__name__'

If you really want instances to have that also, then also do as you did.

There are other class-only, not for instances, attributes:
__mro__ and __subclasses__ and perhaps others.

--
nosy: +terry.reedy
resolution:  -> rejected
status: open -> closed
type: behavior -> enhancement
versions:  -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



[issue14119] Ability to adjust queue size in Executors

2012-02-24 Thread Nam Nguyen

Nam Nguyen  added the comment:

By the way, ProcessPoolExecutor actually sets its queue size to a reasonable 
number but ThreadPoolExecutor does not.

--

___
Python tracker 

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



[issue14089] Patch to increase fractions lib test coverage

2012-02-24 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +terry.reedy

___
Python tracker 

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



[issue14076] sqlite3 module ignores placeholers in CREATE TRIGGER code

2012-02-24 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +ghaering

___
Python tracker 

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



[issue14074] argparse does not allow nargs>1 for positional arguments but doesn't allow metavar to be a tuple

2012-02-24 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +bethard

___
Python tracker 

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



[issue14095] type_new() removes __qualname__ from the input dictionary

2012-02-24 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset b83ae75beaca by Victor Stinner in branch 'default':
Close #14095: type.__new__() doesn't remove __qualname__ key from the class
http://hg.python.org/cpython/rev/b83ae75beaca

--
nosy: +python-dev
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



[issue14119] Ability to adjust queue size in Executors

2012-02-24 Thread Nam Nguyen

New submission from Nam Nguyen :

I am running into a memory consumption issue with concurrent.futures module. 
Its Executors do not have a public API to adjust their queue size.  and the 
queues are created unbounded initially.

It would be helpful to have some public method or a parameter at construction 
time to limit this queue size.

--
components: Library (Lib)
messages: 154175
nosy: Nam.Nguyen
priority: normal
severity: normal
status: open
title: Ability to adjust queue size in Executors
type: enhancement

___
Python tracker 

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



[issue13557] exec of list comprehension fails on NameError

2012-02-24 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Issues like this, about exec, have come up multiple times. I just closed #14049 
as a duplicate of this, and listed there some other issues. So I think that the 
doc for exec (and execfile in 2.7) could be better still. I would like to see 
something like the following added, whether instead of or in addition to the 
current proposal -- perhaps after "If provided, locals can be any mapping 
object." (quote from the 3.2 exec entry)

"At module level, globals and locals are the same dictionary. If one passes two 
separate objects as globals and locals, the code will be executed as if it were 
embedded in a class definition."

To me, this is friendlier and less intimidating than 'free variable' and the 
Execution model doc chapter. It summarizes the essential problem with such exec 
calls.

To illustrate, the following gives the same NameError. and for the same reason, 
as exec(code,{},{}), where code is the quoted unindented version with the class 
line deleted.

class x:
x = 1
def incx():
return x+1
print(incx())

--
nosy: +terry.reedy
versions: +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



[issue14049] execfile() fails on files that use global variables inside functions

2012-02-24 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Searching on 'exec NameError' shows that this issue is a duplicate of (behavior 
issue) #1167300 which contained an essentially identical example"

>>> exec """\
... x = 3
... def f():
... print x
... f()
... """ in {}, {}

#1167300 was closed as a duplicate of (behavior issue) #991196, which in turn 
was closed as 'won't fix' (ie, works as it must). Doc issue #4831, which 
resulted in some doc changes, seems related to this but is not the same. I 
believe this issue is a duplicate of #13557, which has a patch. I will add my 
proposed change there.

Anyway, my comments:

In 3.2.2, this runs

#prog='''\
x = 1
def weird():
y = x + 1
return y
print(weird())
#'''
#exec(prog)

The same uncommented does also, as does adding ',{}' to the call.
Adding ',{},{}' gives the NameError.
With one named {} arg passed twice, as follows, it runs.

d = {}
exec(prog, d, d)

The reasons for these results are:
1. assignments are *always* to the local namespace.
2. normally, for module code, the local and global namespaces are the same.
3. in the example, 'x=1' is the same as "values['x']=1", while within the 
function, 'y=x+1' looks up x in gvalues.

This is the same explanation as given in #1167300.

--
nosy: +terry.reedy
resolution:  -> duplicate
status: open -> closed
superseder:  -> exec of list comprehension fails on NameError
versions: +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



[issue14107] Debian bigmem buildbot hanging in test_bigmem

2012-02-24 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

> My PC has 12 GB of RAM and no swap. I ran the test after my commit.

That explains. I ran it earlier (obviously), so it included a bunch of
those more-demanding tests, which must be where the OOM killer hit it.

--

___
Python tracker 

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



[issue14118] _pickle.c structure cleanup

2012-02-24 Thread Merlijn van Deen

Merlijn van Deen  added the comment:

That makes sense. The goal was not so much cleaning up the module per se; 
rather, it was a result of trying to understand the general structure of 
_pickler.c specifically.

However, is there an intermediate level of 'modularization' you would propose? 
The idea is of course not to have 30 files open to make a small change, but 
rather have one or two reasonably small files open. My current approach was 
fine-grained on purpose - it's not that much work to recombine files.

I think it makes sense to split the PicklerObject into several parts:
  * the Pickler object (initialization/type/etc, maybe functions split off)
  * the actualy pickler implementation (dump/save/save_*) (but maybe in less 
files - see below)
  * the PicklerMemoProxy

for the picker implementation - specifically the picklers directory - my 
approach was to have a 'mirrored' directory for PicklerObject and 
UnPicklerObject: the methods to pickle and unpickle will be in the same files 
in the two directories (i.e. picklers/unicode.c will pickle str, 
unpicklers/unicode.c will unpickle them).

--

___
Python tracker 

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



[issue14107] Debian bigmem buildbot hanging in test_bigmem

2012-02-24 Thread STINNER Victor

STINNER Victor  added the comment:

>> I ran test_bigmem on my computer. The test pass but it is really slow.
>
> Is this with or without the fix you just pushed? How much RAM does your
> system have? I tried running with "-M 4.5G" on my 8GB machine earlier
> today, and it ate through all of my RAM plus 4GB of swap before the OOM
> killer terminated it.

My PC has 12 GB of RAM and no swap. I ran the test after my commit.

I tried to enable swap but writing to the swap does completly crash my
kernel. My / uses btrfs and btrfs doesn't look to support swap files,
even with a loopback device.

--

___
Python tracker 

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



[issue14107] Debian bigmem buildbot hanging in test_bigmem

2012-02-24 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

> I ran test_bigmem on my computer. The test pass but it is really slow.

Is this with or without the fix you just pushed? How much RAM does your
system have? I tried running with "-M 4.5G" on my 8GB machine earlier
today, and it ate through all of my RAM plus 4GB of swap before the OOM
killer terminated it.


> Do you need these tests using so much memory (and are really slow)?

In general, I think it's important to exercise cases where 32-bit
truncation issues and the like might arise, because otherwise they'll lie
around undetected until they bite some unsuspecting user at an
inopportune moment. But I don't know much about those specific tests, so
I can't really offer much of an opinion here.

[Still, 48GB minimum? ೦_೦ ]

--

___
Python tracker 

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



[issue14107] Debian bigmem buildbot hanging in test_bigmem

2012-02-24 Thread STINNER Victor

STINNER Victor  added the comment:

I ran test_bigmem on my computer. The test pass but it is really slow.

$ ./python -m test -v -M 8G test_bigmem
(...
Ran 164 tests in 3228.227s

OK (skipped=44)
1 test OK.


One hour, whereas 44 tests are skipped. Skipped tests are the tests using the 
most quantity of memory, so I expect that they are even slower.

Do you need these tests using so much memory (and are really slow)?
---
test_capitalize (test.test_bigmem.StrTest) ... skipped 'not enough memory: 
24.0G minimum needed'
test_encode_utf32 (test.test_bigmem.StrTest) ... skipped 'not enough memory: 
9.0G minimum needed'
test_format (test.test_bigmem.StrTest) ... skipped 'not enough memory: 12.0G 
minimum needed'
test_repr_large (test.test_bigmem.StrTest) ... skipped 'not enough memory: 
10.0G minimum needed'
test_split_large (test.test_bigmem.StrTest) ... skipped 'not enough memory: 
20.0G minimum needed'
test_swapcase (test.test_bigmem.StrTest) ... skipped 'not enough memory: 24.0G 
minimum needed'
test_title (test.test_bigmem.StrTest) ... skipped 'not enough memory: 24.0G 
minimum needed'
test_translate (test.test_bigmem.StrTest) ... skipped 'not enough memory: 12.0G 
minimum needed'
test_split_large (test.test_bigmem.BytesTest) ... skipped 'not enough memory: 
20.0G minimum needed'
test_compare (test.test_bigmem.TupleTest) ... skipped 'not enough memory: 32.0G 
minimum needed'
test_concat_large (test.test_bigmem.TupleTest) ... skipped 'not enough memory: 
48.0G minimum needed'
test_concat_small (test.test_bigmem.TupleTest) ... skipped 'not enough memory: 
24.0G minimum needed'
test_contains (test.test_bigmem.TupleTest) ... skipped 'not enough memory: 
16.0G minimum needed'
test_from_2G_generator (test.test_bigmem.TupleTest) ... skipped 'not enough 
memory: 9.0G minimum needed'
test_from_almost_2G_generator (test.test_bigmem.TupleTest) ... skipped 'not 
enough memory: 9.0G minimum needed'
test_hash (test.test_bigmem.TupleTest) ... skipped 'not enough memory: 16.0G 
minimum needed'
test_index_and_slice (test.test_bigmem.TupleTest) ... skipped 'not enough 
memory: 16.0G minimum needed'
test_repeat_large (test.test_bigmem.TupleTest) ... skipped 'not enough memory: 
48.0G minimum needed'
test_repeat_large_2 (test.test_bigmem.TupleTest) ... skipped 'not enough 
memory: 12.0G minimum needed'
test_repeat_small (test.test_bigmem.TupleTest) ... skipped 'not enough memory: 
24.0G minimum needed'
test_repr_large (test.test_bigmem.TupleTest) ... skipped 'not enough memory: 
22.0G minimum needed'
test_append (test.test_bigmem.ListTest) ... skipped 'not enough memory: 18.0G 
minimum needed'
test_compare (test.test_bigmem.ListTest) ... skipped 'not enough memory: 32.0G 
minimum needed'
test_concat_large (test.test_bigmem.ListTest) ... skipped 'not enough memory: 
48.0G minimum needed'
test_concat_small (test.test_bigmem.ListTest) ... skipped 'not enough memory: 
24.0G minimum needed'
test_contains (test.test_bigmem.ListTest) ... skipped 'not enough memory: 16.0G 
minimum needed'
test_count (test.test_bigmem.ListTest) ... skipped 'not enough memory: 16.0G 
minimum needed'
test_extend_large (test.test_bigmem.ListTest) ... skipped 'not enough memory: 
32.0G minimum needed'
test_extend_small (test.test_bigmem.ListTest) ... skipped 'not enough memory: 
16.0G minimum needed'
test_hash (test.test_bigmem.ListTest) ... skipped 'not enough memory: 16.0G 
minimum needed'
test_index (test.test_bigmem.ListTest) ... skipped 'not enough memory: 16.0G 
minimum needed'
test_index_and_slice (test.test_bigmem.ListTest) ... skipped 'not enough 
memory: 16.0G minimum needed'
test_inplace_concat_large (test.test_bigmem.ListTest) ... skipped 'not enough 
memory: 48.0G minimum needed'
test_inplace_concat_small (test.test_bigmem.ListTest) ... skipped 'not enough 
memory: 24.0G minimum needed'
test_inplace_repeat_large (test.test_bigmem.ListTest) ... skipped 'not enough 
memory: 32.0G minimum needed'
test_inplace_repeat_small (test.test_bigmem.ListTest) ... skipped 'not enough 
memory: 16.0G minimum needed'
test_insert (test.test_bigmem.ListTest) ... skipped 'not enough memory: 18.0G 
minimum needed'
test_pop (test.test_bigmem.ListTest) ... skipped 'not enough memory: 16.0G 
minimum needed'
test_remove (test.test_bigmem.ListTest) ... skipped 'not enough memory: 16.0G 
minimum needed'
test_repeat_large (test.test_bigmem.ListTest) ... skipped 'not enough memory: 
48.0G minimum needed'
test_repeat_small (test.test_bigmem.ListTest) ... skipped 'not enough memory: 
24.0G minimum needed'
test_repr_large (test.test_bigmem.ListTest) ... skipped 'not enough memory: 
22.0G minimum needed'
test_reverse (test.test_bigmem.ListTest) ... skipped 'not enough memory: 16.0G 
minimum needed'
test_sort (test.test_bigmem.ListTest) ... skipped 'not enough memory: 16.0G 
minimum needed'
---

--
nosy: +haypo

___
Python tracker 

___
_

[issue14118] _pickle.c structure cleanup

2012-02-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I think this is going overboard. _pickle.c is long but it defines two classes 
which are closely related to each other. I don't really get the point of 
exploding it into a myriad of 30-line files, especially if it means I now have 
to keep all these tiny files open when I want to change something in the pickle 
module.

If you want to find a target for modularizing, I think posixmodule.c would be a 
far better candidate.

--
nosy: +alexandre.vassalotti, pitrou
priority: normal -> low
versions:  -Python 3.4

___
Python tracker 

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



[issue14107] Debian bigmem buildbot hanging in test_bigmem

2012-02-24 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 4afcb25988c4 by Victor Stinner in branch 'default':
Issue #14107: fix bigmem tests on str.capitalize(), str.swapcase() and
http://hg.python.org/cpython/rev/4afcb25988c4

--
nosy: +python-dev

___
Python tracker 

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



[issue14118] _pickle.c structure cleanup

2012-02-24 Thread Merlijn van Deen

New submission from Merlijn van Deen :

While working on #6784, I've looked at _pickle.c and found it quite... 
daunting: 6500 lines and 185kB. I have been working on a bit of cleanup, and 
I'd like some comments on this.

I'm working on adapting
_pickle.c into the following structure:

_pickle.c takes care of the module initialization
_pickle/*.c are helper files for this (global functions/definitions)
_pickle/PicklerObject contains all files that relate to the Pickler
class - initialization, all functions, etc, and
_pickle/PicklerObject/picklers/*.c contains all pickling functions,
split out into groups (corresponding to pickletools.StackObjects)

This should end in a tree where every .c module lists the relevant dependencies 
(and as such should be compilable on itself).

Currently, I'm at the point where PicklerObject roughly has the structure I 
want (although not every file is compilable on itself yet). As such, I feel 
this is the right moment to ask if it would be seen as an useful improvement in 
trunk, and to see if anyone has suggestions for improvements.

hg repos: 
https://bitbucket.org/valhallasw/cpython/src/0810ffadffa3/Modules/_pickle/PicklerObject
 (_pickle_clean branch)

--
components: Extension Modules
hgrepos: 114
messages: 154165
nosy: valhallasw
priority: normal
severity: normal
status: open
title: _pickle.c structure cleanup
type: enhancement
versions: Python 3.3, Python 3.4

___
Python tracker 

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



[issue14046] argparse: assertion failure if optional argument has square/round brackets in metavar

2012-02-24 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +bethard

___
Python tracker 

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



[issue14117] Turtledemo: exception and minor glitches.

2012-02-24 Thread Terry J. Reedy

New submission from Terry J. Reedy :

Win7, 3.2.2, python -m turtledemo in Command Prompt Window

After running clock example, hitting Stop results in following:
Clock face, including hands, is erased. Day and date are left (intentional?), 
and the following appears back in command prompt window.

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Programs\Python32\lib\tkinter\__init__.py", line 1399, in __call__
return self.func(*args)
  File "C:\Programs\Python32\lib\tkinter\__init__.py", line 487, in callit
func(*args)
  File "C:\Programs\Python32\lib\turtledemo\clock.py", line 116, in tick
second_hand.setheading(6*sekunde)
  File "C:\Programs\Python32\lib\turtle.py", line 1936, in setheading
self._rotate(angle)
  File "C:\Programs\Python32\lib\turtle.py", line 3279, in _rotate
self._update()
  File "C:\Programs\Python32\lib\turtle.py", line 2660, in _update
self._update_data()
  File "C:\Programs\Python32\lib\turtle.py", line 2646, in _update_data
self.screen._incrementudc()
  File "C:\Programs\Python32\lib\turtle.py", line 1285, in _incrementudc
raise Terminator
turtle.Terminator

Demo continues to run.

Paint: Left clicking mouse moves dot without painting. Right clicking changes 
mode so left clicking draws line. It also causes some filling of enclosed 
regions. This double action is slightly obscure. The prompt on the bottom of 
the screen says "Use mouse/keys or Stop" As near as I can tell, keys are 
inactive. So prompt could delete '/keys'.

Module doc strings that explain each demo should be wrapped so that they appear 
in the code window without scrolling. Or the left window could be wider, 
especially if the user widens the window. 800x600 screens are pretty rare these 
days. 

'Wikipedia' is a poor name for something just because it happened to be there. 
'Rosette', for instance, would be better.

--
components: Library (Lib)
messages: 154164
nosy: terry.reedy
priority: normal
severity: normal
status: open
title: Turtledemo: exception and minor glitches.
type: behavior
versions: 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



[issue4256] argparse: provide a simple way to get a programmatically useful list of options

2012-02-24 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
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-24 Thread Jason Yeo

Jason Yeo  added the comment:

*friendly ping*, how's the review for this patch?

--

___
Python tracker 

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



[issue14032] test_cmd_line_script prints undefined 'data' variable

2012-02-24 Thread Jason Yeo

Jason Yeo  added the comment:

hi, 

*friendly ping* how's the review for this patch?

--

___
Python tracker 

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



[issue14116] Lock.__enter__() method returns True instead of self

2012-02-24 Thread sbt

New submission from sbt :

The __enter__() methods of Lock, RLock, Semaphore and Condition in threading 
(and multiprocessing) all return True.  This seems to contradict the 
documentation for the context protocol which says

  contextmanager.__enter__()

Enter the runtime context and return either this object or 
another object related to the runtime context. The value 
returned by this method is bound to the identifier in the
as clause of with statements using this context manager.

...

I don't think True qualifies as "another object related to the runtime context".

It looks like an oversight caused by making __enter__() an alias for acquire(). 
 Is it reasonable to change this for 3.3?  I tripped over the issue when I 
tried writing

  with Condition() as c:
...

--
components: Library (Lib)
messages: 154161
nosy: sbt
priority: normal
severity: normal
status: open
title: Lock.__enter__() method returns True instead of self
type: behavior
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



[issue13706] non-ascii fill characters no longer work in formatting

2012-02-24 Thread STINNER Victor

STINNER Victor  added the comment:

> By the way, Python 3.2 fails also to handle
> non-ASCII thousands separator or non-ASCII
> decimal point: (...)

Hum, it is not trivial to redo the work on Python 3.2. I prefer to leave the 
code unchanged to not introduce a regression, and I wait until a Python 3.2 
user complains (the bug exists since Python 3.0 and nobody complained).

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

___
Python tracker 

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



[issue14097] Improve the "introduction" page of the tutorial

2012-02-24 Thread Eli Bendersky

Eli Bendersky  added the comment:

Comments on some of the suggestions:

1) Agreed
2) Can be combined with (3), I think. Just show the number example with the 
explanatory comments. They speak for themselves. No need for the SPAM and 
STRING assignments.
5) Yep. Can be replaced by "A value can be assigned to several variables in a 
single statement"
6) There's the tradeoff of rigor vs. simplicity here, since this is still a 
tutorial for beginners, right? What alternative would you propose?
7) Totally agree. I don't think complex numbers deserve more than a single 
trivial example and one sentence dedicated to them in the tutorial, if that...
8) Yes. See my previous message in this issue
9) "It differs from just writing the expression you want to write" is 
definitely confusing
10) Agree
11) This is kind-of mentioned later in the negative index part. It may be worth 
mentioning that a single index must be within bounds, but the explanation on 
degenerate slices has its place too, since it's a friendly feature of Python 
many rely on.
12) Agree
13) This is probably too arguable to be included. With Python's duck typing 
there *is* sometimes place for placing different objects in the same list, with 
the understanding that they all have some common behavior (for example, 
callables).
14) Agree

--

___
Python tracker 

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



[issue14108] test_shutil: failures in symlink tests

2012-02-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

It's a duplicate of issue13837.

--
nosy: +pitrou
resolution:  -> duplicate
status: open -> closed
superseder:  -> test_shutil fails with symlinks enabled under Windows

___
Python tracker 

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



[issue2377] Replace __import__ w/ importlib.__import__

2012-02-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> As for reviews, I'm totally happy to get them, but I also don't know
> if I have hit the performance point well enough for people to allow me
> to merge the code into default. I guess the real question is whether
> *you're* happy with the 10% slowdown in raw startup, Antoine, since
> you were the most vocal critic from a performance standpoint?

Well, it seems current performance is acceptable now :)

--

___
Python tracker 

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



[issue14115] 2.7.3rc hangs on test_asynchat on 32-bit Windows

2012-02-24 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +giampaolo.rodola
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



[issue14097] Improve the "introduction" page of the tutorial

2012-02-24 Thread Eli Bendersky

Eli Bendersky  added the comment:

Ezio, your fix for 8 is definitely good. Space makes it cleaner, as well as 
compliant to PEP 8, which explicitly recommends to surround operators with 
spaces.

Note, however, that this should be applied in other places as well, not only 
the complex number samples. For example:

2+2
(50-5*6)/4

etc.

There's quite a bit of inconsistency in the samples. Some surround operators 
with spaces and some don't. I think converging on a single consistent, PEP 8 
compliant convention of surrounding with spaces always throughout the tutorial 
is a good idea.

--

___
Python tracker 

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



[issue14115] 2.7.3rc hangs on test_asynchat on 32-bit Windows

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

New submission from Martin v. Löwis :

As the title says: test_asynchat appears to hang on Windows.

--
messages: 154155
nosy: loewis
priority: normal
severity: normal
status: open
title: 2.7.3rc hangs on test_asynchat on 32-bit Windows

___
Python tracker 

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



[issue14114] 2.7.3rc1 chm gives JS error

2012-02-24 Thread Georg Brandl

Changes by Georg Brandl :


--
assignee:  -> ezio.melotti
nosy: +ezio.melotti
priority: normal -> release blocker

___
Python tracker 

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



[issue14114] 2.7.3rc1 chm gives JS error

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

New submission from Martin v. Löwis :

The 2.7.3rc1 chm give the following error when opened

Line: 1 Char: 1
The Value of the property "$" is null or undefined, not a function (translated 
from German)
Code: 0
URL: 
mk:@MSITStore:C:\Users\martin\27\python\Doc\build\htmlhelp\python273rc1.chm::/_static/copybutton.js

Clicking "yes" lets me proceed to the contents of the file.

--
messages: 154154
nosy: loewis
priority: normal
severity: normal
status: open
title: 2.7.3rc1 chm gives JS error

___
Python tracker 

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



[issue14113] Failure in test_strptime on Windows

2012-02-24 Thread Nadeem Vawda

New submission from Nadeem Vawda :

Recent failures on one of the Windows XP buildbots:

http://www.python.org/dev/buildbot/all/builders/x86%20XP-4%203.x/builds/6049/steps/test/logs/stdio
http://www.python.org/dev/buildbot/all/builders/x86%20XP-4%203.x/builds/6051/steps/test/logs/stdio

FAIL: test_date_time (test.test_strptime.LocaleTime_Tests)
--
Traceback (most recent call last):
  File 
"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_strptime.py",
 line 91, in test_date_time
"LC_date_time incorrect")
AssertionError: False is not true : LC_date_time incorrect

--
components: Tests, Windows
keywords: buildbot
messages: 154153
nosy: nadeem.vawda
priority: normal
severity: normal
stage: needs patch
status: open
title: Failure in test_strptime on Windows
type: behavior
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



[issue2377] Replace __import__ w/ importlib.__import__

2012-02-24 Thread Alex Gaynor

Changes by Alex Gaynor :


--
nosy: +alex

___
Python tracker 

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



[issue2377] Replace __import__ w/ importlib.__import__

2012-02-24 Thread Brett Cannon

Brett Cannon  added the comment:

Fixed the 'for' loop variable declaration. Surprised clang didn't warn me about 
that.

As for reviews, I'm totally happy to get them, but I also don't know if I have 
hit the performance point well enough for people to allow me to merge the code 
into default. I guess the real question is whether *you're* happy with the 10% 
slowdown in raw startup, Antoine, since you were the most vocal critic from a 
performance standpoint?

--

___
Python tracker 

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



[issue14097] Improve the "introduction" page of the tutorial

2012-02-24 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

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



[issue14112] tutorial intro talks of "shallow copy" concept without explanation

2012-02-24 Thread Tshepang Lekhonkhobe

New submission from Tshepang Lekhonkhobe :

Relevant line: 
http://hg.python.org/cpython/file/e2eccc906354/Doc/tutorial/introduction.rst#l487

When the concept is introduced, it appears like there's an assumption that the 
reader would know what it means. I'm curious if it's that common a term that it 
should be taken for granted, or if it deserves a definition.

--
assignee: docs@python
components: Documentation
messages: 154151
nosy: docs@python, tshepang
priority: normal
severity: normal
status: open
title: tutorial intro talks of "shallow copy" concept without explanation
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



[issue14111] IDLE Debugger should handle interrupts

2012-02-24 Thread Larry A. Taylor

New submission from Larry A. Taylor :

The attached script runs a long processing loop.

Start it in IDLE. Open the script and run it.

Press control-C. Result: message, KeyboardInterrupt with traceback message.

In shell window, turn on Debugger. Run the script.

Press control-C. Result: Restrat message shown in Python Shell. Debug Control 
shows no change.

Expected behavior: For keyboard interrupt, or for any uncaught exception, Debug 
Control should show the same information as if there was a breakpoint. For 
instance, the stack with line numbers, locals and globals.

Better: make a way to interrupt the program in a long loop or process, so that 
the programmer can tell -- live -- where the program is, and where most of the 
time is being used. Then use the regular buttons, Go, etc. to continue the 
process, possibly interrupted again.

Also: the IDLE Python Shell and Debug Control show no "running" indicator, so 
there is no easy way to tell if the program is still going.

--
components: IDLE, Windows
files: debug-running-or-stopped.py
messages: 154150
nosy: ltaylor934
priority: normal
severity: normal
status: open
title: IDLE Debugger should handle interrupts
type: enhancement
versions: Python 2.7
Added file: http://bugs.python.org/file24631/debug-running-or-stopped.py

___
Python tracker 

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



[issue2377] Replace __import__ w/ importlib.__import__

2012-02-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

For the record, compilation fails here:

Python/import.c: In function ‘PyImport_ImportModuleLevelObject’:
Python/import.c:2956:9: erreur: ‘for’ loop initial declarations are only
allowed in C99 mode
Python/import.c:2956:9: note: use option -std=c99 or -std=gnu99 to
compile your code
make: *** [Python/import.o] Erreur 1

--

___
Python tracker 

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



[issue14110] FreeBSD: test_os fails if user is in the wheel group

2012-02-24 Thread Stefan Krah

New submission from Stefan Krah :

On FreeBSD, if the user is a member of the group 'wheel', these
tests fail:


==
FAIL: test_setegid (test.test_os.PosixUidGidTests)
--
Traceback (most recent call last):
  File "/usr/home/stefan/hg/cpython/Lib/test/test_os.py", line 1090, in 
test_setegid
self.assertRaises(os.error, os.setegid, 0)
AssertionError: OSError not raised by setegid

==
FAIL: test_setgid (test.test_os.PosixUidGidTests)
--
Traceback (most recent call last):
  File "/usr/home/stefan/hg/cpython/Lib/test/test_os.py", line 1078, in 
test_setgid
self.assertRaises(os.error, os.setgid, 0)
AssertionError: OSError not raised by setgid

==
FAIL: test_setregid (test.test_os.PosixUidGidTests)
--
Traceback (most recent call last):
  File "/usr/home/stefan/hg/cpython/Lib/test/test_os.py", line 1110, in 
test_setregid
self.assertRaises(os.error, os.setregid, 0, 0)
AssertionError: OSError not raised by setregid

--
components: Tests
messages: 154148
nosy: skrah
priority: low
severity: normal
status: open
title: FreeBSD: test_os fails if user is in the wheel group
type: behavior
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



[issue14109] test_lib2to3: output that looks like a failure on Windows 7

2012-02-24 Thread Nadeem Vawda

Changes by Nadeem Vawda :


--
nosy: +nadeem.vawda

___
Python tracker 

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



[issue14109] test_lib2to3: output that looks like a failure on Windows 7

2012-02-24 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Yes, though, it's not high priority atm.

--

___
Python tracker 

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



[issue14109] test_lib2to3: output that looks like a failure on Windows 7

2012-02-24 Thread Stefan Krah

Stefan Krah  added the comment:

Oops, this is just undesirable output. Is there any chance to fix
this?

--
title: test_lib2to3: failure on Windows 7 -> test_lib2to3: output that looks 
like a failure on Windows 7

___
Python tracker 

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



[issue2377] Replace __import__ w/ importlib.__import__

2012-02-24 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Are you looking for reviews at this point?

--
nosy: +pitrou

___
Python tracker 

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



[issue14109] test_lib2to3: failure on Windows 7

2012-02-24 Thread Stefan Krah

New submission from Stefan Krah :

This failure occurs on the Windows 7 buildbot:

[302/364] test_lib2to3
--- 
D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\lib2to3\tests\test_main.py
   2012-02-13 21:57:29.273004000 -0500
+++ @   2012-02-24 11:59:54.408966500 -0500
@@ -42,7 +42,7 @@
 sys.stderr = save_stderr
 
 def test_unencodable_diff(self):
-input_stream = io.StringIO("print 'nothing'\nprint u'über'\n")
+input_stream = io.StringIO("print 'nothing'\nprint u'�ber'\n")
 out = io.BytesIO()
 out_enc = codecs.getwriter("ascii")(out)
 err = io.StringIO()

--
components: Tests
messages: 154144
nosy: benjamin.peterson, skrah
priority: normal
severity: normal
status: open
title: test_lib2to3: failure on Windows 7
type: behavior
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



[issue2377] Replace __import__ w/ importlib.__import__

2012-02-24 Thread Brett Cannon

Brett Cannon  added the comment:

OK, I have now done as much C code as I'm going to do for the __import__() 
function. It has gotten bootstrapped importlib within 10% of normal_startup 
against default.

That leaves (possibly) rewriting BuiltinImporter in C and then just good old 
fashioned optimizations of the Python code.

I'm going to continue to use the normal_startup benchmark as my gold standard 
benchmark and importlib.test.benchmark just for iterative testing that a change 
made an impact (until there is another Python 3 benchmark that measures startup 
time using a real-world app). With that in mind and taking a PyPy style 
approach, that means I should focus on top-level, non-package imports first (28 
of them), followed by builtins (14), submodules (4), packages (2), and then 
extensions (2). And if you don't want to do the math, there are 50 imports when 
starting Python, of which only 9 seem to follow (and include) site.

--

___
Python tracker 

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



[issue14108] test_shutil: failures in symlink tests

2012-02-24 Thread Stefan Krah

Changes by Stefan Krah :


--
nosy: +eric.araujo, tarek

___
Python tracker 

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



[issue14108] test_shutil: failures in symlink tests

2012-02-24 Thread Brian Curtin

Changes by Brian Curtin :


--
nosy: +brian.curtin

___
Python tracker 

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



[issue14108] test_shutil: failures in symlink tests

2012-02-24 Thread Stefan Krah

New submission from Stefan Krah :

These two tests fail on Windows 7:

==  

FAIL: test_copymode_follow_symlinks (test.test_shutil.TestShutil)   

--  

Traceback (most recent call last):  

  File "C:\Users\stefan\hg\master\lib\test\test_shutil.py", line 194, in 
test_copymode_follow_symlinks  
self.assertEqual(os.stat(src).st_mode, os.stat(dst).st_mode)

AssertionError: 33206 != 33060  



==  

FAIL: test_move_dangling_symlink (test.test_shutil.TestMove)

--  

Traceback (most recent call last):  

  File "C:\Users\stefan\hg\master\lib\test\test_shutil.py", line 59, in wrap

return func(*args, **kwargs)

  File "C:\Users\stefan\hg\master\lib\test\test_shutil.py", line 1137, in 
test_move_dangling_symlink
self.assertEqual(os.path.realpath(src), os.path.realpath(dst_link)) 

AssertionError: 'c:\\users\\stefan\\appdata\\local\\temp\\tmp7a4jc3\\baz' != 
'c:\\users\\stefan\\appdata\\lo
cal\\temp\\tmp9ucl3b\\quux' 

- c:\users\stefan\appdata\local\temp\tmp7a4jc3\baz  

?      ^^^  

+ c:\users\stefan\appdata\local\temp\tmp9ucl3b\quux 

?   ^^ + + 

--
components: Tests
messages: 154142
nosy: skrah
priority: normal
severity: normal
status: open
title: test_shutil: failures in symlink tests
type: behavior
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



[issue14102] argparse: add ability to create a man page

2012-02-24 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

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



[issue14103] argparse: add ability to create a bash_completion script

2012-02-24 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2012-02-24 Thread Nick Coghlan

Nick Coghlan  added the comment:

PEP section makes sense - I plan to mark PEP 3118 as Final once you commit this 
(or you can do that yourself, for that matter).

--

___
Python tracker 

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



[issue14081] Allow "maxsplit" argument to str.split() to be passed as a keyword argument

2012-02-24 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

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



[issue14095] type_new() removes __qualname__ from the input dictionary

2012-02-24 Thread Meador Inge

Meador Inge  added the comment:

The change in error handling makes this a bit harder to review, but it 
otherwise looks OK if this is the intended behavior.  I am not sure that it is.

The original version:

   1. If __qualname__ was present in the original dictionary,
  then it was deleted.
   2. If __qualname__ was present in the original dictionary,
  then the qualname slot in the new type was left unitialized.

Why (1) was done I don't know.  (2) is obviously a bug.

The patched version:

   1. Sets the slot qualname to the __qualname__ from the original
  dictionary (if present).
   2. Copies the __qualname__ attribute from the original dictionary
  to the new dictionary (if present).
   3. Leaves the original dictionary alone.

The deletion and unitiliazed slot problems are gone, but I am not sure if (2) 
is needed.  Just fixing (1) and (3) seems more reasonable to me.

--

___
Python tracker 

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



[issue14089] Patch to increase fractions lib test coverage

2012-02-24 Thread Oleg Plakhotnyuk

Changes by Oleg Plakhotnyuk :


Added file: http://bugs.python.org/file24630/test_fractions.patch

___
Python tracker 

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



[issue14089] Patch to increase fractions lib test coverage

2012-02-24 Thread Oleg Plakhotnyuk

Changes by Oleg Plakhotnyuk :


Removed file: http://bugs.python.org/file24605/test_fractions.patch

___
Python tracker 

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



[issue14107] Debian bigmem buildbot hanging in test_bigmem

2012-02-24 Thread Nadeem Vawda

New submission from Nadeem Vawda :

On the debian bigmem  buildbot, test_bigmem hangs until it gets killed
by a timeout:


http://www.python.org/dev/buildbot/all/builders/AMD64%20debian%20bigmem%203.x/builds/134/steps/test/logs/stdio

http://www.python.org/dev/buildbot/all/builders/AMD64%20debian%20bigmem%203.x/builds/131/steps/test/logs/stdio

http://www.python.org/dev/buildbot/all/builders/AMD64%20debian%20bigmem%203.x/builds/129/steps/test/logs/stdio

http://www.python.org/dev/buildbot/all/builders/AMD64%20debian%20bigmem%203.x/builds/128/steps/test/logs/stdio

http://www.python.org/dev/buildbot/all/builders/AMD64%20debian%20bigmem%203.x/builds/123/steps/test/logs/stdio

http://www.python.org/dev/buildbot/all/builders/AMD64%20debian%20bigmem%203.x/builds/85/steps/test/logs/stdio

This has happened on every run I've checked that hasn't crashed before
reaching test_bigmem for some other reason (e.g. the recently-fixed zlib
bus error), as far back as the buildbot history goes.

Issue 5438 might be related.

--
components: Tests
keywords: buildbot
messages: 154139
nosy: loewis, nadeem.vawda, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: Debian bigmem buildbot hanging in test_bigmem
type: behavior
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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2012-02-24 Thread Stefan Krah

Stefan Krah  added the comment:

Thanks, Nick. I'll try to get it done this weekend.

I've uploaded Misc/NEWS and Doc/whatsnew/3.3.rst (my apologies to Antoine 
for plagiarizing the first sentence, I found it hard to come up with a 
better version).

I wasn't sure whether to put the "whatsnew" entry into the section
"Other Language Changes" or into the PEP section. I chose the latter,
since many new features have been added that are part of the PEP.

--
Added file: http://bugs.python.org/file24629/issue10181-news.diff

___
Python tracker 

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



[issue5438] test_bigmem.test_from_2G_generator uses more memory than expected

2012-02-24 Thread Nadeem Vawda

Changes by Nadeem Vawda :


--
nosy: +nadeem.vawda

___
Python tracker 

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



[issue14106] Distutils manifest: recursive-(include|exclude) matches suffix instead of full filename

2012-02-24 Thread Nadeem Vawda

Changes by Nadeem Vawda :


--
dependencies: +Impossible to include file in sdist that starts with 'build' on 
Win32
stage: needs patch -> patch review

___
Python tracker 

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



[issue14106] Distutils manifest: recursive-(include|exclude) matches suffix instead of full filename

2012-02-24 Thread Nadeem Vawda

New submission from Nadeem Vawda :

As I understand it, a MANIFEST.in directive:

recursive-include foo bar.*

is meant to match files under foo for with names beginning with "bar.".
However, the actual regex that is generated for this line is:

r'^foo/.*bar\.[^/]*\Z(?ms)'

which matches any filename under foo that contains "bar." anywhere in the
base filename. For example, if foo contains files bar.py and test_bar.py,
then the pattern will match both filenames. Is this the intended
behaviour? I would have expected it to only match bar.py.

If the desired behavior is what I expected (and not how it currently
works), then the desired regex is:

r'^foo/(.*/)?bar\.[^/]*\Z(?ms)'

The attached patch (against 2.7) implements this change. It is dependent
on the fix for issue 6884. I have tested it on both Linux and Windows.

--
files: recursive-include.diff
keywords: patch
messages: 154137
nosy: eric.araujo, nadeem.vawda, tarek
priority: normal
severity: normal
stage: needs patch
status: open
title: Distutils manifest: recursive-(include|exclude) matches suffix instead 
of full filename
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file24628/recursive-include.diff

___
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-24 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

There were bugs in two of the updated tests:

- test_glob_to_re() was doing two levels of escaping (r'\' -> r'')
  for its expected output when it should only do one (r'\' -> r'\\').

- test_process_template() was not converting some of its expected
  results to use the native directory separator.

I've attached a patch that fixes these issues. I also took the liberty of
changing the checks for whether the separator needs to be escaped - it's
better to escape everything except "/", just in case someone decides to
port Python to some platform using a weird directory separator that is
neither "/" nor r"\".

With my updated patch, all tests pass on both Windows and Linux, and I've
also manually verified that the buildout.cfg problem and the
sandbox/dummy.py problem (from issue 9691) are both fixed.

Please review (and commit, if my changes are OK).

--
Added file: http://bugs.python.org/file24627/filelist-regex-v2.diff

___
Python tracker 

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



[issue14087] multiprocessing.Condition.wait_for missing

2012-02-24 Thread sbt

sbt  added the comment:

> Shouldn't the `for` loop be outside the outer `with` block?

Yes.

> In Lib/multiprocessing/managers.py:
> Is there a good reason why the wait_for() proxy method can't simply be
> implemented as:
> return self._callmethod('wait_for', (predicate, timeout))?
> 
> (There may be, I just didn't check).

That would only work if predicate is picklable, which is unlikely to be the 
case.  (The lambda functions used in the unit tests are not picklable.)

> Finally, the documentation should be updated 
> (Doc/library/multiprocessing.rst).

Fixed in new patch.

> Otherwise, it would probably be better if you could submit a contributor 
> agreement (and also maybe update your name on the tracker), unless that's
> a problem for you?

I will try to submit it over the weekend.

--
Added file: http://bugs.python.org/file24626/cond_wait_for.patch

___
Python tracker 

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



[issue6085] Logging in BaseHTTPServer.BaseHTTPRequestHandler causes lag

2012-02-24 Thread wmg

Changes by wmg :


--
nosy: +wmgaca

___
Python tracker 

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



[issue14061] Clean up archiving code in shutil

2012-02-24 Thread Nadeem Vawda

Nadeem Vawda  added the comment:

I don't think there's any harm in testing that the exception message for
a .bz2 file contains the string "unknown archive format". It's unlikely
that we'll want to completely change the error message in future, and if
we do, it will be pretty easy and obvious to fix.


> * unpack_archive raises ValueError when you give an unsupported value to its 
> format
>  parameter, but when it’s in autodetect mode and can’t find an unpacker for 
> the file
>  extension, then it raises a ReadError.  Is it okay to change that to 
> ValueError?

Sounds fine by me.

--

___
Python tracker 

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



[issue12817] test_multiprocessing: io.BytesIO() requires bytearray buffers

2012-02-24 Thread Stefan Krah

Stefan Krah  added the comment:

The current interpretation in the PEP-3118 repo is that a request
without PyBUF_FORMAT means "implicit cast to unsigned bytes".

This makes the behavior of PyObject_AsWriteBuffer() correct, so I'm
closing this.

--
resolution:  -> invalid
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



[issue9056] Adding additional level of bookmarks and section numbers in python pdf documents.

2012-02-24 Thread Ezio Melotti

Changes by Ezio Melotti :


--
stage:  -> needs patch
type:  -> enhancement

___
Python tracker 

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



[issue1116520] Prefix search is filesystem-centric

2012-02-24 Thread Ezio Melotti

Changes by Ezio Melotti :


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



[issue1531415] parsetok.c emits warnings by writing to stderr

2012-02-24 Thread Ezio Melotti

Changes by Ezio Melotti :


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



[issue12817] test_multiprocessing: io.BytesIO() requires bytearray buffers

2012-02-24 Thread Ezio Melotti

Changes by Ezio Melotti :


--
versions:  -Python 3.1

___
Python tracker 

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



  1   2   >