[issue9253] argparse: optional subparsers

2011-09-24 Thread Benjamin West

Benjamin West bew...@gmail.com added the comment:

I spent some time looking at this, as I was interested in
using this pattern to simulate what git and hg do.  I
considered a few modifications and then found this bug.  I
think the default keyword passed to
_SubParsersAction.__init__ makes sense.

I started on a patch, that looks promising, but I'm having
trouble getting the regexp right.

Here's a changeset higlighting where I think the
problematic regexp is:
https://bitbucket.org/bewest/argparse/changeset/938e1e91ddd0

https://gist.github.com/1202975#file_test_opt_subcommand.py
Is the meager little test I put together.

--
hgrepos: +68
nosy: +Benjamin.West

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



[issue12973] int_pow() implementation is incorrect

2011-09-24 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset b378864d8ff3 by Mark Dickinson in branch '3.2':
Issue #12973: Fix itertools bug caused by signed integer overflow.  Thanks 
Stefan Krah.
http://hg.python.org/cpython/rev/b378864d8ff3

New changeset 18eec56bcf29 by Mark Dickinson in branch 'default':
Merge #12973 itertools fix.
http://hg.python.org/cpython/rev/18eec56bcf29

--

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



[issue12973] int_pow() implementation is incorrect

2011-09-24 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 5a1cb8506cea by Mark Dickinson in branch '2.7':
Backport issue #12973 itertools fix from 3.x.
http://hg.python.org/cpython/rev/5a1cb8506cea

--

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



[issue12973] int_pow() implementation is incorrect

2011-09-24 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Okay, all fixed here.  Let's add any further signed overflow issues to the 
issue #1621 discussion.

--
resolution:  - fixed
status: open - closed

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



[issue13012] Allow keyword argument in str.splitlines()

2011-09-24 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 0b2660384d4e by Mark Dickinson in branch 'default':
Issue #13012: Allow 'keepends' to be passed as a keyword argument in 
str.splitlines, bytes.splitlines and bytearray.splitlines.
http://hg.python.org/cpython/rev/0b2660384d4e

--
nosy: +python-dev

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



[issue13012] Allow keyword argument in str.splitlines()

2011-09-24 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Thanks for the reviews.

Applied the first patch, plus Misc/NEWS entry, and minus the change to 
Lib/collections/__init__.py;  I think that change belongs more with the second 
patch.

--

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



[issue1621] Do not assume signed integer overflow behavior

2011-09-24 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Resetting versions.

--
versions: +Python 3.3 -Python 2.6, Python 3.1

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



[issue13008] syntax error when pasting valid snippet into console without empty string after the function def

2011-09-24 Thread Georg Brandl

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

Closing as per python-dev discussion.

--
nosy: +georg.brandl
status: languishing - closed

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



[issue1621] Do not assume signed integer overflow behavior

2011-09-24 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Clang has an -ftrapv option that seems to be less buggy and more complete than 
gcc's.  Compiling and running the test suite with that option enabled looks 
like a good way to catch a lot of these signed overflows.

--

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



[issue13013] _ctypes.c: refleak

2011-09-24 Thread Georg Brandl

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

I vote for plugging the refleak and keeping the function non-static.

--
nosy: +georg.brandl

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



[issue13019] bytearrayobject.c: refleak

2011-09-24 Thread Georg Brandl

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

Both hunks look reasonable.

--
nosy: +georg.brandl

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



[issue13015] _collectionsmodule.c: refleak

2011-09-24 Thread Georg Brandl

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

Looks correct but awkwardly indented.

--
nosy: +georg.brandl

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



[issue13040] call to tkinter.messagebox.showinfo hangs the script

2011-09-24 Thread Richard86

New submission from Richard86 gbo...@gmail.com:

Call to tkinter.messagebox.showinfo(Test, test) makes the script hang in 
Windows 7 with Python 3.2.2 with Timer(2, methodname, ()).start().

--
components: Tkinter, Windows
files: test1.py
messages: 144496
nosy: Richard86
priority: normal
severity: normal
status: open
title: call to tkinter.messagebox.showinfo hangs the script
type: crash
versions: Python 3.2
Added file: http://bugs.python.org/file23236/test1.py

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



[issue13040] call to tkinter.messagebox.showinfo hangs the script after timer

2011-09-24 Thread Richard86

Changes by Richard86 gbo...@gmail.com:


--
title: call to tkinter.messagebox.showinfo hangs the script - call to 
tkinter.messagebox.showinfo hangs the script after timer

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



[issue13012] Allow keyword argument in str.splitlines()

2011-09-24 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

Ezio's patch looks fine to me, though as Meador points out in the Rietveld 
review, there are a couple of omissions that could be fixed.

Personally, I'm not so convinced of the value of upgrading all the existing 
uses of splitlines to use 'keepends';  I just wanted to be able to do this in 
*new* code. :-)  I guess I'm +0 on the int - bool changes (replacing 
.splitlines(1) with .splitlines(True)), and -0 on adding the extra 'splitlines' 
keywords throughout existing source.

--

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



[issue13012] Allow keyword argument in str.splitlines()

2011-09-24 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

 Out of curiosity, what is typically the convention on that?

In theory every issue should be about a single problem and therefore have a 
single patch to fix it.  Sometimes a secondary problem that is not strictly 
related to the first one arises, for example when a cleanup is necessary before 
applying the patch, or when a new feature is added and a few places get changed 
to use it.  In these cases is not worth opening another issue, so both the 
patches are attached to the same issue, but committed separately because they 
address two different problems.

 Sometime people forget to add a News or Acks entry and have to
 followup with an addendum. (Mark's patch still lack that, for 
 instance.)

Avoiding to include the NEWS entry in patches is common, because the file gets 
updated often and it will most likely cause conflicts.  `make patchcheck` 
remind us to add it -- assuming you don't forget to use it.

 Ezio's patch looks fine to me, though as Meador points out in the 
 Rietveld review, there are a couple of omissions that could be fixed.

Adding keepends there would have made the line too long, required some 
splitting and probably made the code less readable overall, so I prefer to keep 
it out.

 Personally, I'm not so convinced of the value of upgrading all the
 existing uses of splitlines to use 'keepends'; I just wanted to be
 able to do this in *new* code. :-)

If we can make old code more readable too and we already have a patch to do it, 
why not?  (one instance also had the comment # True == keep line ends)

--

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



[issue1621] Do not assume signed integer overflow behavior

2011-09-24 Thread Martin v . Löwis

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

Do we consider these overflows as bugs in Python, or do we declare that we 
expect compilers to do the right thing for the bug fix releases (i.e. care 
only about the default branch). I'd personally vote for the latter - i.e. don't 
apply any of the resulting changes to the maintenance releases, and target the 
issue only for 3.3.

Realistically, a compiler that invokes truly undefined behavior for signed 
overflow has no chance of getting 3.2 compiled correctly, and we have no chance 
of finding all these issues within the lifetime of 3.2.

If that is agreed, I would start committing changes that fix the issues Mark 
already discussed in 2009 (unless he wants to commit them himself).

--
priority: high - normal

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



[issue13023] argparse should allow displaying argument default values in addition to setting a formatter class

2011-09-24 Thread Denilson Figueiredo de Sá

Denilson Figueiredo de Sá denilso...@gmail.com added the comment:

 adding a formatter instance seems overkill for the usual case of
 wanting to preserve formatting of the epilog.

Related bug (look at it before (re)designing the API):
http://bugs.python.org/issue12806

--

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



[issue1621] Do not assume signed integer overflow behavior

2011-09-24 Thread Mark Dickinson

Mark Dickinson dicki...@gmail.com added the comment:

 don't apply any of the resulting changes to the maintenance releases,
 and target the issue only for 3.3.

That sounds fine to me, though if we find more instances of signed overflow 
that actually trigger test failures in the maintenance branches (like the 
int_pow one) on mainstream compilers, we might want to fix those there too, on 
a case-by-case basis.

To get started, here's a patch that fixes occurrences of signed overflow in the 
bytes, str and tuple hash methods, and also in set lookups.  It also fixes a 
related and minor casting inconsistency in dictobject.c  (which was using 
(size_t)hash  mask in some places, and just 'hash  mask' in others).  These 
are the minimal changes required to get Python to build completely using Clang 
with '-ftrapv' turned on and --with-pydebug enabled.

--
versions:  -Python 2.7, Python 3.2
Added file: http://bugs.python.org/file23237/issue1621_hashes_and_sets.patch

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



[issue2193] Cookie Colon Name Bug

2011-09-24 Thread Luke Plant

Luke Plant l.plant...@cantab.net added the comment:

David,

Thanks again for the time on this. Can I push to get the patches included, or 
is there work that still needs to be done on the patches now that the idea is 
accepted in principle? I did experiment with a few approaches to implement, and 
it seemed like the most sensible.

Thanks,

Luke

--

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



[issue1621] Do not assume signed integer overflow behavior

2011-09-24 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 698fa089ce70 by Mark Dickinson in branch 'default':
Issue #1621: Fix undefined behaviour in bytes.__hash__, str.__hash__, 
tuple.__hash__, frozenset.__hash__ and set indexing operations.
http://hg.python.org/cpython/rev/698fa089ce70

--
nosy: +python-dev

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



[issue12981] rewrite multiprocessing (senfd|recvfd) in Python

2011-09-24 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 95ee0df1e746 by Charles-François Natali in branch 'default':
Issue #12981: rewrite multiprocessing_{sendfd,recvfd} in Python.
http://hg.python.org/cpython/rev/95ee0df1e746

--

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



[issue1621] Do not assume signed integer overflow behavior

2011-09-24 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 5e456e1a9e8c by Mark Dickinson in branch 'default':
Issue #1621: Fix undefined behaviour from signed overflow in get_integer 
(stringlib/formatter.h)
http://hg.python.org/cpython/rev/5e456e1a9e8c

--

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



[issue13040] call to tkinter.messagebox.showinfo hangs the script on timer on Windows

2011-09-24 Thread Richard86

Changes by Richard86 gbo...@gmail.com:


--
title: call to tkinter.messagebox.showinfo hangs the script after timer - call 
to tkinter.messagebox.showinfo hangs the script on timer on Windows

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



[issue13012] Allow keyword argument in str.splitlines()

2011-09-24 Thread Terry J. Reedy

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

Given that someone is willing to write a patch and someone else to review it, I 
am +1 on changing 0/1 to False/True anywhere appropriate in the stdlib. Ditto 
for using a new feature. The # True == keep line ends comment illustrates why 
the original patch is a good idea.

--

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



[issue12353] argparse cannot handle empty arguments

2011-09-24 Thread Zbyszek Szmek

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


--
nosy: +zbysz

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12353
___
___
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

2011-09-24 Thread Zbyszek Szmek

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


--
nosy: +zbysz

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



[issue13041] argparse: terminal width is not detected properly

2011-09-24 Thread Zbyszek Szmek

New submission from Zbyszek Szmek zbys...@in.waw.pl:

COLUMNS is a shell variable (updated whenever the window size
changes), that usually isn't exported to programs. Therefore checking
for COLUMNS in sys.environ will not work in the majority of cases. The
proper check is to use the TIOCGWINSZ ioctl on stdout.

Why COLUMNS is not exported? Because it can change during the lifetime
of a program. Therefore it is better to use the dynamic ioctl.

--
components: Library (Lib)
files: patch1.diff
keywords: patch
messages: 144507
nosy: zbysz
priority: normal
severity: normal
status: open
title: argparse: terminal width is not detected properly
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file23238/patch1.diff

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



[issue13042] argparse: terminal width is not detected properly

2011-09-24 Thread Zbyszek Szmek

New submission from Zbyszek Szmek zbys...@in.waw.pl:

COLUMNS is a shell variable (updated whenever the window size
changes), that usually isn't exported to programs. Therefore checking
for COLUMNS in sys.environ will not work in the majority of cases. The
proper check is to use the TIOCGWINSZ ioctl on stdout.

Why COLUMNS is not exported? Because it can change during the lifetime
of a program. Therefore it is better to use the dynamic ioctl.

--
components: Library (Lib)
files: patch1.diff
keywords: patch
messages: 144508
nosy: zbysz
priority: normal
severity: normal
status: open
title: argparse: terminal width is not detected properly
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file23239/patch1.diff

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



[issue13041] argparse: terminal width is not detected properly

2011-09-24 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +bethard

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



[issue13042] argparse: terminal width is not detected properly

2011-09-24 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
resolution:  - duplicate
stage:  - committed/rejected
status: open - closed
superseder:  - argparse: terminal width is not detected properly

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



[issue2193] Cookie Colon Name Bug

2011-09-24 Thread R. David Murray

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

I'm flat out right now on other projects.  But if no one else gets around to 
doing a final review and commit I should be able to get to it by the end of 
October.  If I don't, please ping me by posting here again.

--

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



[issue12806] argparse: Hybrid help text formatter

2011-09-24 Thread Zbyszek Szmek

Zbyszek Szmek zbys...@in.waw.pl added the comment:

This is a great idea! I think that this formatter is much more useful than the 
default one. I was pretty surprised the first time I added a multi-paragraph 
epilog to a program and it got all jumbled into a single line. I would vote to 
make this (or a variant, see the comments below) the default formatter for the 
description and epilog fields.

Notes on the interface (a bit of bike-shedding :)):

Continuation backslashes are best avoided. Other means, like parenthesis in 
case of expressions, are encouraged to avoid adding backslashes. Continuation 
symbols also interfere with paragraph reflowing in text editors.
Using backslash continuations wouldn't be necessary, if the rules were slightly 
changed to be more LaTeX like: just line-wrap paragraphs, and paragraphs are 
separated by a blank line. This would make it impossible to have two 
line-wrapped parts not separated by an empty line, but I think that this is 
less common and less important than having a natural representation of 
paragraphs.

In current implementation, lines that are not wrapped (IIUC) are those which 
start with *, +, , anything., or something). This seems error prone. Maybe 
it would be better to just detect lines which are indented at least one space 
in comparison to the first line. This would work for examples and lists:

this is a text that is subject to line-wrapping
  and this line not
and this line would again be wrapped:
  - and a line, not merged with the one above or below
  - and a second point, not merged with the one above


Review of argparse_formatter.py:
 list_match = re.match(r'( *)(([*-+]+|\w+\)|\w+\.) +)',line)
 A dash '-' has special meaning in brackets:
  [*-+] means (characters in range from '*' to '+', or '').
 Because star and plus are adjacent in ASCII, this is equivalent to
  [*+]
 but quite unclear.

  if(list_match):
Parenthesis unnecessary.

 lines = list()
Why not just 'lines = []'?

One a side note: due to #13041 the terminal width is normally stuck
at 80 chars.

--
nosy: +zbysz

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



[issue13042] argparse: terminal width is not detected properly

2011-09-24 Thread Zbyszek Szmek

Zbyszek Szmek zbys...@in.waw.pl added the comment:

Hm, I have somehow submitted the same tex ttwwiiccee. Sorry about that.

--

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



[issue9253] argparse: optional subparsers

2011-09-24 Thread Benjamin West

Benjamin West bew...@gmail.com added the comment:

https://github.com/bewest/argparse/tree/bewest
https://bitbucket.org/bewest/argparse/changesets

I think this does the right thing.

--
hgrepos: +69

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



[issue12806] argparse: Hybrid help text formatter

2011-09-24 Thread Graylin Kim

Graylin Kim graylin@gmail.com added the comment:

I fully support taking blank line based line-wrapping approach and agree with 
Zbyszek's suggested indentation approach as well. I am not sure why they didn't 
occur to me at the time but they are certainly a more effective and widely 
adopted approaches to the structured text problem.

I suppose here is where I should volunteer to update the patch file...


Re: Bike-shedding

dash '-' has special meaning in brackets:

Good catch, I had intended on '-' being a valid list item character. It clearly 
needs to be escaped. Not that it would matter given your proposed alternative.

  if(list_match):
Parenthesis unnecessary.

In my defense I have the sadistic pleasure of coding in PHP where they are 
necessary for 8 hours a day for my day job. I can only apologize profusely for 
my offense and beg for forgiveness :)

 lines = list()
Why not just 'lines = []'?

Not to get off topic, but I happen to like list() and dict() instead of [] and 
{} for empty collections. If there are non-religious reasons for avoiding this 
practice I'll consider it. I don't want to invoke a holy war here, just 
wondering if there are practical reasons.

One a side note: due to #13041 the terminal width is normally stuck
at 80 chars.

Not a good reason to remove the flexibility from the implementation I don't 
think.

--

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



[issue13033] Add shutil.chowntree

2011-09-24 Thread Tigger Level-5

Tigger Level-5 a.wild.tig...@gmail.com added the comment:

First time posting, how about something like this. Just added a os.walk method 
to do the chown recursively.

--
nosy: +Tigger.Level-5
Added file: http://bugs.python.org/file23240/temp.py

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



[issue11751] Increase distutils.filelist / packaging.manifest test coverage

2011-09-24 Thread Éric Araujo

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

 Sorry, it's been sitting at the bottom of my starred list for months,
 the prospect of reloading context always making it a little less
 attractive than something else.
I understand that very well :)

 Error was caused by an actual change in behavior
Ah, good, I had missed that change.  I’ll just adapt the test to check that 
one-word == include.

I think I won’t add the Manifest._actions attribute as in your patch; it does 
not cost much to have the list once in manifest and another time in 
test_manifest.

The only change I’ll make (or maybe you’d like to do it?) before committing is 
to add a test to make sure the line marked with “this cannot happen” really 
cannot happen.

--

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



[issue12944] Accept arbitrary files for packaging's upload command

2011-09-24 Thread Éric Araujo

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

 I'm not sure why it's run upload instead of just upload
pysetup has actions and commands.  Actions do stuff on the Python installation: 
“pysetup metadata foobar” prints metadata, “pysetup remove foobar” uninstalls, 
“pysetup install foobar” fetches from PyPI and installs, etc.  Commands are 
like distutils commands, they work on a project in a source directory; for 
namespacing reasons, they are subitems of the run command.  (I’m working on 
documenting that.)

 Apart from that, this looks like a vast improvement to me.
Good!  Adding the easy keyword, as it’s not hard to implement if one 
understands how upload works, or someone could add tests without much 
difficulty.  I may get to it myself shortly, it will make a nice change from 
bug fixes and improve my karma :)

--
keywords: +easy
stage:  - needs patch

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



[issue13041] argparse: terminal width is not detected properly

2011-09-24 Thread Denilson Figueiredo de Sá

Changes by Denilson Figueiredo de Sá denilso...@gmail.com:


--
nosy: +denilsonsa

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



[issue12961] itertools: unlabelled balls in boxes

2011-09-24 Thread Phillip Feldman

Phillip Feldman phillip.m.feld...@gmail.com added the comment:

Raymond-

I think that you may have overestimated the complexity of the problem.  In 
about 5 hours, I coded, debugged, and documented a set of generator functions 
to solve the general formulation (including box limits) for three occupancy 
problems:

- unlabeled balls in labeled boxes,
- unlabeled_balls_in_unlabeled_boxes, and
- labeled_balls_in_unlabeled_boxes.

(I will add labeled balls in labeled boxes, although this case is less 
interesting).

On the other hand, I agree with your comment that the general need for these 
has not yet been demonstrated.  I will post my code to PyPI and we'll see what 
happens.

--

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



[issue12806] argparse: Hybrid help text formatter

2011-09-24 Thread Denilson Figueiredo de Sá

Denilson Figueiredo de Sá denilso...@gmail.com added the comment:

 Good catch, I had intended on '-' being a valid list item character.
 It clearly needs to be escaped.

Either escaped, or it can be the first character in the set.

 but I happen to like list() and dict() instead of [] and {} for
 empty collections.

I just checked PEP 8, and unfortunately this is not mentioned in there. Maybe 
you could open a new issue (or post in a mailing list) to ask about which style 
should be recommended, and then add the conclusion to PEP 8.

 One a side note: due to #13041 the terminal width is normally stuck
 at 80 chars.

Getting the console width (and height) is something so common that I believe 
there should be a built-in Python library for doing that. And it's also 
something hard to do correctly (get COLUMNS variable, or use ioctl, or trap 
SIGWINCH signal, or do something completely different on non-unix, or fallback 
to hardcoded default or user-supplied default)

What's more, since built-in argparse module needs this feature, that is another 
good reason to get it inside standard Python library. It has been proposed 
before, but the issue was closed: #8408

Anyway, although I believe this is important, it is off-topic in this issue.

--

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