[issue1191964] asynchronous Subprocess

2014-04-03 Thread Richard Oudkerk

Richard Oudkerk added the comment:

I would recommended using _overlapped instead of _winapi.
I intend to move multiprocessing over in future.

Also note that you can do nonblocking reads by starting an overlapped read
then cancelling it immediately if it fails with "incomplete".  You will
need to recheck if it completes anyway because of a race.

--

___
Python tracker 

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



[issue17390] display python version on idle title bar

2014-04-03 Thread bagrat lazaryan

bagrat lazaryan added the comment:

terry, i indeed didn't know about output windows. (or at least i didn't know i 
knew. by the way, what are they?) the logic behind my request is that the file 
being edited in the editor is the most important thing of the editor. a quick 
glance at the taskbar, for those like me that have it set not to combine 
taskbar buttons, or for those on xp and the like, should reveal what is what.

(terry, i received your email but still none from issue tracker, neither in 
spam. the last notification i received was that of msg186751, back in 2013. do 
you think i should file an issue on meta tracker?)

--

___
Python tracker 

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



[issue21136] fractions.Fraction.__pow__ does unneeded renormalization

2014-04-03 Thread Mark Dickinson

Mark Dickinson added the comment:

LGTM.

--

___
Python tracker 

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



[issue21136] fractions.Fraction.__pow__ does unneeded renormalization

2014-04-03 Thread Mark Dickinson

Mark Dickinson added the comment:

Hmm.  Does this work correctly in the case `Fraction(0, 1) ** -2`?

--

___
Python tracker 

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



[issue21136] fractions.Fraction.__pow__ does unneeded renormalization

2014-04-03 Thread Mark Dickinson

Mark Dickinson added the comment:

> Does this work correctly in the case `Fraction(0, 1) ** -2`?

Looks like it doesn't.  How about adding a `_skip_normalization` keyword 
argument to `Fraction.__new__` instead?  That would ensure that any future 
changes made to `__new__` don't get skipped by this fast path.

--

___
Python tracker 

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



[issue21136] fractions.Fraction.__pow__ does unneeded renormalization

2014-04-03 Thread Mark Dickinson

Mark Dickinson added the comment:

(And other operations like `__pos__`, `__neg__` and `__abs__` would benefit 
from a `_skip_normalization` flag, too.)

--

___
Python tracker 

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



[issue21142] Daily/weekly ABI scan?

2014-04-03 Thread Nick Coghlan

New submission from Nick Coghlan:

At Anatoly's prompting, Andrey Ponomarenko set up ABI/API compatibility checks 
for CPython on the Linux upstream tracker (http://upstream-tracker.org/)

Everything: http://upstream-tracker.org/versions/python.html
Public API/ABI (no leading underscores): 
http://upstream-tracker.org/versions/python_public_api.html
3.2 limited API/stable ABI (no leading underscores): 
http://upstream-tracker.org/versions/python_stable_api.html

Andrey's analysis in the python-ideas thread [1] indicates we've likely made 
some mistakes in exposing struct internals, as well as exposing new APIs 
unintentionally under older Py_LIMITED_API definitions.

There's probably not too much (if anything) we can do to rectify the past 
mistakes, but we could set up a daily or weekly check (akin to the existing 
refleak scan) that monitored for such mistakes to prevent the introduction of 
any new errors along these lines.

[1] https://mail.python.org/pipermail/python-dev/2014-April/133754.html

--
messages: 215432
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: Daily/weekly ABI scan?
type: enhancement

___
Python tracker 

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



[issue21116] Failure to create multiprocessing shared arrays larger than 50% of memory size under linux

2014-04-03 Thread Médéric Boquien

Médéric Boquien added the comment:

"the process will get killed when first writing to the page in case of memory 
pressure."

According to the documentation, the returned shared array is zeroed. 
https://docs.python.org/3.4/library/multiprocessing.html#module-multiprocessing.sharedctypes

In that case because the entire array is written at allocation, the process is 
expected to get killed if allocating more memory than available. Unless I am 
misunderstanding something, which is entirely possible.

--

___
Python tracker 

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



[issue21143] Copy-paste error in documentation of __builtin__.max

2014-04-03 Thread Jyrki Pulliainen

New submission from Jyrki Pulliainen:

Looks like the documentation of the __builtin__.max() got copied over from the 
__builtin__.min.

Instead of "the smallest of the positional arguments" it should say "the 
largest of the positional arguments".

This was introduced in 3.4. Patch attached.

Thanks to chiman@#python.fi for spotting this!

--
assignee: docs@python
components: Documentation
files: fix-typo-in-max.patch
keywords: patch
messages: 215434
nosy: docs@python, nailor
priority: normal
severity: normal
status: open
title: Copy-paste error in documentation of __builtin__.max
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file34712/fix-typo-in-max.patch

___
Python tracker 

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



[issue21143] Copy-paste error in documentation of __builtin__.max

2014-04-03 Thread Berker Peksag

Berker Peksag added the comment:

I also fixed this as part of issue 20620.

--
nosy: +berker.peksag

___
Python tracker 

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



[issue21137] Better repr for threading.Lock()

2014-04-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The repr of threading._RLock contains owner and count, but not lock/unlock 
status. The repr of locks from _dummy_thread also should contain lock/unlock 
status. And it would be nice to have the open/closed status in the repr of 
other synchronization primitives: Condition, Semaphore, etc. 

As for tests, I think assertRegex() will produce more useful error report.

--
nosy: +serhiy.storchaka
stage:  -> patch review

___
Python tracker 

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



[issue21137] Better repr for threading.Lock()

2014-04-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

And of course we should keep "at 0x..." part, because it is the way to 
distinguish different lock objects.

--

___
Python tracker 

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



[issue21144] ensurepip "AssertionError: Multiple .dist-info directories"

2014-04-03 Thread Nikolaus Demmel

New submission from Nikolaus Demmel:

I am installing python 3.4 on OS X 10.9 Mavericks via Homebrew.

The Homebrew formula is: 
https://github.com/Homebrew/homebrew/blob/4bd9b7538297c2ecbcaba281a6db86e8d8f660c8/Library/Formula/python3.rb

During the installation, `ensurepip` is called, but failes with 
"AssertionError: Multiple .dist-info directories".

I have reported this downstream with Homebrew, but it is suggested that this is 
an upstream issue: https://github.com/Homebrew/homebrew/issues/28035

The ensurepip output can be seen here: 
https://gist.github.com/NikolausDemmel/9952010#file-python3-4-installation-with-homebrew-L685-L709

And the mentioned log file here: 
https://gist.github.com/NikolausDemmel/9952010#file-python3-4-installation-with-homebrew-L751-L784

--
messages: 215438
nosy: demmeln
priority: normal
severity: normal
status: open
title: ensurepip "AssertionError: Multiple .dist-info directories"
type: crash
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



[issue21145] Add the @cached_property decorator

2014-04-03 Thread Omer Katz

New submission from Omer Katz:

cached properties are widely used in various prominent Python projects such as 
Django and pip (and many more).
They are not very complicated and there are proven implementation out there. 
Unfortunately there are way too many of them. This situation leads me to 
suggest adding it to the builtins.

Possible benefits:
* Implementation in C can improve caching performance
* Standardized implementation that can be used anywhere

--
messages: 215439
nosy: Omer.Katz
priority: normal
severity: normal
status: open
title: Add the @cached_property decorator
type: enhancement
versions: Python 3.5

___
Python tracker 

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



[issue21146] update gzip usage examples in docs

2014-04-03 Thread Wolfgang Maier

New submission from Wolfgang Maier:

The current documentation of the gzip module should have its section "12.2.1. 
Examples of usage" updated to reflect the changes made to the module in 
Python3.2 (https://docs.python.org/3.2/whatsnew/3.2.html#gzip-and-zipfile).

Currently, the recipe given for gz-compressing a file is:

import gzip
with open('/home/joe/file.txt', 'rb') as f_in:
with gzip.open('/home/joe/file.txt.gz', 'wb') as f_out:
f_out.writelines(f_in)

which is clearly sub-optimal because it is line-based.

An equally simple, but more efficient recipe would be:

chunk_size = 1024
with open('/home/joe/file.txt', 'rb') as f_in:
with gzip.open('/home/joe/file.txt.gz', 'wb') as f_out:
while True:
c = f_in.read(chunk_size)
if not c: break
d = f_out.write(c)

Comparing the two examples I find a >= 2x performance gain (both in terms of 
CPU time and wall time).

In the inverse scenario of file *de*-compression (which is not part of the docs 
though), the performance increase of substituting:

with gzip.open('/home/joe/file.txt.gz', 'rb') as f_in:
with open('/home/joe/file.txt', 'wb') as f_out:
f_out.writelines(f_in)

with:

with gzip.open('/home/joe/file.txt.gz', 'rb') as f_in:
with open('/home/joe/file.txt', 'wb') as f_out:
while True:
c = f_in.read(chunk_size)
if not c: break
d = f_out.write(c)

is even higher (4-5x speed-ups).

In the de-compression case, another >= 2x speed-up can be achieved by avoiding 
the gzip module completely and going through a zlib.decompressobj instead, but 
of course this is a bit more complicated and should be documented in the zlib 
docs rather than the gzip docs (if you're interested, I could provide my code 
for it though).
Using the zlib library compression/decompression speed gets comparable to linux 
gzip/gunzip.

--
assignee: docs@python
components: Documentation
messages: 215440
nosy: docs@python, wolma
priority: normal
severity: normal
status: open
title: update gzip usage examples in docs
type: performance
versions: 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



[issue21142] Daily/weekly ABI scan?

2014-04-03 Thread Andrey

Andrey added the comment:

There are just three simple steps to setup ABI checker:

1. Create ABI dump of the _reference_ version (see instructions [1]) and commit 
it to the source tree (ABI-ref.dump):

$> abi-compliance-checker -l python -dump descriptor.xml -dump-path ABI-ref.dump

2. Create ABI dump of the _current_ version (ABI-cur.dump)
3. Compare these ABI dumps:

$> abi-compliance-checker -l python -old ABI-ref.dump -new ABI-cur.dump 
-report-path abi-report.html

To skip analysis of symbols with leading underscore pass this additional option 
to the tool when comparing ABI dumps: --skip-internal="\A_"

For more information see [2].

[1] https://mail.python.org/pipermail/python-dev/2014-April/133754.html
[2] http://ispras.linuxbase.org/index.php/ABI_compliance_checker

--
nosy: +aponomarenko

___
Python tracker 

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



[issue21145] Add the @cached_property decorator

2014-04-03 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



[issue21140] Idle: saving an OutputWindow should default to .txt

2014-04-03 Thread Saimadhav Heblikar

Changes by Saimadhav Heblikar :


--
nosy: +sahutd

___
Python tracker 

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



[issue21146] update gzip usage examples in docs

2014-04-03 Thread INADA Naoki

INADA Naoki added the comment:

Maybe, shutil.copyfileobj() is good.

import gzip
import shutil

with open(src, 'rb') as f_in:
with gzip.open(dst, 'wb') as f_out:
shutil.copyfileobj(f_in, f_out)

--
nosy: +naoki

___
Python tracker 

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



[issue21146] update gzip usage examples in docs

2014-04-03 Thread Wolfgang Maier

Wolfgang Maier added the comment:

>> with open(src, 'rb') as f_in:
>> with gzip.open(dst, 'wb') as f_out:
>>shutil.copyfileobj(f_in, f_out)

+1 !!
exactly as fast as my suggestion (with compression and de-compression), but a 
lot clearer !
Hadn't thought of it.

--

___
Python tracker 

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



[issue21146] update gzip usage examples in docs

2014-04-03 Thread Wolfgang Maier

Wolfgang Maier added the comment:

same speed is not surprising though as shutil.copyfileobj is implemented like 
this:

def copyfileobj(fsrc, fdst, length=16*1024):
"""copy data from file-like object fsrc to file-like object fdst"""
while 1:
buf = fsrc.read(length)
if not buf:
break
fdst.write(buf)

which is essentially what I was proposing :)

--

___
Python tracker 

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



[issue20375] ElementTree: Document handling processing instructions

2014-04-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 871278b87c62 by Eli Bendersky in branch '3.4':
Issue #20375: Clarify ET's parsing of comments and processing instructions.
http://hg.python.org/cpython/rev/871278b87c62

New changeset 5c3166ec80e1 by Eli Bendersky in branch 'default':
Issue #20375: Clarify ET's parsing of comments and processing instructions.
http://hg.python.org/cpython/rev/5c3166ec80e1

--
nosy: +python-dev

___
Python tracker 

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



[issue20375] ElementTree: Document handling processing instructions

2014-04-03 Thread Eli Bendersky

Eli Bendersky added the comment:

Thanks. Doc patch committed with some slight rewording.

Would you like to prepare a separate patch for the tests, default branch only 
this time?

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



[issue21144] ensurepip "AssertionError: Multiple .dist-info directories"

2014-04-03 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +dstufft

___
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-04-03 Thread Eli Bendersky

Eli Bendersky added the comment:

Since there has mostly been support for this, I'll wait a couple more days and 
commit it unless someones objects or asks for more time for review.

--

___
Python tracker 

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



[issue21034] Python docs reference the Distribute package which has been deprecated in favor of Setuptools

2014-04-03 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Good point. Perhaps we should reccomend 
https://raw.github.com/pypa/pip/master/contrib/get-pip.py instead, though?

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue21135] Remove useless _vb_pattern parameter in cgi.valid_boundary

2014-04-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 54bd06097619 by Benjamin Peterson in branch '3.4':
remove unused argument (closes #21135)
http://hg.python.org/cpython/rev/54bd06097619

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

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



[issue20887] stdlib compatibility with pypy, test_zipfile.py

2014-04-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 03df2c1c6892 by Benjamin Peterson in branch '2.7':
properly close files in test_zipfile (#20887)
http://hg.python.org/cpython/rev/03df2c1c6892

--
nosy: +python-dev

___
Python tracker 

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



[issue20887] stdlib compatibility with pypy, test_zipfile.py

2014-04-03 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Thanks for the patch. 3.x test_zipfile can be dealt with elsewhere if desired.

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



[issue21143] Copy-paste error in documentation of __builtin__.max

2014-04-03 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8fe2bb0c5851 by Raymond Hettinger in branch '3.4':
Issue 21143: Fix typo in docs for max().
http://hg.python.org/cpython/rev/8fe2bb0c5851

--
nosy: +python-dev

___
Python tracker 

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



[issue21143] Copy-paste error in documentation of __builtin__.max

2014-04-03 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Thanks for the report.

--
nosy: +rhettinger
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



[issue21140] Idle: saving an OutputWindow should default to .txt

2014-04-03 Thread Saimadhav Heblikar

Saimadhav Heblikar added the comment:

Attaching a patch.
The file type on OutputWIndow defaults to .txt. Can be very easily made to 
default to none aswell.

Tested on linux for 2.7 and 3.4.(Debian Wheezy, Gnome 3)


On 2.7, made changes so that ispythonsource(in EditorWindow) behaves similar to 
3.4(in EditorWindow)

On both 2.7 and 3.4, made change to ispythonsource(in OutputWindow), to make it 
return False instead of 0(to mirror behavior in EditorWindow)

--
keywords: +patch
Added file: http://bugs.python.org/file34713/issue21140-27.patch

___
Python tracker 

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



[issue21140] Idle: saving an OutputWindow should default to .txt

2014-04-03 Thread Saimadhav Heblikar

Changes by Saimadhav Heblikar :


Added file: http://bugs.python.org/file34714/issue21140-34.patch

___
Python tracker 

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



[issue21034] Python docs reference the Distribute package which has been deprecated in favor of Setuptools

2014-04-03 Thread Jurko Gospodnetić

Jurko Gospodnetić added the comment:

Or, if you do not want to get into the specifics of how
to manually install setuptools/pip, it would probably be
better to just refer the user to the 'ensurepip' module
for the initial installation and tell him to upgrade
whatever is needed from there without going in to any
further details here.

'ensurepip' module itself is documented elsewhere 
(https://docs.python.org/3.4/library/ensurepip.html),
and that documentation should perhaps be updated to
include enough information (or references to external
documentation containing that information) for the
user to be able to perform the upgrades.

Best regards,
  Jurko Gospodnetić

--

___
Python tracker 

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



[issue17705] Fill Character cannot be \0

2014-04-03 Thread Stefan Krah

Stefan Krah added the comment:

This looks like a duplicate of #12546.

--
resolution:  -> duplicate
stage: patch review -> committed/rejected
status: open -> closed
versions: +Python 3.5 -Python 2.7, Python 3.3

___
Python tracker 

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



[issue17705] Fill Character cannot be \0

2014-04-03 Thread Stefan Krah

Changes by Stefan Krah :


--
superseder:  -> builtin __format__ methods cannot fill with \x00 char

___
Python tracker 

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



[issue12546] builtin __format__ methods cannot fill with \x00 char

2014-04-03 Thread STINNER Victor

STINNER Victor added the comment:

#17705 has been closed as a duplicate of this issue.

--

___
Python tracker 

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



[issue12546] builtin __format__ methods cannot fill with \x00 char

2014-04-03 Thread Eric V. Smith

Changes by Eric V. Smith :


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

___
Python tracker 

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



[issue19279] UTF-7 to UTF-8 decoding crash

2014-04-03 Thread STINNER Victor

STINNER Victor added the comment:

> Georg, is this issue wort to be fixed in 3.2? If yes, use the patch against 
> 2.7.

Ping?

--

___
Python tracker 

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



[issue21147] sqlite3 doesn't complain if the request contains a null character

2014-04-03 Thread STINNER Victor

New submission from STINNER Victor:

>>> import sqlite3
>>> c=sqlite3.connect(":memory:")
>>> c.execute("select 1")

>>> c.execute("select 1").fetchall()
[(1,)]
>>> c.execute("\0select 1").fetchall()
[]

--
messages: 215459
nosy: haypo
priority: normal
severity: normal
status: open
title: sqlite3 doesn't complain if the request contains a null character
versions: Python 3.5

___
Python tracker 

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



[issue21116] Failure to create multiprocessing shared arrays larger than 50% of memory size under linux

2014-04-03 Thread Charles-François Natali

Charles-François Natali added the comment:

> Also, the FreeBSD man page for mmap() has the following warning:

That's mostly important for real file-backed mapping.
In our case, we don't want a file-backed mmap: we expect the mapping to fit
entirely in memory, so the writeback/read performance isn't that important
to us.

> Using truncate() to zero extend is not really portable: it is only
guaranteed on XSI-compliant POSIX systems.

Now that's annoying.
How about trying file.truncate() within a try block, and if an error is
raised fallback to the zero-filling?

Doing a lot of IO for an object which is supposed to be used for shared
memory is sad.

Or maybe it's time to add an API to access shared memory from Python (since
that's really what we're trying to achieve here).

> According to the documentation, the returned shared array is zeroed.
> In that case because the entire array is written at allocation, the
process is expected to get killed
> if allocating more memory than available. Unless I am misunderstanding
something, which is entirely
> possible.

Having the memory zero-filed doesn't require a write at all: when you do an
anonymous memory mapping for let's say 1Gb, the kernel doesn't
pre-emptively zero-fill it, it would be way to slow: usually it just sets
up the process page table to make this area a COW of a single zero page:
upon read, you'll read zeros, and upon write, it'll duplicate it as needed.

The only reason the code currently zero-fills the file is to avoid the
portability issues detailed by Richard.

--

___
Python tracker 

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



[issue21148] avoid memset in small tuple creation

2014-04-03 Thread Julian Taylor

New submission from Julian Taylor:

attached a prototype patch that avoids the memset of ob_item in PyTuple_New 
which is not necessary for the BUILD_TUPLE bytecode and PyTuple_Pack as these 
overwrite every entry in ob_item anyway.
This improves small tuple creation by about 5%.

It does this by adding a new internal function that does not use the memset 
loop and wrapping that in PyTuple_New that does it. _Pack and ceval call the 
internal function.
The patch still needs cleanup I don't know where the signature for ceval.c 
would best go. Does the internal function need to be hidden from the DSO?

microbenchmark, compiled with gcc-4.8.2 on ubuntu 14.04 amd64, default 
configure options:

import timeit
print(min(timeit.repeat("(a,)", setup="a = 1; b = 1", repeat=5, number=10**7)))
print(min(timeit.repeat("(a, b)", setup="a = 1; b = 1", repeat=5, 
number=10**7)))

before:
0.45767
0.52926

after:
0.42652
0.50122

larger tuples do not profit much as the loading is more expensive in comparison.

--
components: Interpreter Core
files: avoid-memset.patch
keywords: patch
messages: 215461
nosy: jtaylor
priority: normal
severity: normal
status: open
title: avoid memset in small tuple creation
type: performance
versions: Python 3.5
Added file: http://bugs.python.org/file34715/avoid-memset.patch

___
Python tracker 

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



[issue21124] _struct module compilation error under Cygwin 1.7.17 on Python 3.4

2014-04-03 Thread Ned Deily

Changes by Ned Deily :


--
nosy:  -ned.deily
resolution: duplicate -> 
stage: committed/rejected -> 
superseder: Add Mingw recognition to pyport.h to allow building extensions -> 

___
Python tracker 

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



[issue21034] Python docs reference the Distribute package which has been deprecated in favor of Setuptools

2014-04-03 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue21128] testing stdlib and compatibility with pypy

2014-04-03 Thread mattip

mattip added the comment:

the gc.collect is not needed, sorry. I updated the patch, which affects
test_argparse.py (make files rw before rmtree)
test_file.py (add file.close() )
test_file2k.py (add file.close() )
test_httpservers.py (add file.close() )

--
Added file: http://bugs.python.org/file34716/patch

___
Python tracker 

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



[issue21141] Don't mention Perl in Windows build output

2014-04-03 Thread Zachary Ware

Zachary Ware added the comment:

Here's a slightly revised patch, including documentation changes in 
PCbuild/readme.txt.  Also, this patch doesn't rename build_ssl.(bat|py), so 
Rietveld should accept the patch as reviewable.  I think the renames should 
actually happen, though.

--
Added file: http://bugs.python.org/file34717/issue21141.v2.diff

___
Python tracker 

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



[issue20361] -W command line options and PYTHONWARNINGS environmental variable should not override -b / -bb command line options

2014-04-03 Thread Stefan Krah

Changes by Stefan Krah :


--
nosy:  -skrah

___
Python tracker 

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



[issue20355] -W command line options should have higher priority than PYTHONWARNINGS environmental variable

2014-04-03 Thread Stefan Krah

Changes by Stefan Krah :


--
nosy:  -skrah

___
Python tracker 

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



[issue19354] test_format fails on RHEL-6

2014-04-03 Thread Stefan Krah

Stefan Krah added the comment:

Is this still an issue?

--
status: open -> pending

___
Python tracker 

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



[issue20375] ElementTree: Document handling processing instructions

2014-04-03 Thread Nikolaus Rath

Nikolaus Rath added the comment:

Thanks for the commit!

My intention is to fix the behavior itself for 3.5 (see issue 9521), so I think 
adding testcases for the old behavior in the meantime isn't necessary.

--

___
Python tracker 

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



[issue21149] logging._removeHandlerRef is not threadsafe during interpreter shutdown

2014-04-03 Thread Devin Jeanpierre

New submission from Devin Jeanpierre:

If another thread is active during interpreter shutdown, it can hold the last 
reference to a handler; when it drops that reference, the weakref callback -- 
_removeHandlerRef -- will be executed in this other thread. So while this 
callback is running, the main thread is replacing module globals with None. 
This creates a data race for the globals in logging -- for example, 
_releaseLock can be replaced with None after the "_releaseLock is not None" 
check, but before it is used.

In principle I suspect this could cause a deadlock, in practice all I've seen 
are exception messages mentioning how None is not callable.

I have attached a patch that I think resolves this issue. The patch is written 
against 2.7, although I expect this issue affects all versions of Python prior 
to 3.4

BTW, the copyright for this patch belongs to my employer, Google; please let me 
know if there are any contributor agreements or such that my employer needs to 
look at.

--
components: Library (Lib)
files: patch.diff
keywords: patch
messages: 215466
nosy: Devin Jeanpierre, gregory.p.smith
priority: normal
severity: normal
status: open
title: logging._removeHandlerRef is not threadsafe during interpreter shutdown
versions: Python 2.7
Added file: http://bugs.python.org/file34718/patch.diff

___
Python tracker 

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



[issue18062] m68k FPU precision issue

2014-04-03 Thread Stefan Krah

Stefan Krah added the comment:

Can we somehow merge this issue with #20904?

--

___
Python tracker 

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



[issue21150] Add quick links table to argparse docs

2014-04-03 Thread Raymond Hettinger

New submission from Raymond Hettinger:

The argparse module has many functions and options.

It would benefit from a summary and quick links table at the top of the page 
just like we have for the itertools module docs and the builtins module docs.

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 215468
nosy: docs@python, rhettinger
priority: normal
severity: normal
stage: needs patch
status: open
title: Add quick links table to argparse docs
versions: Python 3.5

___
Python tracker 

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



[issue21149] logging._removeHandlerRef is not threadsafe during interpreter shutdown

2014-04-03 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue21148] avoid memset in small tuple creation

2014-04-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

A 5% improvement on a micro-benchmark probably means 0% on real workloads. You 
could try to run the benchmarks suite at http://hg.python.org/benchmarks

--
nosy: +pitrou

___
Python tracker 

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



[issue20904] HAVE_PY_SET_53BIT_PRECISION for m68k

2014-04-03 Thread mirabilos

mirabilos added the comment:

Veto on m68k-float-prec.patch for Linux/m68k for now.

Reasoning is same as in #18062 (thanks skrah for linking it):

Enabling this *will* break Python on Linux/m68k on the most
widespread emulator in all released versions of that emulator
(ARAnyM) because the emulator does not handle reducing precision
correctly.

The same applies to all other m68k OSes running in ARAnyM
(FreeMiNT comes to mind, I believe it could run Python).

I think this could be applied when a released version of
ARAnyM that works correctly even with this patch is in,
say, Debian oldstable and RHEL, or something like that.

The problem here is that this *will* create a run-time issue.
(I had prepared a similar patch, but decided to fix the old
dtoa code instead due to the emulator issue.)

--
nosy: +mirabilos

___
Python tracker 

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



[issue1100942] Add datetime.time.strptime and datetime.date.strptime

2014-04-03 Thread Maciej Szulik

Maciej Szulik added the comment:

I've just checked the patch still applies to current HEAD. What about the 
question regarding 0's in date.strptime(...) I asked in previous comment? I'd 
like to move this issue forward now when 3.4 is released.

--

___
Python tracker 

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



[issue20375] ElementTree: Document handling processing instructions

2014-04-03 Thread Eli Bendersky

Eli Bendersky added the comment:

On Thu, Apr 3, 2014 at 1:19 PM, Nikolaus Rath wrote:

>
> Nikolaus Rath added the comment:
>
> Thanks for the commit!
>
> My intention is to fix the behavior itself for 3.5 (see issue 9521), so I
> think adding testcases for the old behavior in the meantime isn't necessary.
>

Fair enough. So you can close this issue, then.

--

___
Python tracker 

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



[issue21118] str.translate is absurdly slow in majority of use cases (takes up to 60x longer than similar functions)

2014-04-03 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Hmm... Maybe I'm testing it wrong, but I'm finding your patch is slowing down 
translation by a small amount on my test case; not a lot, maybe a 10% slowdown 
on enlarging translations, 6% for 1-1, and deletion in between.

--

___
Python tracker 

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



[issue1100942] Add datetime.time.strptime and datetime.date.strptime

2014-04-03 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Is this documentation still valid?

+.. staticmethod:: date.strptime(date_string, format)
+
+   Return a :class:`date` corresponding to *date_string*, parsed according to
+   *format*.  This is equivalent to ``date(*(time.strptime(date_string,
+   format)[0:3]))``.

I understand that the latest patch includes checking for time fields in date 
format.

--

___
Python tracker 

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



[issue14060] Implement a CSP-style channel

2014-04-03 Thread Sarah Mount

Changes by Sarah Mount :


--
nosy: +snim2

___
Python tracker 

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



[issue20904] HAVE_PY_SET_53BIT_PRECISION for m68k

2014-04-03 Thread Andreas Schwab

Andreas Schwab added the comment:

> Enabling this *will* break Python on Linux/m68k

??? It will not of course, it will *fix* it.  You have no idea what you are 
talking about.

--

___
Python tracker 

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



[issue21141] Don't mention Perl in Windows build output

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

Martin v. Löwis added the comment:

Can you please explain what this has to do with dropping the mentioning of Perl?

--

___
Python tracker 

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



[issue20904] HAVE_PY_SET_53BIT_PRECISION for m68k

2014-04-03 Thread mirabilos

mirabilos added the comment:

Andreas Schwab dixit:

>Andreas Schwab added the comment:
>
>> Enabling this *will* break Python on Linux/m68k
>
>??? It will not of course, it will *fix* it.  You have no idea what you are 
>talking about.

No: it will break Debian/m68k which heavily uses Python, because:

- on real metal m68k, the asm function will be tested and work,
  so it will be used, including the new dtoa code
- the binaries with that will be uploaded to the archive
- now, on emulated m68k (ARAnyM), those binaries will use the
  new dtoa code instrad of the old one, but the asm instructions
  to change FPU precision will SILENTLY FAIL, which will lead
  to incorrect results

bye,
//mirabilos
-- 
 exceptions: a truly awful implementation of quite a nice idea.
 just about the worst way you could do something like that, afaic.
 it's like anti-design.   that too… may I quote you on that?
 sure, tho i doubt anyone will listen ;)

--

___
Python tracker 

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



[issue21128] testing stdlib and compatibility with pypy

2014-04-03 Thread Benjamin Peterson

Benjamin Peterson added the comment:

This patch appears to have been generated against a pypy checkout rather than a 
cpython checkout.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue21149] logging._removeHandlerRef is not threadsafe during interpreter shutdown

2014-04-03 Thread Vinay Sajip

Vinay Sajip added the comment:

> please let me know if there are any contributor agreements

Yes, there is a contributor agreement form which needs to be completed and 
signed:

https://www.python.org/psf/contrib/contrib-form-python/

--

___
Python tracker 

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



[issue20904] HAVE_PY_SET_53BIT_PRECISION for m68k

2014-04-03 Thread Andreas Schwab

Andreas Schwab added the comment:

There is no excuse for using a broken emulator.

--

___
Python tracker 

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



[issue21116] Failure to create multiprocessing shared arrays larger than 50% of memory size under linux

2014-04-03 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Or maybe it's time to add an API to access shared memory from Python
> (since
> that's really what we're trying to achieve here).

That sounds like a good idea. Especially since we now have the memoryview type.

--

___
Python tracker 

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



[issue20904] HAVE_PY_SET_53BIT_PRECISION for m68k

2014-04-03 Thread mirabilos

mirabilos added the comment:

Andreas Schwab dixit:

>There is no excuse for using a broken emulator.

Sure, if nobody releases a fixed version… and even then,
there’s got to be a grace period.

I say that if you break ARAnyM you kill off Debian/m68k
on ARAnyM (and I’ll have to shut down my buildd, too).

>

bye,
//mirabilos
-- 
 Beware of ritual lest you forget the meaning behind it.
 yeah but it means if you really care about something, don't
ritualise it, or you will lose it. don't fetishise it, don't
obsess. or you'll forget why you love it in the first place.

--

___
Python tracker 

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



[issue20375] ElementTree: Document handling processing instructions

2014-04-03 Thread Nikolaus Rath

Changes by Nikolaus Rath :


--
status: open -> closed

___
Python tracker 

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



[issue21149] logging._removeHandlerRef is not threadsafe during interpreter shutdown

2014-04-03 Thread Devin Jeanpierre

Devin Jeanpierre added the comment:

Are you sure? There should have been many previous contributions by Google, so 
the relevant copyright agreements _should_ have already been signed.

I asked internally and was told that a corporate version of this agreement had 
been signed a long time ago.

--

___
Python tracker 

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



[issue21149] logging._removeHandlerRef is not threadsafe during interpreter shutdown

2014-04-03 Thread R. David Murray

R. David Murray added the comment:

Yes, I remember previous discussions of the corporate agreement from Google, so 
I'm sure it exists.

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



[issue21140] Idle: saving an OutputWindow should default to .txt

2014-04-03 Thread Raymond Hettinger

Raymond Hettinger added the comment:

FWIW, students commonly save shell sessions as a record of everything they 
tried in call.  It would nice if there were a way to trigger a periodic 
autosave (perhaps every five minutes or so).

--
nosy: +rhettinger

___
Python tracker 

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



[issue21151] winreg.SetValueEx causes crash if value = None

2014-04-03 Thread Dave Odell

New submission from Dave Odell:

Here's a small program that crashes Python 3.

import winreg
winreg.SetValueEx(winreg.HKEY_CURRENT_USER, 'Value', 0, 3, None)

I get a 0xC374 exception (STATUS_HEAP_CORRUPTION) when trying to run this. 
Here's a stack dump:

(snip)
ntdll.dll!RtlpLogHeapFailure+0xa4
ntdll.dll! ?? ::FNODOBFM::`string'+0x10c7c
kernel32.dll!HeapFree+0xa
MSVCR100.dll!free+0x1c
python34.dll!PySetValueEx+0xf8
python34.dll!PyCFunction_Call+0x12d
python34.dll!call_function+0x2ab
python34.dll!PyEval_EvalFrameEx+0x2259
python34.dll!PyEval_EvalCodeEx+0x65c
python34.dll!PyEval_EvalCode+0x2e
python34.dll!builtin_exec+0x1b5
python34.dll!PyCFunction_Call+0x12d
python34.dll!call_function+0x2ab
python34.dll!PyEval_EvalFrameEx+0x2259
python34.dll!PyEval_EvalCodeEx+0x65c
python34.dll!function_call+0x15d
python34.dll!PyObject_Call+0x61
python34.dll!ext_do_call+0x2ab
python34.dll!PyEval_EvalFrameEx+0x22fe
python34.dll!PyEval_EvalCodeEx+0x65c
python34.dll!fast_function+0x14d
python34.dll!call_function+0x311
python34.dll!PyEval_EvalFrameEx+0x2259
python34.dll!PyEval_EvalCodeEx+0x65c
python34.dll!PyEval_EvalCode+0x2e
python34.dll!run_mod+0x53
python34.dll!PyRun_StringFlags+0x9c
python34.dll!PyRun_SimpleStringFlags+0x41
python34.dll!run_command+0x55
python34.dll!Py_Main+0x683
pythonw.exe!__tmainCRTStartup+0x166
kernel32.dll!BaseThreadInitThunk+0xd
ntdll.dll!RtlUserThreadStart+0x1d

System is Windows 7 64-bit, with stock x86-64 Python 3.4.0 binaries.

Incidentally, I was feeding the 'None' to winreg.SetValueEx because that is the 
value that winreg.EnumValue returns for zero-length binary values. This is 
somewhat unexpected; I'd personally prefer to get b'' in that instance.

--
components: Library (Lib), Windows
messages: 215486
nosy: dmo2118, stutzbach
priority: normal
severity: normal
status: open
title: winreg.SetValueEx causes crash if value = None
type: crash
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



[issue21141] Don't mention Perl in Windows build output

2014-04-03 Thread Zachary Ware

Zachary Ware added the comment:

Sure; currently, the "ssl" project emits messages from build_ssl.py concerning 
the finding of Perl.  On a machine with a usable Perl, it's just

   "  Found a working perl at 'C:\Perl\bin\perl.exe'"

On machines without Perl, its the more worrisome

   """
   Can not find a suitable PERL:
NO perl interpreters were found on this machine at all!
Please install ActivePerl and ensure it appears on your path
   No Perl installation was found. Existing Makefiles are used.
   """

The last line of that message (and the fact that the ssl-related projects build 
ok anyway, if using source from svn.python.org) ought to make it clear that 
Perl really isn't necessary, but removing the messages entirely removes the 
possibility of misunderstanding.  The messages are still useful if you actually 
need the preparation part of build_ssl.py, though, so I don't want to just 
remove them from the script.  Divorcing the building from the preparation has 
other benefits as well, which IMO would stand on their own, but that wasn't my 
main goal here.

As for the brief discussion of Perl that remains in readme.txt, I think it 
should stay as long as we include a mention of how to use non-svn.python.org 
sources, just so that anyone needing to do a non-standard build will have some 
warning.  On the other hand, readme.txt could just give the script invocation, 
and leave it up to the script to recommend Perl if it's not available.

--

___
Python tracker 

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



[issue21145] Add the @cached_property decorator

2014-04-03 Thread Madison May

Madison May added the comment:

There's currently an example of a cached property decorator implementation in 
the wiki, although it doesn't leverage functools:
https://wiki.python.org/moin/PythonDecoratorLibrary#Cached_Properties

--
nosy: +madison.may

___
Python tracker 

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



[issue17390] display python version on idle title bar

2014-04-03 Thread Westley Martínez

Westley Martínez added the comment:

I second that the title should start with the filename, by default.  This seems 
to be the precedent, and it makes it easy when working with multiple files.

Example:
xxx.py - IDLE x.y.z: C:\mydir\xxx.py

Terry, I think we can generalize this as ' - : 
' and apply it to all windows.  The first element essentially 
guarantees that the title name will be a good one for the taskbar.  We can 
apply this to say the FIF output window:
Matches for "hello" - IDLE x.y.z: C:\output.txt

but maybe everything after the hyphen isn't necessary.  I wonder if long titles 
could be annoying or distracting.  Regardless, anything more specific than 
'Output Window' will be better.

--

___
Python tracker 

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



[issue21151] winreg.SetValueEx causes crash if value = None

2014-04-03 Thread eryksun

eryksun added the comment:

In Py2Reg, the REG_BINARY (3) case sets `*retDataSize = 0` when the value is 
None: 

http://hg.python.org/cpython/file/04f714765c13/PC/winreg.c#l766

It doesn't modify *retDataBuf. Then in PySetValueEx, PyMem_DEL is called for 
the uninitialized address in data:

http://hg.python.org/cpython/file/04f714765c13/PC/winreg.c#l1566

Py2Reg in this case could also set `*retDataBuf = NULL`. RegSetValueEx allows 
lpData to be NULL when cbData is 0. 

http://msdn.microsoft.com/en-us/library/ms724923

--
nosy: +eryksun

___
Python tracker 

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



[issue1100942] Add datetime.time.strptime and datetime.date.strptime

2014-04-03 Thread Maciej Szulik

Maciej Szulik added the comment:

Alexander yes it's correct. It's checking for time part in date.strptime and 
for time part in time.strptime. The only problem I came into is that when 
passing 0 hours or 0 minutes into date.strptime it won't raise an exception, 
though doc explicitly says: "(...) ValueError is raised if the date string 
(...) the time part is nonzero". So I'm not sure whether this is enough or 
should I add additional checks if time part was set?

--

___
Python tracker 

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



[issue21136] fractions.Fraction.__pow__ does unneeded renormalization

2014-04-03 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Thanks Mark, that is an excellent suggestion.

--
Added file: http://bugs.python.org/file34719/fraction_pow2.diff

___
Python tracker 

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



[issue20969] Author of EPUB version of Python docs is set to Unknown instead of PSF

2014-04-03 Thread Christian Clauss

Christian Clauss added the comment:

Makefile and make.bat in 
https://github.com/python/pythondotorg/blob/master/docs are NOT the correct 
files to modify.  It is unclear to where the correct files are.

--

___
Python tracker 

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



[issue21116] Failure to create multiprocessing shared arrays larger than 50% of memory size under linux

2014-04-03 Thread Médéric Boquien

Médéric Boquien added the comment:

Thanks for the explanations Charles-François. I guess the new API would not be 
before 3.5 at least. Is there still a chance to integrate my patch (or any 
other) to improve the situation for the 3.4 series though?

--

___
Python tracker 

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



[issue20904] HAVE_PY_SET_53BIT_PRECISION for m68k

2014-04-03 Thread Andreas Schwab

Andreas Schwab added the comment:

Finn Thain  writes:

> until Aranym gets fixed.

Aranym *is* fixed.

Andreas.

--

___
Python tracker 

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