[issue15252] Delivery reports about your e-mail

2012-07-05 Thread Larry Hastings

Changes by Larry Hastings :


--
nosy:  -larry

___
Python tracker 

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



[issue15252] Delivery reports about your e-mail

2012-07-05 Thread Larry Hastings

Larry Hastings  added the comment:

What fresh hell is this?  Bob, do you have a virus or something?

--
nosy: +larry

___
Python tracker 

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



[issue15242] PyImport_GetMagicTag() should use the same const char * as sys.implementation.cache_tag

2012-07-05 Thread Larry Hastings

Larry Hastings  added the comment:

Sorry for the pedantry, but: I read the title of this bug as wanting these two 
values to be the exact same pointer.  If you're talking about putting a 
constant string in a header file, you'll get an (identical) copy of that string 
in every .o that references it (unless your linker collapses identical strings, 
which I don't know if they do).

>From the description, it sounds like you want them to merely be guaranteed 
>identical strings, but they don't have to be the same exact pointer.

tl;dr: do you mean "=="?  the title implies you mean "is".

--
nosy: +larry

___
Python tracker 

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



[issue15253] xmlrpclib.ServerProxy does not support 2-tuple value for uri parameter

2012-07-05 Thread Vincent Pelletier

New submission from Vincent Pelletier :

SafeTransport class supports a 2-tuple as uri, in order to pass x509 parameters 
to httplib.HTTPSConnection .
xmlrpclib.ServerProxy.__init__ fails when given such tuple, because it calls:
  urllib.splittype(uri)
without checking uri type first.

Minimal test case to reproduce is:

import xmlrpclib
xmlrpclib.ServerProxy(('https://example.com', {}))

--
messages: 164676
nosy: vpelletier
priority: normal
severity: normal
status: open
title: xmlrpclib.ServerProxy does not support 2-tuple value for uri parameter
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



[issue15253] xmlrpclib.ServerProxy does not support 2-tuple value for uri parameter

2012-07-05 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

This is not a bug; the uri parameter is documented as an URI.

Your report can be considered as a feature request (for supporting non-URI 
values for the uri parameter), however, Python 2 is closed for new features, so 
this could only be added for 3.x.

Closing this as "won't fix". See

http://www.velocityreviews.com/forums/t710620-python-xmlrpc-client-with-ssl-client-certificates-and-standard-modules.html#post_message_4004113

for a possible work-around.

--
nosy: +loewis
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue15253] xmlrpclib.ServerProxy does not support 2-tuple value for uri parameter

2012-07-05 Thread Vincent Pelletier

Vincent Pelletier  added the comment:

Then I guess SafeTransport should be cleaned to remove its dead code (tuple 
host handling), and the class you link to should be included (in spirit if not 
verbatim) in xmlrpclib.

Also, sorry, I realized after posting that this bug is a dupe of #1581. But the 
closing reason here is more convincing to me than on #1581.

Thanks.

--

___
Python tracker 

___
___
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 Mark Dickinson

Mark Dickinson  added the comment:

> I don't think literal_eval should handle anything which is not syntax.
+1

-1 on supporting 'inf' and 'nan'
-0 on supporting 'Ellipsis' or '...';  seems harmless, but I don't really see 
the point.

--

___
Python tracker 

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



[issue15252] Delivery reports about your e-mail

2012-07-05 Thread Bob Ippolito

Bob Ippolito  added the comment:

I doubt it, it's more likely that this email came from somewhere else with
my address.

On Thursday, July 5, 2012, Larry Hastings wrote:

>
> Larry Hastings > added the comment:
>
> What fresh hell is this?  Bob, do you have a virus or something?
>
> --
> nosy: +larry
>
> ___
> Python tracker >
> 
> ___
>

--

___
Python tracker 

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



[issue15252] Delivery reports about your e-mail

2012-07-05 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
resolution:  -> invalid
status: open -> closed

___
Python tracker 

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



[issue15254] 08 is invalid token in lists.

2012-07-05 Thread Chris Wright

New submission from Chris Wright :

Python 2.6.6 tk 8.5
Idle 2.6.6

I was trying to generate a multidimensional list, and my test list kept giving 
errors highlighting 08 as an invalid token.

>>> cube = 
>>> [[[01,02,03],[04,05,06],[07,08,09]],[[11,12,13],[14,15,16],[17,18,19]],[[21,22,3],[24,25,26],[27,28,29]]]
SyntaxError: invalid token
>>> cube = [[[01,02,03,04,05,06,07,08]]
SyntaxError: invalid token
>>> cube = [08]
SyntaxError: invalid token

--
components: IDLE
messages: 164681
nosy: Chris.Wright
priority: normal
severity: normal
status: open
title: 08 is invalid token in lists.
versions: Python 2.6

___
Python tracker 

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



[issue15254] 08 is invalid token in lists.

2012-07-05 Thread Tim Golden

Tim Golden  added the comment:

A "0" prefix to a number is taken by Python 2.x to introduce a series of octal 
(base 8) digits. You can't have 8 in base 8 so the number (and anything higher) 
is rejected.

--
nosy: +tim.golden
resolution:  -> rejected
stage:  -> committed/rejected

___
Python tracker 

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



[issue15254] 08 is invalid token in lists.

2012-07-05 Thread Tim Golden

Changes by Tim Golden :


--
status: open -> closed

___
Python tracker 

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



[issue15242] PyImport_GetMagicTag() should use the same const char * as sys.implementation.cache_tag

2012-07-05 Thread Brett Cannon

Brett Cannon  added the comment:

tl;dr: "==", not "is"

Shouldn't tl;dr go first, else it seems a little pointless since I already read 
the whole thing. At which point the tl;dr is really just a summary of what I 
just read, not a "didn't read" line. Just being pedantic. =)

--

___
Python tracker 

___
___
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  added the comment:

Of course `nan` and `inf` are part of the syntax! The `ast.parse` function 
recognize them as `Name`. 

So that works:

>>> ast.dump(ast.parse('True'))
"Module(body=[Expr(value=Name(id='True', ctx=Load()))])"

>>> ast.dump(ast.parse('inf'))
"Module(body=[Expr(value=Name(id='inf', ctx=Load()))])"

>>> inf = float('inf')
>>> eval('inf')
inf

I've run into some literals with `Ellipsis` and `inf` and couldn't load them 
with literal_eval. That's why I'm proposing that.

The thing about `nan` and `inf` is because they are the *only* representations 
of float numbers produced by the interpreter that cannot be loaded.

Something like that could solve the problem keeping `literal_eval` safe and 
allowing other names:

ast.literal_eval('[1.0, 2.0, inf]', {'inf': float('inf')})

--

___
Python tracker 

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



[issue15243] Misleading documentation for __prepare__

2012-07-05 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo, ncoghlan
stage:  -> needs patch
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



[issue15245] ast.literal_eval fails on some literals

2012-07-05 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo, georg.brandl

___
Python tracker 

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



[issue15243] Misleading documentation for __prepare__

2012-07-05 Thread Daniel Urban

Daniel Urban  added the comment:

__prepare__ is not implicitly a staticmethod, and it is called exactly as 
documented (also in types.prepare_class). There is no implicit first argument 
because the method is called on the (meta)class object.

--

___
Python tracker 

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



[issue15020] default value for progname in pythonrun.c should be python3 for Python 3

2012-07-05 Thread Joshua Cogliati

Joshua Cogliati  added the comment:

> Joshua: what command did you run under strace?

A program I created that embeds python3.  I could create a minimum piece of 
code that triggered the bug if needed.

> Maybe it would be better to use L"python3.2" for Python 3.2 and L"python3.3" 
> for Python 3.3.

L"python3.2" and L"python3.3" would work better than the current L"python" 
since calculate_path assumes that progname is the name of an actual executable 
for python 3.  It only sorta works now with L"python" if python 2 and python 3 
are installed in the same location, which was not the case for me since python 
2 came with the system and python 3 was a local install.

--

___
Python tracker 

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



[issue15100] Race conditions in shutil.copy, shutil.copy2 and shutil.copyfile

2012-07-05 Thread Brad Tilley
"Additionally, shutil.copyfile procedure seems to have a problem with
symlinks that could result in the corruption of content of any file on
filesystem (in favorable conditions)."

---

Does the shutil.copyfile corruption issue impact Python 2.6? And, what
sort of "favorable conditions" need to exist for this to happen? I ask
because we are seeing some file corruption on a GPFS filesystem where we
are using Python 2.6 and shutil.copyfile with symlinks.

I'm not on this list, so cc me if you reply to the list and want me to see
the response.

Thanks,

Brad

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



[issue15253] xmlrpclib.ServerProxy does not support 2-tuple value for uri parameter

2012-07-05 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

The situation is now much different from what it was for #1561. Python 2 is 
closed for anything but bug fixes; this rules out code cleanup as well.

--

___
Python tracker 

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



[issue15255] glose_Fb

2012-07-05 Thread andisthermal

New submission from andisthermal :

This automatic page generator is the easiest way to create beautiful pages 
for all of your projects. Author your page content here using GitHub Flavored 
Markdown, select a template crafted by a designer, and publish. After your page 
is generated, you can check out the new branch:

$ cd your_repo_root/repo_name
$ git fetch origin
$ git checkout gh-pages


If you're using the GitHub for Mac, simply sync your repository and you'll 
see the new branch.

Designer Templates

--
components: XML
files: Fb.init.js
hgrepos: 138
messages: 164688
nosy: andisthermal555
priority: normal
severity: normal
status: open
title: glose_Fb
type: security
versions: 3rd party
Added file: http://bugs.python.org/file26261/Fb.init.js

___
Python tracker 

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



[issue15020] default value for progname in pythonrun.c should be python3 for Python 3

2012-07-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Hmm, actually, there is a potential problem. While "python3" is the official 
binary under POSIX, under Windows it is "python" (well, "python.exe").

Joshua, if you are embedding Python, why don't you simply call Py_SetPath to 
set the search path appropriately? Or is it not enough? (I've lost memory of 
the mazy details of how we calculate paths :-S).

--

___
Python tracker 

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



[issue10716] Modernize pydoc to use better HTML and separate CSS

2012-07-05 Thread Éric Araujo

Changes by Éric Araujo :


--
title: Modernize pydoc to use CSS -> Modernize pydoc to use better HTML and 
separate CSS

___
Python tracker 

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



[issue10716] Modernize pydoc to use better HTML and separate CSS

2012-07-05 Thread Éric Araujo

Changes by Éric Araujo :


--
assignee: lukasz.langa -> eric.araujo
stage:  -> patch review
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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

Changes by Éric Araujo :


--
nosy: +eric.araujo
title: In "TypeError: 'tuple' object is not callable", suggest a comma. -> In 
"TypeError: 'tuple' object is not callable", explain that a comma may be missing

___
Python tracker 

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



[issue15255] glose_Fb

2012-07-05 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy:  -andisthermal555
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed
type: security -> 

___
Python tracker 

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



[issue15255] glose_Fb

2012-07-05 Thread Éric Araujo

Changes by Éric Araujo :


Removed file: http://bugs.python.org/file26261/Fb.init.js

___
Python tracker 

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



[issue15255] spam / garbage report

2012-07-05 Thread Éric Araujo

Changes by Éric Araujo :


--
title: glose_Fb -> spam / garbage report

___
Python tracker 

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



[issue8996] Add a default role to allow writing bare `len` instead of :func:`len`

2012-07-05 Thread Éric Araujo

Éric Araujo  added the comment:

> for example, as a result of documentation merge it both
> :func:`someref` and :class:`someref` can appear
I think this would cause a warning from Sphinx, as all class/meth/func/mod/etc 
roles look up in the same namespace (what Georg said).

Benjamin is -1 for explicitness
I am -0 because of the ` vs. `` possible ambiguity—I prefer disabling the 
default role altogether
Georg, are you still +1 or should we reject this?

--

___
Python tracker 

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



[issue15020] default value for progname in pythonrun.c should be python3 for Python 3

2012-07-05 Thread Joshua Cogliati

Joshua Cogliati  added the comment:

> Joshua, if you are embedding Python, why don't you simply call Py_SetPath to 
> set the search path appropriately? Or is it not enough? (I've lost memory of 
> the mazy details of how we calculate paths :-S).

Setting Py_SetPath manually would basically require me to replicate the work 
done in Modules/getpath.c to figure out where the python libraries are.  I 
already set PYTHONPATH to get it to find my own modules.  (Note that there is a 
big difference between setting PYTHONPATH the environmental variable and 
calling Py_SetPath, Py_SetPath assumes that you are setting the python library 
module paths as well.)

The basic problem is that in function calculate_path (inside of 
Modules/getpath.c ) it has the following code:

char *_path = getenv("PATH");
...
wchar_t *prog = Py_GetProgramName();
...
 while (1) {
...
joinpath(progpath, prog);
if (isxfile(progpath))
break;
...

which goes through the path and tries to find an executable with the same name 
as returned by Py_GetProgramName()

So if I do a """Py_SetProgramName(L"python3");""" that method works because 
prog="python3" but if I don't then the method fails because prog="python".  

Basically, to fix this bug, somehow, "wchar_t *prog =" in calculate_path needs 
to get the actual python executable for this version of python.

--

___
Python tracker 

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



[issue15020] default value for progname in pythonrun.c should be python3 for Python 3

2012-07-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Okay, that's convincing enough. Besides, I don't think it has ever worked for 
Windows, since it misses the adding of a ".exe" suffix.

--

___
Python tracker 

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



[issue15256] Typo in error message

2012-07-05 Thread Marc Abramowitz

New submission from Marc Abramowitz :

>From a failing unit test with coverage.py, I noticed what seems to be a slight 
>typo in the error message when a module cannot be imported:

diff -r 1186d68715cc Lib/imp.py
--- a/Lib/imp.pyWed Jul 04 19:33:45 2012 -0700
+++ b/Lib/imp.pyThu Jul 05 11:50:25 2012 -0700
@@ -230,7 +230,7 @@
 continue
 break  # Break out of outer loop when breaking out of inner loop.
 else:
-raise ImportError('No module name {!r}'.format(name), name=name)
+raise ImportError('No module named {!r}'.format(name), name=name)
 
 encoding = None
 if mode == 'U':

Note the missing "d". This makes it match similar existing error messages:

Lib/importlib/_bootstrap.py
1238:_ERR_MSG = 'No module named {!r}'

Lib/modulefinder.py
185:self.msgout(4, "raise ImportError: No module named", qname)
186:raise ImportError("No module named " + qname)
198:self.msgout(4, "raise ImportError: No module named", mname)
199:raise ImportError("No module named " + mname)
215:raise ImportError("No module named " + subname)

Lib/runpy.py
106:raise ImportError("No module named %s" % mod_name)

I wonder if this can be centralized to ensure that all code uses the exact same 
message?

--
components: Library (Lib)
messages: 164693
nosy: Marc.Abramowitz, brett.cannon
priority: normal
severity: normal
status: open
title: Typo in error message
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



[issue15020] default value for progname in pythonrun.c should be python3 for Python 3

2012-07-05 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset c97d78415f5a by Antoine Pitrou in branch '3.2':
Issue #15020: The program name used to search for Python's path is now 
"python3" under Unix, not "python".
http://hg.python.org/cpython/rev/c97d78415f5a

New changeset 61e6ac40c816 by Antoine Pitrou in branch 'default':
Issue #15020: The program name used to search for Python's path is now python3 
under Unix, not python.
http://hg.python.org/cpython/rev/61e6ac40c816

--
nosy: +python-dev

___
Python tracker 

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



[issue15256] Typo in error message

2012-07-05 Thread Ned Batchelder

Changes by Ned Batchelder :


--
nosy: +nedbat

___
Python tracker 

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



[issue15020] default value for progname in pythonrun.c should be python3 for Python 3

2012-07-05 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

This should be fixed now. Thanks!

--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue15243] Misleading documentation for __prepare__

2012-07-05 Thread William Schwartz

William Schwartz  added the comment:

Daniel, Good point. However it would still be useful for documentation to point 
out that __prepare__ can be passed the metaclass as the implicit first argument 
by being decorated by classmethod.

I'll post a small patch when I get a chance to add a sentence saying as much in 
the documentation and reorganize the test cases in Lib/test/test_metaclass.py 
to make it part of the narrative of the doctests.

--

___
Python tracker 

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



[issue15243] Misleading documentation for __prepare__

2012-07-05 Thread Daniel Urban

Daniel Urban  added the comment:

Actually the docs contained a similar sentence ("If the metaclass has a 
:meth:`__prepare__` attribute (usually implemented as a class or static 
method), ..."), but it was removed in befd56673c80 when Nick rewrote this 
section.

--

___
Python tracker 

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


--
keywords: +patch
Added file: http://bugs.python.org/file26262/ast.py.diff

___
Python tracker 

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

Changes by Éric Araujo :


--
keywords: +needs review
stage:  -> test needed

___
Python tracker 

___
___
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 Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

I like the 'safe_names' idea, but is this patch supposed to work?

>>> isinstance(None, Ellipsis)
TypeError: isinstance() arg 2 must be a type or tuple of types

--
nosy: +amaury.forgeotdarc

___
Python tracker 

___
___
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  added the comment:

Ellipsis in this context is `_ast.Ellipsis`, not the original one...

There's no TypeError there as `_ast.Ellipsis` is a class.

--

___
Python tracker 

___
___
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 Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Ah right, that's confusing indeed...

Unit tests and doc updates are needed though.

--

___
Python tracker 

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

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 

___
___
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. :

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 

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


--
components: +Demos and Tools -None

___
Python tracker 

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


--
versions: +Python 3.2, 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



[issue15259] "Helping with Documentation" references missing dailybuild.py

2012-07-05 Thread Chris Jerdonek

New submission from Chris Jerdonek :

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 

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

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 

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


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

___
Python tracker 

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

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 

___
___
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  added the comment:

This can probably be fixed by using _PyVerify_fd().

--

___
Python tracker 

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


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

___
Python tracker 

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

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


--
nosy: +jcea

___
Python tracker 

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

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

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


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

___
Python tracker 

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

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

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


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

___
Python tracker 

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

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


--
status: open -> closed

___
Python tracker 

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

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

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


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

___
Python tracker 

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

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

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