[issue15476] Add code object to glossary

2012-09-05 Thread Chris Jerdonek

Chris Jerdonek added the comment:

That's fine by me.  I guess what's more important to me is that code object 
have a central, linkable definition *somewhere* (and not necessarily that this 
somewhere be a glossary entry).  That way references to code object in the docs 
can link to a definition in the same way that we link to definitions of other 
words, functions, etc.

I was also planning on indexing the word more properly.

--

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



[issue15861] ttk.Treeview unmatched open brace in list

2012-09-05 Thread Ned Deily

Ned Deily added the comment:

What behavior do you expect?  By accident, I found your reply to this 
StackOverflow question.  I take it from that that you think tkinter should be 
quoting curly braces found in strings.  If that is what you mean, can you 
specify the set of characters that need to be escaped and in what contexts?

http://stackoverflow.com/questions/11566299/unmatched-open-brace-error-when-adding-item-to-ttk-treeview

--
nosy: +asvetlov, ned.deily

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



[issue15853] IDLE crashes selecting Preferences menu with OS X ActiveState Tcl/Tk 8.5.12.1

2012-09-05 Thread Ned Deily

Ned Deily added the comment:

The problem is a regression in the latest version of ActiveTcl 8.5 for OS X, 
specifically 8.5.12.1 (and I believe the previous version 8.5.12.0).  It has 
nothing directly to do with Python or how you might build Python other than 
whether _tkinter.so dynamically links with 
/Library/Frameworks/Tcl.framework/Verisons/8.5 and 
/Library/Framework/Tk.framework/Verisons/8.5 (the locations where ActiveTcl 
install) as opposed to /System/Library/Frameworks/Tcl.framework/... and 
/System/Library/Frameworks/Tk.framework/..., the Apple-supplied versions.  And, 
if so, which version of ActiveTcl you have installed.  The python.org 64-bit 
Pythons are vulnerable, the 32-bit-obly ones are not because they link with 
Tcl/Tk 8.4.

Unfortunately, ActiveState only makes available the most recent version of 
ActiveTcl on its Community Edition pages, so, unless you have access to a copy 
of an older version of ActiveTcl (like 8.5.11.1, the previous version), you're 
kind of stuck with the behavior, unless you remove ActiveTcl 8.5 and revert to 
Apple's Tk which is vulnerable to other crashes that have been fixed in 
ActiveState's (and is totally broken in OS X 10.6). Or you use the 32-bit 
installer and Tcl/Tk 8.4.  Or you build your own version of Tcl/Tk 8.5 (I've 
stared looking at that).  By the way, ActiveState's own ActivePython 2.7 also 
crashes the same way when using 8.5.12.x.  I've pinged the Tcl Mac mailing 
list.  Unless there's an immediate fix, I'll see what I can find in Tk.

http://permalink.gmane.org/gmane.comp.lang.tcl.mac/7080

--

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



[issue15865] reflect bare star * in function signature documentation

2012-09-05 Thread Ezio Melotti

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


--
nosy: +eric.araujo, georg.brandl
stage:  - needs patch

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



[issue15841] Some StringIO and BytesIO methods can succeed after close

2012-09-05 Thread Alessandro Moura

Alessandro Moura added the comment:

I just emailed my contributor's agreement.

--

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



[issue15298] _sysconfigdata is generated in srcdir, not builddir

2012-09-05 Thread Richard Oudkerk

Richard Oudkerk added the comment:

If sysconfig._generate_posix_vars() creates the build directory and 
pybuilddir.txt (instead of setup.py) then it could write _sysconfigdata.py in 
the correct place.  Then setup.py would not have to mess with its own sys.path.

One issue with having _sysconfigdata.py in the build dir is that distutils 
copies it (along with everything else in the build dir) to 
.../lib/python3.x/lib-dynload.  So I think Matthias' patch results in two 
copies of _sysconfigdata.py being installed (plus 
__pycache__/_sysconfigdata.pyc).

--
nosy: +sbt

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



[issue15861] ttk.Treeview unmatched open brace in list

2012-09-05 Thread Bryan Oakley

Bryan Oakley added the comment:

What behavior do I expect? I expect it to not throw an error. I expect whatever 
string I give to be inserted into the widget unadulterated (ie: if I give the 
string foo { I expect to see foo { in the widget). 

Tkinter is effectively telling me you have a Tcl syntax error. Since I'm 
programming in python I should be insulated from that, particularly since the 
error comes internally after Tkinter transforms my data. 

How Tkinter does it under the hood, I don't care. Tkinter should make sure that 
the data it passes to the Tcl interpreter is well-formed.

--

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



[issue15861] ttk.Treeview unmatched open brace in list

2012-09-05 Thread Ezio Melotti

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


--
nosy: +ezio.melotti

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



[issue14847] AttributeError: NoneType has no attribute 'utf_8_decode'

2012-09-05 Thread Jason R. Coombs

Jason R. Coombs added the comment:

I've removed the invocation of the wrapper code in our project, but the issue 
has not exhibited itself. This leads me to suspect a few possibilities of 
things that have changed since we had the issue in June:

1) Distribute was updated with its fix for this issue. I don't expect that code 
was being called in our application, but I didn't strictly rule it out.
2) The application launcher was changed. The old system was fork-based and used 
pkg_resources and multi-installed packages. The modern deployment is a simple, 
pip-installed process.
3) The code underwent other unrelated but substantial changes.

So although I thought I was on to something when I added the wrapper, 
suppressing the error, I was never able to detect it, and it seems to have gone 
away now. I was hoping this would shed more light on the problem and describe 
another use case, but at this point, that may not happen.

Unless the problem recurs in our application, or we have another application 
where the problem arises, I'll focus on the Python side as suggested by Amaury.

--

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



[issue15858] tarfile missing entries due to omitted uid/gid fields

2012-09-05 Thread Lars Gustäbel

Lars Gustäbel added the comment:

Could you provide some sample data and code? I see the problem, but I cannot 
quite reproduce the behaviour you describe. In all of my testcases tarfile 
either throws an exception or successfully reads the archive, but never 
silently stops.

--
assignee:  - lars.gustaebel

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



[issue15298] _sysconfigdata is generated in srcdir, not builddir

2012-09-05 Thread Richard Oudkerk

Richard Oudkerk added the comment:

Alternative patch.

--
Added file: http://bugs.python.org/file27122/alt_sysconfigdata.patch

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



[issue15861] ttk.Treeview unmatched open brace in list

2012-09-05 Thread Eric V. Smith

Eric V. Smith added the comment:

I agree with Bryan. Further, if the string is being interpreted as Tcl, then 
this strikes me as a possible injection attack vector (although I'll admit to 
not having looked at the code to see how the Tcl code is being used and/or 
interpreted).

--
nosy: +eric.smith

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



[issue15533] subprocess.Popen(cwd) documentation

2012-09-05 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Here is a proposed patch that attempts to minimize the chance of test breakage 
for Tru64.  The patch follows Martin's recommendation on python-dev of being 
cautious by following existing code.

--
Added file: http://bugs.python.org/file27123/issue-15533-8-default.patch

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



[issue15865] reflect bare star * in function signature documentation

2012-09-05 Thread Éric Araujo

Éric Araujo added the comment:

So is the root problem that Sphinx does not handle keyword-only arguments?

--
versions: +Python 3.2

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



[issue15298] _sysconfigdata is generated in srcdir, not builddir

2012-09-05 Thread Éric Araujo

Éric Araujo added the comment:

I did not test the patch but it does not look bad.

--

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



[issue15865] reflect bare star * in function signature documentation

2012-09-05 Thread Chris Jerdonek

Chris Jerdonek added the comment:

 So is the root problem that Sphinx does not handle keyword-only arguments?

I don't think so.  Sphinx renders the * just fine.  It's just that in some of 
the reST files, the * was left out.

--

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



[issue13241] llvm-gcc-4.2 miscompiles Python (XCode 4.1 on Mac OS 10.7)

2012-09-05 Thread Ronald Oussoren

Ronald Oussoren added the comment:

I've closed the issue as 'wont fix' because llvm-gcc will miscompile 3.3 due to 
bugs in that compiler. CPython won't work around that compiler bug (if that's 
even possible).

The workaround: use clang to compile (and on older OSX releases use a different 
version of GCC that doesn't use the LLVM backend).

--
resolution:  - wont fix
stage: test needed - committed/rejected
status: open - closed

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



[issue15865] reflect bare star * in function signature documentation

2012-09-05 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Actually, it looks like configparser is the *only* file with missing single 
*'s. :)  However, I did find a few other typos in the process of checking those 
signatures in the other files.

Patch attached.

--
keywords: +patch
Added file: http://bugs.python.org/file27124/issue-15865-1.patch

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



[issue15298] _sysconfigdata is generated in srcdir, not builddir

2012-09-05 Thread Matthias Klose

Matthias Klose added the comment:

looks ok, two issues are:

builddir should have added
  +(-pydebug if hasattr(sys, gettotalrefcount) else )

the installation installs this to the lib-dynload directory, which maybe is not 
desired.

--

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



[issue15865] reflect bare star * in function signature documentation

2012-09-05 Thread Chris Jerdonek

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


--
keywords: +needs review
stage: needs patch - patch review

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



[issue15861] ttk.Treeview unmatched open brace in list

2012-09-05 Thread Ned Deily

Ned Deily added the comment:

I agree as well.  The bigger question is, as Eric suggests, is this the only 
such case when mapping between Python and Tcl elements?  Since Bryan is a 
well-known Tcl and Tkinter expert, his insights on that would be very useful.

--

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



[issue15775] Add StopParser() to expat

2012-09-05 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Below is a sample script that shows that it's possible to stop parsing XML in 
the middle, without an explicit call to XML_StopParser(): raise StopParsing 
from any handler, and catch it around the Parse() call.

This method covers the two proposed use cases.  Do we need another way to do it?


import xml.parsers.expat

class StopParsing(Exception):
pass

def findFirstElementByName(data, what):
  def end_element(name):
  if name == what:
  raise StopParsing(name)

  p = xml.parsers.expat.ParserCreate()
  p.EndElementHandler = end_element

  try:
  p.Parse(data, True)
  except StopParsing as e:
  print Element found:, e
  else:
  print Element not found

data = ?xml version=1.0?
 parent id=topchild1 name=paulText goes here/child1
 child2 name=fredMore text/child2
 /parent
findFirstElementByName(data, child2)   # Found
findFirstElementByName(data, child3)   # Not found

--

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



[issue15298] _sysconfigdata is generated in srcdir, not builddir

2012-09-05 Thread Richard Oudkerk

Richard Oudkerk added the comment:

 builddir should have added
  +(-pydebug if hasattr(sys, gettotalrefcount) else )

Oops, yes.

 the installation installs this to the lib-dynload directory, which 
 maybe is not desired.

The lines

+   -rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata.py
+   -rm -r $(DESTDIR)$(DESTSHARED)/__pycache__

in the patch remove them from lib-dynload.

--

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



[issue15298] _sysconfigdata is generated in srcdir, not builddir

2012-09-05 Thread Richard Oudkerk

Richard Oudkerk added the comment:

Updated patch.

--
Added file: http://bugs.python.org/file27125/alt_sysconfigdata.patch

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



[issue15298] _sysconfigdata is generated in srcdir, not builddir

2012-09-05 Thread Richard Oudkerk

Changes by Richard Oudkerk shibt...@gmail.com:


Removed file: http://bugs.python.org/file27125/alt_sysconfigdata.patch

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



[issue15298] _sysconfigdata is generated in srcdir, not builddir

2012-09-05 Thread Richard Oudkerk

Richard Oudkerk added the comment:

Try again.

--
Added file: http://bugs.python.org/file27126/alt_sysconfigdata.patch

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



[issue15298] _sysconfigdata is generated in srcdir, not builddir

2012-09-05 Thread Richard Oudkerk

Changes by Richard Oudkerk shibt...@gmail.com:


Added file: http://bugs.python.org/file27127/alt_sysconfigdata.patch

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



[issue15298] _sysconfigdata is generated in srcdir, not builddir

2012-09-05 Thread Richard Oudkerk

Changes by Richard Oudkerk shibt...@gmail.com:


Removed file: http://bugs.python.org/file27126/alt_sysconfigdata.patch

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



[issue15298] _sysconfigdata is generated in srcdir, not builddir

2012-09-05 Thread Richard Oudkerk

Changes by Richard Oudkerk shibt...@gmail.com:


Removed file: http://bugs.python.org/file27122/alt_sysconfigdata.patch

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



[issue15842] Some SocketIO methods can succeed after close()

2012-09-05 Thread Alessandro Moura

Alessandro Moura added the comment:

This patch fixes the problem, making those methods raise a ValueError exception 
after close.

I also added one test case for this issue.

--
keywords: +patch
nosy: +eng793
Added file: http://bugs.python.org/file27128/socket.patch

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



[issue15841] Some StringIO and BytesIO methods can succeed after close

2012-09-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 524931e5aebf by Antoine Pitrou in branch '3.2':
Issue #15841: The readable(), writable() and seekable() methods of BytesIO
http://hg.python.org/cpython/rev/524931e5aebf

New changeset fcf097cb5f6b by Antoine Pitrou in branch 'default':
Issue #15841: The readable(), writable() and seekable() methods of BytesIO
http://hg.python.org/cpython/rev/fcf097cb5f6b

New changeset d0ab34d4c733 by Antoine Pitrou in branch '2.7':
Issue #15841: The readable(), writable() and seekable() methods of io.BytesIO
http://hg.python.org/cpython/rev/d0ab34d4c733

--
nosy: +python-dev

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



[issue15841] Some StringIO and BytesIO methods can succeed after close

2012-09-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I have now committed the patch. Thank you again!

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

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



[issue15866] encode(..., 'xmlcharrefreplace') produces entities for surrogate pairs

2012-09-05 Thread Wim

New submission from Wim:

Encoding a (well-formed) Unicode string containing a non-BMP character, using 
the xmlcharrefreplace error handler, will produce two XML entities for 
surrogate codepoints instead of one entity for the actual character.

Here's a transcript (Python 2.7.3, x86_64):


   b = '\xf0\x9f\x92\x9d'
   u = b.decode('utf8')
   u
  u'\U0001f49d'
   u.encode('ascii', errors='xmlcharrefreplace')
  '#55357;#56477;'
   ( u'\U0001f49d' ).encode('ascii', errors='xmlcharrefreplace')
  '#55357;#56477;'
   list(u)
  [u'\ud83d', u'\udc9d']
   u.encode('utf8', errors='xmlcharrefreplace')
  '\xf0\x9f\x92\x9d'

The utf8 bytestring is correctly decoded, and the print representation shows 
one single Unicode character. Encoding using xmlcharrefreplace produces two XML 
entities, which is wrong[1]: a single non-BMP character should be represented 
in XML as a single entity reference, in this case presumably '#128157;'.

As the last two lines show, I'm using a narrow build (so the unicode strings 
are represented internally in UTF-16, I guess). Converting the string back to 
utf8 does the right thing, and emits a single UTF8 sequence representing the 
supplementary-plane codepoint.

(FWIW, the backslashreplace error handler also emits a surrogate pair, but I 
don't know if there is a complete specification for what that handler does, so 
it's possible that it's not wrong.)

[1] http://www.w3.org/International/questions/qa-escapes#bytheway

--
components: Library (Lib), Unicode
messages: 169886
nosy: ezio.melotti, wiml
priority: normal
severity: normal
status: open
title: encode(..., 'xmlcharrefreplace') produces entities for surrogate pairs
type: behavior
versions: Python 2.7

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



[issue15858] tarfile missing entries due to omitted uid/gid fields

2012-09-05 Thread Tom Lynn

Tom Lynn added the comment:

See attached bad.tar.

$ less bad.tar | cat
drwxr-xr-x 0/0   0 2012-09-05 20:04 foo/
-rw-rw-r-- uname/gname   0 2012-09-05 20:04 foo/a
$ python -c 'import tarfile; print(tarfile.open(bad.tar).getnames())'
['foo']
$ python -c 'import tarfile, patch; patch.patch_tarfile(); print 
(tarfile.open(bad.tar).getnames())'
['foo', 'foo/a']

I'm only allowed to attach one file via the tracker web UI, so patch.py will 
follow.

Creation code for bad.tar, largely for my benefit:

import java.io.FileOutputStream;
import java.io.IOException;
import org.codehaus.plexus.archiver.tar.TarOutputStream;
import org.codehaus.plexus.archiver.tar.TarEntry;

class TarTest {
public static void main(String[] args) throws IOException {
FileOutputStream fos = new FileOutputStream(bad.tar);
TarOutputStream tos = new TarOutputStream(fos);

TarEntry entry = new TarEntry(foo/);
entry.setMode(16877); // 0o40755
entry.setUserId(0);
entry.setGroupId(0);
entry.setUserName();
entry.setGroupName();
tos.putNextEntry(entry);

TarEntry entry2 = new TarEntry(foo/a);
entry2.setMode(33204); // 0o100664
entry2.setUserId(-1);  // XXX: dodgy
entry2.setGroupId(-1); // XXX: dodgy
entry2.setUserName(uname);
entry2.setGroupName(gname);
tos.putNextEntry(entry2);

tos.close();
fos.close();
}
}

--
Added file: http://bugs.python.org/file27129/bad.tar

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



[issue15858] tarfile missing entries due to omitted uid/gid fields

2012-09-05 Thread Tom Lynn

Tom Lynn added the comment:

patch.py attached - what I'm using as a workaround at the moment.

--
Added file: http://bugs.python.org/file27130/patch.py

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



[issue13992] Segfault in PyTrash_destroy_chain

2012-09-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5a2ef447b80d by Antoine Pitrou in branch '2.7':
Issue #13992: The trashcan mechanism is now thread-safe.  This eliminates
http://hg.python.org/cpython/rev/5a2ef447b80d

--
nosy: +python-dev

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



[issue13992] Segfault in PyTrash_destroy_chain

2012-09-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e72cda3f40a2 by Antoine Pitrou in branch '3.2':
Issue #13992: The trashcan mechanism is now thread-safe.  This eliminates
http://hg.python.org/cpython/rev/e72cda3f40a2

New changeset 6bcaba9e8df2 by Antoine Pitrou in branch 'default':
Issue #13992: The trashcan mechanism is now thread-safe.  This eliminates
http://hg.python.org/cpython/rev/6bcaba9e8df2

--

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



[issue13992] Segfault in PyTrash_destroy_chain

2012-09-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Georg, I think this should go in 3.3.0, what do you think?

--
resolution:  - fixed
stage: patch review - committed/rejected

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



[issue15535] Fix pickling efficiency of named tuples in 2.7.3

2012-09-05 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc added the comment:

Adding def __getstate__(self): return None to the namedtuple template fixes 
the issue.  Here is a patch with test.

--
nosy: +amaury.forgeotdarc
Added file: http://bugs.python.org/file27131/namedtuple-pickle.diff

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



[issue13992] Segfault in PyTrash_destroy_chain

2012-09-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Oops, forgot to make Georg nosy.
Georg, I think this should go in 3.3.0, what do you think?

--
nosy: +georg.brandl

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



[issue13992] Segfault in PyTrash_destroy_chain

2012-09-05 Thread Antoine Pitrou

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


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

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



[issue13992] Segfault in PyTrash_destroy_chain

2012-09-05 Thread Arfrever Frehtes Taifersar Arahesis

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


--
nosy: +benjamin.peterson
priority: normal - release blocker

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



[issue11549] Build-out an AST optimizer, moving some functionality out of the peephole optimizer

2012-09-05 Thread STINNER Victor

STINNER Victor added the comment:

I'm working on a AST optimizer for Python 2.6-3.3:
https://bitbucket.org/haypo/astoptimizer

It is implemented in Python and is able to optimize much more cases than the 
current bytecode peepholer.

--
nosy: +haypo

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



[issue11549] Build-out an AST optimizer, moving some functionality out of the peephole optimizer

2012-09-05 Thread Nick Coghlan

Nick Coghlan added the comment:

All of the optimisations that assume globals haven't been shadowed or rebound 
are invalid in the general case.

E.g. print(1.5) and print(1.5) are valid for *our* print function, but we 
technically have no idea if they're equivalent in user code.

In short, if it involves a name lookup and that name isn't reserved to the 
compiler (e.g. __debug__) then no, you're not allowed to optimise it at compile 
time if you wish to remain compliant with the language spec. Method calls on 
literals are always fair game, though (e.g. you could optimise a b c.split())

Any stdlib AST optimiser would need to be substantially more conservative by 
default.

--

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



[issue11549] Build-out an AST optimizer, moving some functionality out of the peephole optimizer

2012-09-05 Thread STINNER Victor

STINNER Victor added the comment:

 All of the optimisations that assume globals haven't been shadowed
 or rebound are invalid in the general case.

My main idea is that the developer of the application should be able to 
annotate functions and constants to declare them as optimizable (constant). I 
chose to expect builtins as not being overrided, but if it breaks applications, 
it can be converted to an option disabled by default.

There is a known issue: test_math fails because pow() is an alias to matH.pow() 
in doctests. The problem is that from math import * is called and the result 
is stored in a namespace, and then pow(2,4) is called in the namespace. 
astoptimizer doesn't detect that pow=math.pow because locals are only set when 
the code is executed (and not at compilation) with something like: exec(code, 
namespace). It is a limitation of the optimizer. A workaround is to disable 
optimizations when running tests.

It is possible to detect that builtins are shadowed (ex: print=myprint). 
astoptimizer has an experimental support of assignments, but it only works on 
trivial examples yet (like x=1; print(x)) and is disabled by default (because 
it is buggy). I also plan to disable some optimizations if globals(), vars() or 
dir() is called.

--

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



[issue11549] Build-out an AST optimizer, moving some functionality out of the peephole optimizer

2012-09-05 Thread STINNER Victor

STINNER Victor added the comment:

 Any stdlib AST optimiser would need to be substantially more conservative by 
 default.

FYI The test suite of Python 2.7 and 3.3 pass with astoptimizer... except some 
minor (?) failures:

 * test_math fails for the reason explained above
 * test_pdb: it looks to be an issue with line number (debuggers don't like 
optimizers :-))
 * test_xml_etree and test_xml_etree_c: reference count of the None singleton

The test suite helped me to find bugs in my optimizer :-)

I also had to add some hacks (hasattr) for test_ast (test_ast generates invalid 
AST trees). The configuration should also be adapted for test_peepholer, 
because CPython peepholer uses a limit of 20 items, whereas astoptimizer uses a 
limit of 4096 bytes/characters for string by default. All these minor nits are 
now handled in a specific cpython_tests config.

--

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



[issue11549] Build-out an AST optimizer, moving some functionality out of the peephole optimizer

2012-09-05 Thread Nick Coghlan

Nick Coghlan added the comment:

No, you're assuming global program analysis and *that is not a valid 
assumption*.

One of the key features of Python is that *monkeypatching works*. It's not 
encouraged, but it works.

You simply cannot play games with name lookups like this without creating 
something that is no longer Python.

--

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



[issue11549] Build-out an AST optimizer, moving some functionality out of the peephole optimizer

2012-09-05 Thread Nick Coghlan

Nick Coghlan added the comment:

You also have to be very careful of the interface to tracing functions, such as 
profilers and coverage analysis tools.

--

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



[issue11549] Build-out an AST optimizer, moving some functionality out of the peephole optimizer

2012-09-05 Thread Eugene Toder

Eugene Toder added the comment:

 Method calls on literals are always fair game, though (e.g. you could 
 optimise a b c.split())
What about optimizations that do not change behavior, except for different 
error messages? E.g. we can change
y = [1,2][x]
to
y = (1,2)[x]
where the tuple is constant and is stored in co_consts. This will, however, 
produce a different text in the exception when x is not 0 or 1. The type of 
exception is going to be the same.

--

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



[issue15867] It's hard to decypher how to build off of the provided objects from the importlib docs

2012-09-05 Thread Julian Berman

New submission from Julian Berman:

I find that the importlib documentation is a bit too low level. Import hooks 
are not that common, so requiring a bit of reading is OK with me, but I 
somewhat *understand* PEP 302, so I have a general idea of *what* I want to do 
and what kind of objects can accomplish that, and still find it hard to figure 
out how to take the pieces provided by importlib and use them to do what I want.

If I provide a specific example, I want to create a path hook that just does 
the usual import behavior, but before executing the module, does some 
transformation on the source code, say. In trying to figure out the best way to 
do that I had a hard time using the docs to figure out which pieces I should 
assemble to do that. I'm going to just describe the rough series of steps I 
went through, and hopefully that will help give a picture of where in the docs 
I had trouble.

`importlib.abc` has a few things that would appear to help. None of the things 
seem like an exact match, so immediately I'm confused -- after reading PEP 302 
I'd have expected to need to find an object to implement one or both of 
`get_code` or `get_source` on, or one that has that implemented that I can 
subclass and extend. The closest thing there that I find is PyPycLoader, which 
seems to be saying it implements the standard import behavior, but the docs say 
its deprecated and to use SourceLoader. At this point, after checking out 
`SourceLoader` and seeing that it has me implementing two methods whose purpose 
I don't quite understand, even after reading the short descriptions of them, at 
least not in the context of what I want to do, I begin to suspect that what I 
really want is to combine SourceLoader with some things from the `imp` module, 
or maybe `importlib.__import__`, but am left wondering again how much I need to 
implement before I just can use that. I then notice `importlib.
 util.module_for_loader`, and add that to the simple loader I've written which 
I'm still waiting to plug `imp` into, before realizing that that decorator eats 
the `fullname` attribute and *only* passes along the module, which confuses me, 
since now I don't know how to retrieve the source for the module object that 
I'm being passed -- so I save the path name in `__init__` for the class, and 
assume that's what I should be doing, despite not seeing an example doing that. 
Assuming that's even correct as-is, it took me quite a bit to put those pieces 
together.

So I apologize for rambling -- I think essentially what'd improve things is 
providing more examples, or perhaps a HOWTO entry, that targeted assembling the 
pieces provided in the module into a few clear, complete examples of finders, 
loaders and importers.

--
assignee: docs@python
components: Documentation
messages: 169901
nosy: Julian, docs@python
priority: normal
severity: normal
status: open
title: It's hard to decypher how to build off of the provided objects from the 
importlib docs
versions: Python 3.3, Python 3.4

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



[issue15867] It's hard to decypher how to build off of the provided objects from the importlib docs

2012-09-05 Thread Julian Berman

Changes by Julian Berman julian+python@grayvines.com:


--
type:  - enhancement

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



[issue11549] Build-out an AST optimizer, moving some functionality out of the peephole optimizer

2012-09-05 Thread Nick Coghlan

Nick Coghlan added the comment:

The peephole optimiser already makes optimisations like that in a couple of 
places (e.g. set - frozenset):

 def f(x):
...if x in {1, 2}: pass
...
 f.__code__.co_consts
(None, 1, 2, frozenset({1, 2}))

It's name lookup semantics that are the real minefield. It's one of the reasons 
PyPy's JIT can be so much more effective than a static optimiser - because it's 
monitoring real execution and inserting the appropriate guards it's not relying 
on invalid assumptions about name bindings.

--

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



[issue11549] Build-out an AST optimizer, moving some functionality out of the peephole optimizer

2012-09-05 Thread Eugene Toder

Eugene Toder added the comment:

If I'm not missing something, changing
x in [1,2]
to
x in (1,2)
and
x in {1,2}
to
x in frozenset([1,2])
does not change any error messages.

Agreed that without dynamic compilation we can pretty much only track literals 
(including functions and lambdas) assigned to local variables.

--

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



[issue2679] email.feedparser regex duplicate

2012-09-05 Thread moijes12

Changes by moijes12 moije...@gmail.com:


--
nosy: +moijes12

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



[issue15744] missing tests for {RawIO,BufferedIO,TextIO}.writelines

2012-09-05 Thread Ahsan Nawroj

Changes by Ahsan Nawroj ahsan.naw...@gmail.com:


--
nosy: +ainur0160

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



[issue2679] email.feedparser regex duplicate

2012-09-05 Thread moijes12

Changes by moijes12 moije...@gmail.com:


--
versions: +Python 3.3

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



[issue2679] email.feedparser regex duplicate

2012-09-05 Thread moijes12

Changes by moijes12 moije...@gmail.com:


--
keywords: +patch
Added file: http://bugs.python.org/file27132/2679.patch

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



[issue2679] email.feedparser regex duplicate

2012-09-05 Thread moijes12

moijes12 added the comment:

Hi 

I've attached a patch. Its a simple one wherein NLCRE_crack = NLCRE_bol. I 
found this in Python 3.3.0b2+ and so I've added version 3.3. I executed 
./python -m test after making the change and no failures were reported 
(340-OK, 30-Skip). Looking forward to your comments.

--

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



[issue13896] Make shelf instances work with 'with' as context managers

2012-09-05 Thread Miguel Angel García

Changes by Miguel Angel García miguelangel.gar...@gmail.com:


--
nosy: +Miguel.Angel.García

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