[issue20022] Eliminate the use of the deprecated bundlebuilder.py script in OS X builds

2014-03-30 Thread Ned Deily

Ned Deily added the comment:

Thanks for the patch, Ronald.  I modified it a bit and also removed 
bundlebuilder.py from the source tree.  Applied for release in 3.5.0.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed
title: "modernize" the Mac bundlebuilder.py script -> Eliminate the use of the 
deprecated bundlebuilder.py script in OS X builds

___
Python tracker 

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



[issue21074] Too aggressive constant folding

2014-03-30 Thread STINNER Victor

STINNER Victor added the comment:

The change that I proposed (check parameters before compute the result is
simple), whereas implementing a new optimizer working on the AST requires
much more work.

--

___
Python tracker 

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



[issue21101] Extend the PyDict C API to handle cases where the hash value in known

2014-03-30 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
components: Interpreter Core
files: known_hash.diff
keywords: patch
nosy: rhettinger
priority: normal
severity: normal
stage: patch review
status: open
title: Extend the PyDict C API to handle cases where the hash value in known
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file34666/known_hash.diff

___
Python tracker 

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



[issue21101] Extend the PyDict C API to handle cases where the hash value in known

2014-03-30 Thread Raymond Hettinger

Changes by Raymond Hettinger :


Added file: http://bugs.python.org/file34667/applied_known_hash.diff

___
Python tracker 

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



[issue21101] Extend the PyDict C API to handle cases where the hash value in known

2014-03-30 Thread Raymond Hettinger

New submission from Raymond Hettinger:

Propose adding two functions, PyDict_GetItem_KnownHash() and 
PyDict_SetItem_KnownHash().

It is reasonably common to make two successive dictionary accesses with the 
same key.  This results in calling the hash function twice to compute the same 
result.

For example, the technique can be used to speed-up collections.Counter (see the 
attached patch to show how).  In that patch, the hash is computed once, then 
used twice (to retrieve the prior count and to store the new count.

There are many other places in the standard library that could benefit:

Modules/posixmodule.c 1254
Modules/pyexpat.c 343 and 1788 and 1798
Modules/_json.c 628 and 1446 and 1515 and 1697
Modules/selectmodule.c 465
Modules/zipmodule.c 137
Objects/typeobject.c 6678 and 6685
Objects/unicodeobject.c 14997
Python/_warnings.c 195
Python/compile.c 1134
Python/import.c 1046 and 1066
Python/symtable 671 and 687 and 1068

A similar technique has been used for years in the Objects/setobject.c 
internals as a way to eliminate unnecessary calls to PyObject_Hash() during 
set-to-set and set-to-dict operations.

The benefit is biggest for objects such as tuples or user-defined classes that 
have to recompute the hash on every call on PyObject_Hash().

--

___
Python tracker 

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



[issue21101] Extend the PyDict C API to handle cases where the hash value in known

2014-03-30 Thread Raymond Hettinger

Changes by Raymond Hettinger :


Added file: http://bugs.python.org/file34668/double_counter_hash.py

___
Python tracker 

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



[issue21102] 3.4.0 PDF (a4,letter) and EPUB documentation missing

2014-03-30 Thread koobs

New submission from koobs:

python-3.4.0-docs-pdf-letter.{zip,tar.bz2}
python-3.4.0-docs-pdf-letter.{zip,tar.bz2}

are missing from:

https://www.python.org/ftp/python/doc/3.4.0/

/current/ also still points to 3.3.x documentation:

https://www.python.org/ftp/python/doc/current/

--
assignee: docs@python
components: Documentation
messages: 215176
nosy: docs@python, koobs
priority: normal
severity: normal
status: open
title: 3.4.0 PDF (a4,letter) and EPUB documentation missing
versions: Python 3.4

___
Python tracker 

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



[issue21102] 3.4.0 PDF (a4,letter) and EPUB documentation missing

2014-03-30 Thread koobs

koobs added the comment:

Missing files was supposed to read:

python-3.4.0-docs-pdf-a4.{zip,tar.bz2}
python-3.4.0-docs-pdf-letter.{zip,tar.bz2}
python-3.4.0-docs-epub.{zip,tar.bz2}

--

___
Python tracker 

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



[issue16716] Deprecate OSError aliases in the doc

2014-03-30 Thread priya

Changes by priya :


--
keywords: +patch
Added file: http://bugs.python.org/file34669/exception.patch

___
Python tracker 

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



[issue1191964] asynchronous Subprocess

2014-03-30 Thread Richard Oudkerk

Richard Oudkerk added the comment:

Using asyncio and the IOCP eventloop it is not necessary to use threads.  
(Windows may use worker threads for overlapped IO, but that is hidden from 
Python.)  See

  https://code.google.com/p/tulip/source/browse/examples/child_process.py

for vaguely "expect-like" interaction with a child python process which works 
on Windows.  It writes commands to stdin, and reads results/tracebacks from 
stdout/stderr.

Of course, it is also possible to use overlapped IO directly.

--

___
Python tracker 

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



[issue21101] Extend the PyDict C API to handle cases where the hash value in known

2014-03-30 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue21100] Micro-optimization for tuple comparison

2014-03-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This patch breaks lexicographic ordering of tuples:

(1, 2) < (1, 2, 0) < (1, 3)

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue21100] Micro-optimization for tuple comparison

2014-03-30 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue21100] Micro-optimization for tuple comparison

2014-03-30 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +tim.peters

___
Python tracker 

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



[issue21100] Micro-optimization for tuple comparison

2014-03-30 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue1191964] asynchronous Subprocess

2014-03-30 Thread janzert

Changes by janzert :


--
nosy: +janzert

___
Python tracker 

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



[issue21101] Extend the PyDict C API to handle cases where the hash value in known

2014-03-30 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Is there any benefit in making them public API functions?

--
nosy: +pitrou

___
Python tracker 

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



[issue1697175] winreg module for cygwin?

2014-03-30 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Closing as out of date.

--
resolution:  -> out of date
status: languishing -> closed

___
Python tracker 

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



[issue21102] 3.4.0 PDF (a4,letter) and EPUB documentation missing

2014-03-30 Thread Georg Brandl

Georg Brandl added the comment:

Fixed the symlink. Larry, where did you put the other archives?

--
assignee: docs@python -> larry
nosy: +georg.brandl, larry

___
Python tracker 

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



[issue21085] compile error Python3.3 on Cygwin

2014-03-30 Thread Martin v . Löwis

Martin v. Löwis added the comment:

dellair jie: would you like to work on a patch?

It's fine if not, but it may then be that there is no resolution to this issue 
for the coming months or years (unless somebody else volunteers to write a 
patch).

Running configure should have created pyconfig.h. Please report what this file 
has; pyconfig.h.in is not configured.

--
nosy: +loewis

___
Python tracker 

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



[issue21102] 3.4.0 PDF (a4,letter) and EPUB documentation missing

2014-03-30 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Added missing docs releases.

--
nosy: +benjamin.peterson
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue20924] openssl init 100% CPU utilization

2014-03-30 Thread Martin v . Löwis

Martin v. Löwis added the comment:

As Antoine says: if the socket is *really* in blocking mode, then 
SSL_do_handshake should block until the handshake if fully complete. It should 
not return SSL_ERROR_WANT_READ in this case.

If you have managed to build Python for yourself to diagnose this further, 
please add a call to ioctlsocket in this loop to verify that the socket is in 
blocking mode.

--

___
Python tracker 

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



[issue21101] Extend the PyDict C API to handle cases where the hash value in known

2014-03-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> Is there any benefit in making them public API functions?

Originally, I was going to suggest them as internal functions, but the variety 
of use cases in the standard library suggested that third-party C extensions 
would benefit as well.  

Since this isn't functionality a user can create themselves, a public function 
is the only way to expose this service.

--

___
Python tracker 

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



[issue21101] Extend the PyDict C API to handle cases where the hash value in known

2014-03-30 Thread Alex Gaynor

Alex Gaynor added the comment:

Would it be reasonable to develop a Python API for this? If C functions have a 
need to do this, surely Python code does as well.

--
nosy: +alex

___
Python tracker 

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



[issue21100] Micro-optimization for tuple comparison

2014-03-30 Thread Raymond Hettinger

Changes by Raymond Hettinger :


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

___
Python tracker 

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



[issue21100] Micro-optimization for tuple comparison

2014-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 16fd3f4c9128 by Raymond Hettinger in branch 'default':
Issue 21100: Amazingly, tuple lexicographic ordering was untested.
http://hg.python.org/cpython/rev/16fd3f4c9128

--
nosy: +python-dev

___
Python tracker 

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



[issue21103] Encoding str to IDNA with ellipsis decomposes to empty labels

2014-03-30 Thread Christopher Foo

New submission from Christopher Foo:

When encoding a string with the IDNA codec I expected that it will always raise 
an exception with empty labels. When I do this

>>> 'example.c…'.encode('idna').decode('ascii')

it returns

'example.c...'

instead of raising UnicodeError. The original string ends with U+2026 
HORIZONTAL ELLIPSIS if you can't see it clearly. These strings are coming from 
web pages in a web crawler.

I tested this on Python 3.4, 3.3.2, 2.7.5, 2.6.9.

--
components: Library (Lib)
messages: 215189
nosy: chfoo
priority: normal
severity: normal
status: open
title: Encoding str to IDNA with ellipsis decomposes to empty labels
type: behavior

___
Python tracker 

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



[issue21101] Extend the PyDict C API to handle cases where the hash value is known

2014-03-30 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
title: Extend the PyDict C API to handle cases where the hash value in known -> 
Extend the PyDict C API to handle cases where the hash value is known

___
Python tracker 

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



[issue21104] Read from file aborted

2014-03-30 Thread Alex Grinko

New submission from Alex Grinko:

When reading from text file on Windows Python ends loop on character 0x1A
sample.py:
number = 0
with open("sample.txt",'r') as f:
for line in f:
number += 1
print line
print "File has 8 lines, but Python could read only ",number

--
components: Windows
files: sample.txt
messages: 215190
nosy: Alex.Grinko
priority: normal
severity: normal
status: open
title: Read from file aborted
type: behavior
versions: Python 2.7, Python 3.3
Added file: http://bugs.python.org/file34670/sample.txt

___
Python tracker 

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



[issue21105] functools.partialmethod example doesn't actually work

2014-03-30 Thread Alex Gaynor

New submission from Alex Gaynor:

Specifically the example at: 
https://docs.python.org/3/library/functools.html?highlight=functools#functools.partialmethod

``_alive`` isn't actually assigned before the example tries to read it. Running 
this code at a for-real REPL results in:

>>> class Cell(object):
... @property
... def alive(self):
... return self._alive
... def set_state(self, state):
... self._alive = bool(state)
... import functools
... set_alive = functools.partialmethod(set_state, True)
... set_dead = functools.partialmethod(set_state, False)
...
>>> c = Cell()
>>> c.alive
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 4, in alive
AttributeError: 'Cell' object has no attribute '_alive'

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 215191
nosy: alex, docs@python
priority: normal
severity: normal
status: open
title: functools.partialmethod example doesn't actually work
versions: Python 3.4, Python 3.5

___
Python tracker 

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



[issue21101] Extend the PyDict C API to handle cases where the hash value is known

2014-03-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> Would it be reasonable to develop a Python API for this? 

I suspect that in pure Python, the overhead would exceed the benefit.

Current code:

   d[key] = d[key] + 1

Effort to save a double hash:

   h = hash(key)
   c = d.getitem_known_hash(key, hash)
   d.setitem_known_hash(key, hash, c + 1)

In PyPy, the second code sample might actually be faster that the first, but 
all the other pythons suffer from interpreter overhead, a double dict lookup 
for the hash() function, two dict lookups just to find the new methods, 
allocating a bound method, and forming two argument tuples.

There is also an API design issue.  The pure python core datatype APIs are 
designed in a way to encourage higher level thinking (that is why we can't 
directly manage hash table sparsity or list over-allocation for example).

In contrast, the C API is aimed at users who seek additional control and  
optimization at a lower level than the core language provides.  We tend to 
expose a number of tools at the C level that would be inappropriate for 
higher-level code.

--

___
Python tracker 

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



[issue11824] freeze.py broken due to ABI flags

2014-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4e37a4a036c6 by Martin v. Löwis in branch '3.4':
Issue #11824: Consider ABI tags in freeze. Patch by Meador Inge.
http://hg.python.org/cpython/rev/4e37a4a036c6

New changeset 1b6fc88ae3f5 by Martin v. Löwis in branch 'default':
Merge 3.4: Issue #11824: Consider ABI tags in freeze. Patch by Meador Inge.
http://hg.python.org/cpython/rev/1b6fc88ae3f5

--
nosy: +python-dev

___
Python tracker 

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



[issue11824] freeze.py broken due to ABI flags

2014-03-30 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Thanks for the patch. Closing this issue as it only deals with the ABI flags; 
the remaining issues with freeze are dealt with elsewhere.

--
nosy: +loewis
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue21105] functools.partialmethod example doesn't actually work

2014-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ed81acc970d9 by Benjamin Peterson in branch '3.4':
make partialmethod example work (closes #21105)
http://hg.python.org/cpython/rev/ed81acc970d9

New changeset b8a76485b5ed by Benjamin Peterson in branch 'default':
merge 3.4 (#21105)
http://hg.python.org/cpython/rev/b8a76485b5ed

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue16047] Tools/freeze no longer works in Python 3

2014-03-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 001a6dc996e7 by Martin v. Löwis in branch '3.4':
Issue #16047: Fix module exception list and __file__ handling in freeze.
http://hg.python.org/cpython/rev/001a6dc996e7

New changeset 87ded2fdac4b by Martin v. Löwis in branch 'default':
Merge 3.4 (#16047)
http://hg.python.org/cpython/rev/87ded2fdac4b

--
nosy: +python-dev

___
Python tracker 

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



[issue16047] Tools/freeze no longer works in Python 3

2014-03-30 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Thanks for the patch. It seems to work now.

http://buildbot.python.org/all/builders/AMD64%20Ubuntu%20LTS%20Freeze%203.x/builds/9

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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://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

2014-03-30 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag

___
Python tracker 

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



[issue21103] Encoding str to IDNA with ellipsis decomposes to empty labels

2014-03-30 Thread Martin v . Löwis

Martin v. Löwis added the comment:

I believe this behavior is correct wrt. RFC 3490. In the input, the last label 
is "c…", which is not empty. It is passed to ToASCII, which normalizes the 
ellipsis to "...". If UseSTD3ASCIIRules was true, conversion would fail as it 
yields "." (\x2E). However, Python choses not to set UseSTD3ASCIIRules (and 
instead leaves it to the DNS server to decide whether the name is valid).

I believe this is actually a bug in the RFC, which should ban "." from the the 
set of conversion results regardless of UseSTD3ASCIIRules. However, since this 
RFC is superseded, you probably won't get anybody to confirm this view.

--
nosy: +loewis

___
Python tracker 

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



[issue21103] Encoding str to IDNA with ellipsis decomposes to empty labels

2014-03-30 Thread R. David Murray

R. David Murray added the comment:

For whatever it is worth, it looks like rfc 5892 marks U+2026 as disallowed.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue21106] Updated Mac folder icon

2014-03-30 Thread Vivek Jain

New submission from Vivek Jain:

Python 3 still uses an old-style Mac folder icon in its installer 
(https://github.com/python-git/python/blob/master/Mac/Icons/Python%20Folder.icns?raw=true)
 that looks out of place on recent Macs. I created a quick replacement that is 
higher res and fits in better.

--
assignee: ronaldoussoren
components: Macintosh
files: Python Folder.icns
messages: 215200
nosy: ronaldoussoren, viveksjain
priority: normal
severity: normal
status: open
title: Updated Mac folder icon
type: enhancement
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file34671/Python Folder.icns

___
Python tracker 

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



[issue21106] Updated Mac folder icon

2014-03-30 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Can you please submit a contributor form, and indicate that you are willing to 
license the icon under this agreement?

--
nosy: +loewis

___
Python tracker 

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



[issue21106] Updated Mac folder icon

2014-03-30 Thread Martin v . Löwis

Martin v. Löwis added the comment:

We should probably also ask for the PSF's permission (from the trademark 
committee) to use this specific modification of the logo in CPython.

--

___
Python tracker 

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



[issue21106] Updated Mac folder icon

2014-03-30 Thread Ned Deily

Changes by Ned Deily :


--
assignee: ronaldoussoren -> ned.deily
nosy: +ned.deily
versions:  -Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue21104] Read from file aborted

2014-03-30 Thread eryksun

eryksun added the comment:

AFAIK, this doesn't affect Python 3 under normal circumstances. A file could be 
manually set to text mode by calling msvcrt.setmode(f.fileno(), os.O_TEXT), but 
that's out of the norm.

In Python 2, on Windows interpreting ctrl+z (0x1a) as end-of-file is normal 
behavior in text mode. Read the remarks about [t]ext mode in the description of 
Microsoft's fopen implementation:

http://msdn.microsoft.com/en-us/library/yeby3zcb%28v=vs.90%29.aspx

If you use Python's universal newlines mode, e.g. open('sample.txt', 'rU'), 
then the underlying file is opened in binary mode and therefore will not 
interpret ctrl+z as the end-of-file marker.

--
nosy: +eryksun

___
Python tracker 

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



[issue21106] Updated Mac folder icon

2014-03-30 Thread Vivek Jain

Vivek Jain added the comment:

Submitted the patch, and I license the icon under the PSF contributor 
agreement. To make the icon, I used: (1) the default Apple folder icon as a 
starting point and (2) the Python icon from 
https://www.python.org/community/logos/ (but with modified colors). For (1), 
not sure if there are any copyright issues involved and if so how to get proper 
permission from Apple. I'm guessing the old icon also used the default Mac 
folder icon at the time. For (2), I defer to your expertise to find out the 
right people to contact to get it approved.

--

___
Python tracker 

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



[issue21106] Updated Mac folder icon

2014-03-30 Thread Vivek Jain

Vivek Jain added the comment:

By "Submitted the patch" I meant "Submitted the contributor agreement."

--

___
Python tracker 

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



[issue21106] Updated Mac folder icon

2014-03-30 Thread Ezio Melotti

Ezio Melotti added the comment:

Regarding the Python logo, you should write to psf-tradema...@python.org, tell 
them that you used the logo for the icon and add a link to this issue.
I'm sure they will be happy to let you use it, but it's good to let them know.

--
nosy: +ezio.melotti
stage:  -> patch review

___
Python tracker 

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



[issue1599254] mailbox: other programs' messages can vanish without trace

2014-03-30 Thread David Watson

David Watson added the comment:

On Sun 23 Mar 2014, David Watson wrote:
> There actually isn't a test for the original locking issue, as
> the tests all use the mailbox API, which doesn't provide a way to
> turn off dot-locking. ...

On second thought, the underlying error doesn't actually have
anything to do with locking - another process can open the
mailbox, and mailbox.py can replace the file before that process
even tries to lock it.  Andrew's test_concurrent_append()
originally *did* test for this, but commit c37cb11b546f changed
the single-file mailbox classes to just sync the file rather than
replacing it when messages have only been added, as in that test,
meaning it's no longer effective (for that issue at least).

I've now made a test for the original renaming-vs-copying issue
which just uses the simple _subprocess mechanism that the other
tests use, rather than trying to set up any special locking
conditions.  I've also split the tests into two patches -
mailbox-tests-2.7-part1-for-copy-back.diff has the test for the
original issue, and passes with the copy-back patch applied,
while mailbox-tests-2.7-part2.diff applies on top and includes
the rest (these involve the separate issues around rereading, and
mostly fail).

--
Added file: 
http://bugs.python.org/file34672/mailbox-tests-2.7-part1-for-copy-back.diff
Added file: http://bugs.python.org/file34673/mailbox-tests-2.7-part2.diff

___
Python tracker 

___# HG changeset patch
# Parent a293c01337a62718938d9639653cf1b8dfffa054

diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py
--- a/Lib/test/test_mailbox.py
+++ b/Lib/test/test_mailbox.py
@@ -13,6 +13,7 @@ from test import test_support
 import unittest
 import mailbox
 import glob
+from contextlib import contextmanager
 try:
 import fcntl
 except ImportError:
@@ -21,6 +22,27 @@ except ImportError:
 # Silence Py3k warning
 rfc822 = test_support.import_module('rfc822', deprecated=True)
 
+try:
+import multiprocessing
+except ImportError:
+multiprocessing = None
+else:
+@contextmanager
+def child_process(func, *args, **kwargs):
+"""Context manager to run a function concurrently in a child process.
+
+Runs func(*args, **kwargs) in a subprocess using
+multiprocessing and waits for it to terminate.
+
+"""
+process = multiprocessing.Process(target=func, args=args, 
kwargs=kwargs)
+try:
+process.start()
+yield
+finally:
+process.join()
+
+
 class TestBase:
 
 def _check_sample(self, msg):
@@ -45,6 +67,53 @@ class TestBase:
 test_support.unlink(target)
 
 
+def add_message(factory, path, msg):
+# Add "msg" to mailbox at "path", using mailbox instance returned
+# by "factory".
+mbox = factory(path)
+try:
+mbox.lock()
+mbox.add(msg)
+finally:
+mbox.close()
+
+def add_two_delete_one(factory, path, msg1, msg2):
+# Add "msg1" and "msg2" to mailbox at "path", then delete "msg1".
+# Uses mailbox instance returned by "factory".
+mbox = factory(path)
+try:
+mbox.lock()
+key = mbox.add(msg1)
+mbox.add(msg2)
+# Flushing out two messages then deleting one ensures that for
+# the single-file mailbox formats, the subsequent flush has to
+# rewrite the mailbox.
+mbox.flush()
+del mbox[key]
+mbox.flush()
+finally:
+mbox.close()
+
+def only_yield():
+yield
+
+def child_func(to_child, from_parent, child, child_args):
+# Used by _subprocess method below.  Waits for Connection object
+# "from_parent" to receive EOF, and then calls "child" with
+# arguments "child_args".
+try:
+to_child.close()
+try:
+from_parent.recv()
+except EOFError:
+pass
+else:
+raise AssertionError("Unexpectedly received data from parent "
+ "process.")
+finally:
+from_parent.close()
+child(*child_args)
+
 class TestMailbox(TestBase):
 
 _factory = None # Overridden by subclasses to reuse tests
@@ -59,6 +128,166 @@ class TestMailbox(TestBase):
 self._box.close()
 self._delete_recursively(self._path)
 
+def _acquire_lock(self, mbox=None):
+# Keep trying to acquire lock on self._box (or mbox if given)
+# until we get it.
+if mbox is None:
+mbox = self._box
+while True:
+try:
+mbox.lock()
+break
+except mailbox.ExternalClashError:
+time.sleep(0.01)
+
+@contextmanager
+def _locked(self, mbox=None):
+# Context manager to lock and unlock self._box, or mbox if given.
+if mbox is None:
+mbox = self._box
+try:
+self._acquire_lock(mbox

[issue21106] Updated Mac folder icon

2014-03-30 Thread Vivek Jain

Vivek Jain added the comment:

I just emailed psf-tradema...@python.org (and CC'd assignee ned.deily) 
requesting permission to use the logo.

--

___
Python tracker 

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



[issue21106] Updated Mac folder icon

2014-03-30 Thread Ned Deily

Ned Deily added the comment:

Thanks for your contribution.  I think the more important issue here is the use 
of the Apple folder icon.  Someone would need to research what restrictions if 
any exist before we could consider using an icon based on it.

The current icons were added back in 2006.  I don't know whether they were 
based on Apple icons and/or to what extent license issues were researched then. 
 Perhaps Jacob or Ronald remembers.  If there is a question, we could just 
eliminate use of the folder icon

changeset:   38177:676492a93c8a
branch:  legacy-trunk
user:Ronald Oussoren 
date:Sun May 14 20:35:41 2006 +
files:   Mac/OSX/Icons/Disk Image.icns Mac/OSX/Icons/IDLE.icns 
Mac/OSX/Icons/Python Folder.icns Mac/OSX/Icons/PythonCompiled.icns 
Mac/OSX/Icons/PythonLauncher.icns Mac/OSX/Icons/PythonSource.icns Mac/
description:
A first cut at replacing the icons on MacOS X. This replaces all icons by icons
based on the new python.org logo. These are also the first icons that are
"proper" OSX icons.

These icons were created by Jacob Rus.

--
nosy: +jrus

___
Python tracker 

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



[issue19655] Replace the ASDL parser carried with CPython

2014-03-30 Thread Eli Bendersky

Eli Bendersky added the comment:

There were no serious objections bar the pre-release timing. Now that we're 
safely in 3.5 territory, can I go ahead and create a patch?

Note that for purposes of review, the Github project linked in the original 
message is more convenient, IMHO

--

___
Python tracker 

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



[issue15955] gzip, bz2, lzma: add option to limit output size

2014-03-30 Thread Nadeem Vawda

Nadeem Vawda added the comment:

Thanks for the patch, Nikolaus. I'm afraid I haven't had a chance to look
over it yet; this past week has been a bit crazy for me. I'll definitely
get back to you with a review in the next week, though.

--

___
Python tracker 

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



[issue21106] Updated Mac folder icon

2014-03-30 Thread Vivek Jain

Vivek Jain added the comment:

Some searching turned up http://www.apple.com/legal/contact/#copyright. I have 
contacted Apple through the form and will keep you guys updated. Hopefully they 
will respond.

--

___
Python tracker 

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



[issue21090] File read silently stops after EIO I/O error

2014-03-30 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Python 2.7 uses C fopen() and fread(), so what happens probably is that fread() 
silences the error.

--
nosy: +pitrou

___
Python tracker 

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



[issue21074] Too aggressive constant folding

2014-03-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> check parameters before compute the result is simple

Handling the general case (all sequences and all operators) isn't really 
simple.  It also involves doing more computations and making more assumptions 
than we want to do in this code (it is not a great place to be  running code 
that could raise exceptions, trigger GC, etc).

I admire your inclination to "fix" this but doing so makes it slower and more 
fragile.  This code has worked well for a long time and we should be reluctant 
to muck with it just to handle an arcane case that has a trivially easy 
work-around.

--

___
Python tracker 

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



[issue18378] locale.getdefaultlocale() fails on Mac OS X with default language set to English

2014-03-30 Thread Ned Deily

Ned Deily added the comment:

I've looked at this a bit, primarily on OS X 10.9 Mavericks, although I expect 
mostly similar behavior on older recent releases of OS X.  On 10.9, the setting 
of locale variables is done by whatever program is used to launch a shell.  I 
looked at the behavior of the built-in Terminal.app, the third-party 
iTerm2.app, the MacPorts distribution of xterm, and the built-in sshd.  By 
default, the latter two do not set any locale env variables.  Both Terminal.app 
and iTerm2.app set either LANG or LC_CTYPE based on the user's settings for 
"Region" and "Preferred Language" in the "System Preferences" -> "Language & 
Region" control panel.  Three examples:

1. "Region" = "United States", "Preferred Language" = "English":
-> LANG=en_US.UTF-8

2. "Region" = "Germany", "Preferred Language" = "German"
-> LANG=de_DE.UTF-8

3. "Region" = "Germany", "Preferred Language" = "English"
-> LC_CTYPE= "UTF-8"

So it is almost certainly the last case that is under discussion here.  Whether 
or not that is a bug is not as clear as it might seem at first.  BSD 
implementations of locale differ from the GNU Linux version.  Both FreeBSD and 
OS X define a "UTF-8" locale that has only one locale category defined in it: 
LC_CTYPE.  It appears to be a fallback locale used when there is no applicable 
region / language combination, in this case no "en_DE*" locales.

$ ls /usr/share/locale/UTF*
LC_CTYPE

Compare with the en_US* locales:

$ ls /usr/share/locale/en_US*
/usr/share/locale/en_US:
LC_COLLATE  LC_CTYPELC_MESSAGES LC_MONETARY LC_NUMERIC  LC_TIME

/usr/share/locale/en_US.ISO8859-1:
LC_COLLATE  LC_CTYPELC_MESSAGES LC_MONETARY LC_NUMERIC  LC_TIME

/usr/share/locale/en_US.ISO8859-15:
LC_COLLATE  LC_CTYPELC_MESSAGES LC_MONETARY LC_NUMERIC  LC_TIME

/usr/share/locale/en_US.US-ASCII:
LC_COLLATE  LC_CTYPELC_MESSAGES LC_MONETARY LC_NUMERIC  LC_TIME

/usr/share/locale/en_US.UTF-8:
LC_COLLATE  LC_CTYPELC_MESSAGES LC_MONETARY LC_NUMERIC  LC_TIME

Now as I read the current POSIX standard, there is nothing wrong with this.  
AFAICT, the standard places no restriction on the format of locale names, in 
particular, it does not mandate that they conform to RFC 1766 or its 
successors.  Further, the standard provides for implementation-specific locales 
(other than the mandatory "POSIX" aka "C" locale) and some platforms provide 
tools to create custom locales, e.g. mklocale(1) on FreeBSD and OS X, 
localedef(1) on GNU Linux.  So I wonder if the locale module should really be 
imposing its own restrictions on locale names as it does currently.

>From IEEE Std 1003.1, 2013 Edition:
"The capability to specify additional locales to those provided by an 
implementation is optional, denoted by the _POSIX2_LOCALEDEF symbol. If the 
option is not supported, only implementation-supplied locales are available. 
Such locales shall be documented using the format specified in this section. 
[...] The locale definition file shall contain one or more locale category 
source definitions, and shall not contain more than one definition for the same 
locale category. [...]  In the event that some of the information for a locale 
category, as specified in this volume of POSIX.1-2008, is missing from the 
locale source definition, the behavior of that category, if it is referenced, 
is unspecified."

There is a further complication for OS X.  Apple provides a richer native API 
for locales, CFLocale (and its Cocoa equivalent, NSLocale).  So some nuances 
may get lost in the imperfect mapping between CFLocale and the conventional 
LC_* environment variables and between them and Python.  We could look at 
trying to support the native APIs as well.

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07
https://developer.apple.com/library/mac/documentation/CoreFoundation/Conceptual/CFLocales/CFLocales.html
https://developer.apple.com/library/mac/documentation/CoreFoundation/Reference/CFLocaleRef/Reference/reference.html

--

___
Python tracker 

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



[issue21044] tarfile does not handle file .name being an int

2014-03-30 Thread Antoine Pietri

Antoine Pietri added the comment:

Ping. The patch is just one line and there's a test case, if someone could 
review that, it would be great!

(For the record I signed the contributor agreement a week ago and my profile 
still hasn't been updated).

--

___
Python tracker 

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



[issue19655] Replace the ASDL parser carried with CPython

2014-03-30 Thread Benjamin Peterson

Benjamin Peterson added the comment:

It certainly seems more compact and simple that the current parser, so +1 from 
me.

--

___
Python tracker 

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



[issue21044] tarfile does not handle file .name being an int

2014-03-30 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +lars.gustaebel

___
Python tracker 

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



[issue21082] os.makedirs(exist_ok=True) is not thread-safe: umask is set temporary to 0, serious security problem

2014-03-30 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +christian.heimes

___
Python tracker 

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



[issue19655] Replace the ASDL parser carried with CPython

2014-03-30 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
nosy: +rhettinger

___
Python tracker 

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



[issue21107] Add pgen.vcxproj to allow regenerating grammar files on Windows

2014-03-30 Thread Zachary Ware

New submission from Zachary Ware:

Here's a patch to allow building (and using) pgen on Windows.

All changes outside of PCbuild are solely to avoid compiler warnings, namely 4 
instances of C4005 for PGEN being redefined and 2 instances of C4018, "'<' : 
signed/unsigned mismatch".

pgen.vcxproj is in large part copied directly from _freeze_importlib.vcxproj 
(and modified appropriately).

pgen is not set to build on any solution configuration, but it happily builds 
from a clean checkout so pythoncore.vcxproj could be made to depend on it.

--
components: Build, Windows
files: windows_pgen.diff
keywords: patch
messages: 215218
nosy: loewis, tim.golden, tim.peters, zach.ware
priority: low
severity: normal
status: open
title: Add pgen.vcxproj to allow regenerating grammar files on Windows
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file34674/windows_pgen.diff

___
Python tracker 

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



[issue19655] Replace the ASDL parser carried with CPython

2014-03-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

+1 for moving this forward as early in the 3.5 cycle as possible.

--

___
Python tracker 

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



[issue21108] Add doc examples for importlib

2014-03-30 Thread Saimadhav Heblikar

New submission from Saimadhav Heblikar:

The imp module was the defacto module to access the import internals,upto 3.3
It has been deprecated(pending) in 3.4 in favor of importlib.
There are plenty of examples on how to use imp around the web, but very little 
(even in doc.python.org), on how to use importlib. 

The proposed patch adds couple of examples. These examples are aimed towards 
people, who were earlier using imp's load_module().

Inspiration for the patch from this SO answer, where user had to go through 
source code.
http://stackoverflow.com/questions/19009932/import-abitrary-python-source-file-python-3-3

--
assignee: docs@python
components: Documentation
files: importlib-example.patch
keywords: patch
messages: 215220
nosy: docs@python, sahutd
priority: normal
severity: normal
status: open
title: Add doc examples for importlib
versions: Python 3.4
Added file: http://bugs.python.org/file34675/importlib-example.patch

___
Python tracker 

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



[issue21108] Add examples for importlib in doc

2014-03-30 Thread Saimadhav Heblikar

Changes by Saimadhav Heblikar :


--
title: Add doc examples for importlib -> Add examples for importlib in doc

___
Python tracker 

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



[issue21104] Read from file aborted

2014-03-30 Thread Alex Grinko

Changes by Alex Grinko :


--
resolution:  -> works for me
status: open -> closed

___
Python tracker 

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



[issue21108] Add examples for importlib in doc

2014-03-30 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +brett.cannon, eric.snow, ncoghlan

___
Python tracker 

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