[issue15245] ast.literal_eval fails on some literals

2012-07-05 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

Ah right, that's confusing indeed...

Unit tests and doc updates are needed though.

--

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



[issue15257] Misc/.gdbinit:pystack is too brittle

2012-07-05 Thread rian

New submission from rian r...@dropbox.com:

the `pystack`, `pystackv`, and `printframe` macros in the sample gdbinit file 
distributed with python are too fragile. this patch (which relies on gdb 7) is 
much more robust.

--
components: None
files: mypatch.diff
keywords: patch
messages: 164701
nosy: rian
priority: normal
severity: normal
status: open
title: Misc/.gdbinit:pystack is too brittle
Added file: http://bugs.python.org/file26263/mypatch.diff

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



[issue15258] argparse documentation: Improve optparse section regarding allow_interspersed_args

2012-07-05 Thread Nefarious CodeMonkey, Jr.

New submission from Nefarious CodeMonkey, Jr. nejuc...@users.sourceforge.net:

It was not obvious from the documentation on argparse how to emulate the 
optparse.OptionParser.allow_interspersed_args feature.

Please add something like the following to the section titled Upgrading 
optparse code (see: 
http://docs.python.org/library/argparse.html#upgrading-optparse-code )


* If the optparse code sets allow_interspersed_args to False, then add an 
argparse positional argument with nargs=argparse.REMAINDER


--
assignee: docs@python
components: Documentation
messages: 164702
nosy: docs@python, nejucomo
priority: normal
severity: normal
status: open
title: argparse documentation: Improve optparse section regarding 
allow_interspersed_args
type: enhancement
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4

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



[issue15257] Misc/.gdbinit:pystack is too brittle

2012-07-05 Thread rian

Changes by rian r...@dropbox.com:


--
components: +Demos and Tools -None

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



[issue15257] Misc/.gdbinit:pystack is too brittle

2012-07-05 Thread rian

Changes by rian r...@dropbox.com:


--
versions: +Python 3.2, Python 3.3, Python 3.4

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



[issue15259] Helping with Documentation references missing dailybuild.py

2012-07-05 Thread Chris Jerdonek

New submission from Chris Jerdonek chris.jerdo...@gmail.com:

The intro to the Helping with Documentation section of the Developer's Guide--

http://docs.python.org/devguide/docquality.html#helping-with-documentation

includes a reference to a Doc/tools/dailybuild.py script, but this script does 
not seem to exist in the source tree.

--
components: Devguide
keywords: easy
messages: 164703
nosy: cjerdonek, ezio.melotti
priority: normal
severity: normal
status: open
title: Helping with Documentation references missing dailybuild.py
versions: Python 3.3

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



[issue15260] Mention how to order Misc/NEWS entries

2012-07-05 Thread Chris Jerdonek

New submission from Chris Jerdonek chris.jerdo...@gmail.com:

I think it would help if the Commit Messages and NEWS Entries subsection of 
the Developer's Guide said something about where in the ordering new Misc/NEWS 
entries should be added (e.g. at the top or bottom or by importance):

http://docs.python.org/devguide/committing.html?highlight=news#commit-messages-and-news-entries

The only reference I could find was an indirect reference in the section about 
the Developer Log:

http://docs.python.org/devguide/developers.html

--
components: Devguide
keywords: easy
messages: 164704
nosy: cjerdonek, ezio.melotti
priority: normal
severity: normal
status: open
title: Mention how to order Misc/NEWS entries
versions: Python 3.3

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



[issue15245] ast.literal_eval fails on some literals

2012-07-05 Thread João Bernardo

Changes by João Bernardo jbv...@gmail.com:


Added file: http://bugs.python.org/file26264/ast.py_with_tests.diff

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



[issue15261] os.stat(fd) crashes on Windows if fd does not exist

2012-07-05 Thread Richard Oudkerk

New submission from Richard Oudkerk shibt...@gmail.com:

In Python 3.3 (but not earlier) os.stat() is documented to work with file 
descriptors.  (os.path.exists() also works with fds since it is implemented in 
terms of os.stat(), although that is *not* documented.)

However, on Windows if fd is not open then os.stat(fd) triggers an assertion 
error or crash:

  File: f:\dd\vctools\crt_bld\self_x86\crt\src\osfinfo.c
  Line: 316
  Expression: (_osfile(fh)  FOPEN)

Note that os.fstat() fails on Windows with OSError(EBADF, ...).

--
messages: 164705
nosy: sbt
priority: high
severity: normal
stage: needs patch
status: open
title: os.stat(fd) crashes on Windows if fd does not exist
type: crash
versions: Python 3.3

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



[issue15261] os.stat(fd) crashes on Windows if fd does not exist

2012-07-05 Thread Richard Oudkerk

Richard Oudkerk shibt...@gmail.com added the comment:

This can probably be fixed by using _PyVerify_fd().

--

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



[issue15250] document that filecmp.dircmp comparisons are shallow

2012-07-05 Thread Chris Jerdonek

Changes by Chris Jerdonek chris.jerdo...@gmail.com:


--
keywords: +patch
stage: needs patch - patch review
Added file: http://bugs.python.org/file26265/issue15250-1.patch

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



[issue15245] ast.literal_eval fails on some literals

2012-07-05 Thread Éric Araujo

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

Thanks for the patch.  It looks good to me, but I think that adding support for 
Ellipsis and adding a new parameter to allow extra names are two different 
requests, but someone more knowledgeable than me about AST may judge 
differently.  My rationale is that supporting Ellipsis literals is a no-brainer 
addition, whereas adding an argument to support things that are not actual 
Python literals may be rejected.  You don’t have to split your patch in two 
anyway, it’s easy to do if the dev who will commit wants to.

Each change would also need a doc update.

--
stage: test needed - patch review

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



[issue15257] Misc/.gdbinit:pystack is too brittle

2012-07-05 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue15245] ast.literal_eval fails on some literals

2012-07-05 Thread João Bernardo

João Bernardo jbv...@gmail.com added the comment:

Just to be sure: What's a doc update? The `.rst` files are updated 
automatically with the doc strings?

The adding another argument should require a:
Changed in version 3.x: Accepts a second argument ... ?

--

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



[issue15245] ast.literal_eval fails on some literals

2012-07-05 Thread Éric Araujo

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

No, the rst documentation is maintained manually.

Look for versionchanged in the doc source files or the documentation about 
writing documentation to see how to document the new argument (and new 
supported Ellipsis literal).

--

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



[issue15245] ast.literal_eval fails on some literals

2012-07-05 Thread João Bernardo

Changes by João Bernardo jbv...@gmail.com:


Added file: http://bugs.python.org/file26266/ast.py_tests_doc.diff

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



[issue15246] Line coverage for collectionts.abc.Set

2012-07-05 Thread James King

James King ja...@agentultra.com added the comment:

How about a working test instead? Let me know if it looks right.

--
Added file: http://bugs.python.org/file26267/set_abc_coverage.patch

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



[issue15248] In TypeError: 'tuple' object is not callable, explain that a comma may be missing

2012-07-05 Thread Steven D'Aprano

Steven D'Aprano steve+pyt...@pearwood.info added the comment:

I think this suggested enhancement is unreasonable and of limited usefulness, 
and even if it were useful, too specialised to bother with.

The obvious message is badly misleading. When I read this:

TypeError: 'tuple' object is not callable, a comma may be missing

I look inside the tuple for a missing comma. But that's not the problem, and 
the error message sends me on a wild goose chase wondering how on earth a 
missing comma causes Python to try calling my tuple. I've been programming in 
Python for 15+ years and it mislead me -- what do you think it will do to 
beginners?

The problem is that the tuple is inside a list, and the LIST is missing a comma.

What about this example?

result = function(
the error has nothing to do with tuples  # oops missed a comma
(2, 3, 4),
None
)

Should the error message say something like:

TypeError: 'str' object is not callable, perhaps it is embedded in a list, 
tuple, 
function call or some other place you need a comma, and you forgot one 
or more commas?

I don't think so. Besides, most of the time when you get this TypeError, it 
will be because you genuinely tried to call what you thought was a function but 
wasn't, and the hint is pointless.

You tried to call a tuple as if it were a function. The reason for that is that 
you left out a comma in a list, but there are many other reasons that could 
happen, and I frequently forget to add commas to lists is a far 
too-specialised failure mode to single it out in the error message.

It is unreasonable to expect Python to debug your code for you. It tells you 
what you did wrong -- you called a tuple as a function -- and it is up to you 
to determine why.

--
nosy: +stevenjd

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



[issue15231] update PyPI upload doc to say --no-raw passed to rst2html.py

2012-07-05 Thread Chris Jerdonek

Changes by Chris Jerdonek chris.jerdo...@gmail.com:


--
keywords: +patch
stage:  - patch review
Added file: http://bugs.python.org/file26268/issue-15231-1.patch

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



[issue15009] urlsplit can't round-trip relative-host urls.

2012-07-05 Thread Buck Golemon

Buck Golemon buck.gole...@amd.com added the comment:

Let's examine x://

absolute-URI  = scheme : hier-part [ ? query ]
hier-part = // authority path-abempty

So this is okay if authority and path-abempty can both be empty strings.

authority = [ userinfo @ ] host [ : port ]
host  = IP-literal / IPv4address / reg-name
reg-name  = *( unreserved / pct-encoded / sub-delims )
path-abempty  = *( / segment )

Yep.

And the same applies for x:///y, except that path-abempty matches /y
instead of nothing.

This means these are in fact valid urls per RFC3986, counter to your claim.

--
nosy: +bukzor

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



[issue14202] The docs of xml.dom.pulldom are almost nonexistent

2012-07-05 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


--
status: open - closed

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



[issue1767933] Badly formed XML using etree and utf-16

2012-07-05 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:

Serhiy, note that _SimpleElementPath is now gone in 3.3, since ElementPath.py 
is always there in stdlib. Could you update the patch to reflect this?

Another thing. I'm trying really hard to phase out the doctest tests of etree, 
replacing them with unittest-based tests as much as possible. The doctests are 
causing all kinds of trouble with parametrized testing for both the Python and 
the C implementations. Please don't add new doctests. If you add tests, add 
them to existing TestCase classes, or create new ones.

--

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



[issue9458] xml.etree.ElementTree.ElementTree.write(): encoding handling problems

2012-07-05 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:

Please make sure that the patch(es) apply cleanly to 3.3, since this is the 
version I'll be focusing on.

--

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



[issue14988] _elementtree: Raise ImportError when importing of pyexpat fails

2012-07-05 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


--
components: +Library (Lib)
stage:  - test needed
versions: +Python 3.4 -Python 3.2

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



[issue14377] Modify serializer for xml.etree.ElementTree to allow forcing the use of long tag closing

2012-07-05 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:

I see no harm in modifying the signature of the private _serialize_* functions 
to accept another argument or dict of options.

--

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



[issue15248] In TypeError: 'tuple' object is not callable, explain that a comma may be missing

2012-07-05 Thread Ben Longbons

Ben Longbons b.r.longb...@gmail.com added the comment:

This kind of debug your code is the kind of thing I've gotten used to from 
the Clang C/C++ compiler. Granted, compiled languages have an advantage here, 
but enough residual information remains for the interpreter at runtime.

And I am in no way suggesting that *every* attempt to call a non-function have 
the extra information.

For the cases where the error message is given, something like:
TypeError: 'tuple' object is not callable (missing preceding comma?)

The case of a homogenous container is the most important case.

I've offered two different ways to figure out whether it's a typo or an attempt 
to call an object that you honestly think is callable:
1. Is the called object a newly-constructed (refcount=1) tuple literal? (Also 
works for list, set, and dictionary literals; probably wouldn't work for string 
literals due to interning)
2. Does the false call occur within a container literal or function call?

I'm not intimately familiar with python bytecode or interpreter, but I'm sure 
anyone who is could extract this information.

--

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



<    1   2