[issue21379] StopIteration is silenced when raised by generator within context manager

2014-04-28 Thread Nick Coghlan

Nick Coghlan added the comment:

This is expected behaviour - "raise StopIteration" in a generator is equivalent 
to "return", except it can occur inside a called function.

The bug here is in the given context manager definition - it should be taking 
appropriate action if the "next" call failing is supposed to be treated as an 
error rather than termination of the generator.

--
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue21305] PEP 466: update os.urandom

2014-04-28 Thread Donald Stufft

Donald Stufft added the comment:

One of the reasons the PEP was done the way it was done was it allowed you to 
write 2/3 compatible code without version checks. Enhancing that class won't 
land until 3.5 which is 18+ months away. Further more the os.urandom persistent 
FD's already exists and is a complete superset of functionality that a 
random.SystemRandom random would have.

This conversation would have been a lot more useful when the PEP was being 
discussed on python-dev.

--

___
Python tracker 

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



[issue8776] Bytes version of sys.argv

2014-04-28 Thread Nick Coghlan

Nick Coghlan added the comment:

Makes sense to me. Assuming we eventually manage to resolve the POSIX locale 
issue, the bytes variant will become even less useful.

--
resolution: later -> 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



[issue21321] itertools.islice() doesn't release reference to the source iterator when the slice is exhausted

2014-04-28 Thread Anton Afanasyev

Changes by Anton Afanasyev :


Added file: http://bugs.python.org/file35086/issue21321_2.7_e3217efa6edd_4.diff

___
Python tracker 

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



[issue21321] itertools.islice() doesn't release reference to the source iterator when the slice is exhausted

2014-04-28 Thread Anton Afanasyev

Changes by Anton Afanasyev :


Added file: http://bugs.python.org/file35087/issue21321_3.4_8c8315bac6a8_4.diff

___
Python tracker 

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



[issue21321] itertools.islice() doesn't release reference to the source iterator when the slice is exhausted

2014-04-28 Thread Anton Afanasyev

Anton Afanasyev added the comment:

Hi Antoine,
my test works for me. It can be either
>>> a = [1, 2, 3]
or
>>> a = iter([1, 2, 3])
, no matter: both objects will be +1 referenced after taking
>>> b = islice(a, 1)
. 
My test failed without patch and passed with one.

But your test is more straightforward, thanks.
Attaching patches with your test.

--

___
Python tracker 

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



[issue21037] add an AddressSanitizer build option

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

Charles-François Natali added the comment:

I'd like to move this forward: it could IMO be a great way to proactively 
detect potential security defects, and nasty stack/heap/memory corruption in 
general.

The remaining - missing - part is buildbot integration: AFAICT the only 
specific thing to do is to start the process with the ASAN_OPTIONS environment 
variable set to "handle_segv=0", to avoid interference with faulthandler.

But I'm not really familiar with the buildbot support, so if anyone has a 
clue...

--
nosy: +haypo, pitrou

___
Python tracker 

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



[issue21305] PEP 466: update os.urandom

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

Charles-François Natali added the comment:

> Yes, I'm proposing to enhance this class.

The problem is AFAICT there's currently no way to get a file
descriptor to the underlying /dev/urandom (and I don't know how it
works on Windows).

Also, this would duplicate the work which has already been done.

--

___
Python tracker 

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



[issue18314] Have os.unlink remove junction points

2014-04-28 Thread Kim Gräsman

Kim Gräsman added the comment:

By the way, is PyMem_RawMalloc/PyMem_RawFree preferred for memory allocation 
across the board?

If so, I can just prepare a new patch for you with that changed, 
zero-initialization in place and the prefix-overrun fixed. I might get to it 
tonight.

--

___
Python tracker 

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



[issue21305] PEP 466: update os.urandom

2014-04-28 Thread STINNER Victor

STINNER Victor added the comment:

Le 29 avr. 2014 00:22, "Donald Stufft"  a écrit :
> Well except random.SystemRandom doesn't keep the file open (At least in
2.7) and actually it just calls os.urandom under the covers, also it
doesn't make it very nice to get a glob of random bytes.

Yes, I'm proposing to enhance this class.

--

___
Python tracker 

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



[issue17861] put opcode information in one place

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

Martin v. Löwis added the comment:

It would be possible to have the daily DMG builder run "make touch".

--

___
Python tracker 

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



[issue21054] Improve indexing of syntax symbols

2014-04-28 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
dependencies: +Index 'as' in import and with statements -Derby: Convert the 
_sre module to use Argument Clinic

___
Python tracker 

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



[issue21054] Improve indexing of syntax symbols

2014-04-28 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
dependencies: +Derby: Convert the _sre module to use Argument Clinic, Index 
(augmented) assignment symbols

___
Python tracker 

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



[issue1820] Enhance Object/structseq.c to match namedtuple and tuple api

2014-04-28 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> Is accessing _fields a common operation?

Not common at all -- it is used for introspection.

That said, there is nearly zero savings from generating the tuple upon look-up. 
 I would say that using a PyGetSetDef is a false optimization.

--

___
Python tracker 

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



[issue21055] Index (augmented) assignment symbols

2014-04-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d32b6900da6f by Terry Jan Reedy in branch '2.7':
Closes #21055: Index (augmented) assignment symbols.
http://hg.python.org/cpython/rev/d32b6900da6f

New changeset 0b946c8d7837 by Terry Jan Reedy in branch '3.4':
Issue #21055: Index (augmented) assignment symbols.
http://hg.python.org/cpython/rev/0b946c8d7837

--
nosy: +python-dev
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue21048] Index 'as' in import and with statements

2014-04-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I forgot the # in commit message.

Changeset: 90501 (9a0fc12991e2) Closes 21048: Index 'as' in import and with 
statements.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue21352] improve documentation indexing

2014-04-28 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +terry.reedy

___
Python tracker 

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



[issue21026] Document sitecustomize.py problems with pythonw

2014-04-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 79a4560a702f by Terry Jan Reedy in branch '2.7':
Closes #21026: Augment site doc based on experiments. Patch by Carol Willing.
http://hg.python.org/cpython/rev/79a4560a702f

New changeset 3fef95842314 by Terry Jan Reedy in branch '3.4':
Issue #21026: Augment site doc based on experiments. Patch by Carol Willing.
http://hg.python.org/cpython/rev/3fef95842314

--
nosy: +python-dev
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue18314] Have os.unlink remove junction points

2014-04-28 Thread Kim Gräsman

Kim Gräsman added the comment:

Sorry, that wasn't clear. I mean if you change allocator _from_ calloc, make 
sure the buffer is zeroed out after allocation.

--

___
Python tracker 

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



[issue21377] PyBytes_Concat could try to concat in-place

2014-04-28 Thread Nikolaus Rath

Changes by Nikolaus Rath :


Added file: http://bugs.python.org/file35085/issue_21377_r2.diff

___
Python tracker 

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



[issue18314] Have os.unlink remove junction points

2014-04-28 Thread Kim Gräsman

Kim Gräsman added the comment:

Aha, that might cause trouble.

I think you should add a memset() to sero out the newly allocated buffer also, 
I think I may have used calloc to be able to assume it was initialized with 
zeros.

--

___
Python tracker 

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



[issue21377] PyBytes_Concat could try to concat in-place

2014-04-28 Thread Nikolaus Rath

Nikolaus Rath added the comment:

Tentative patch attached. The test suite still passes, but I'm not sure if it 
actually exerts the new code path. Is there a standard way to test the C api?

--
keywords: +patch
Added file: http://bugs.python.org/file35084/issue_21377.diff

___
Python tracker 

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



[issue21380] timezone support in strftime methods broken

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



[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

2014-04-28 Thread Nikolaus Rath

Changes by Nikolaus Rath :


Added file: http://bugs.python.org/file35083/issue_21057_r3.diff

___
Python tracker 

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



[issue20951] SSLSocket.send() returns 0 for non-blocking socket

2014-04-28 Thread Nikolaus Rath

Changes by Nikolaus Rath :


Added file: http://bugs.python.org/file35082/issue20951_r3.diff

___
Python tracker 

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



[issue9253] argparse: optional subparsers

2014-04-28 Thread paul j3

paul j3 added the comment:

Another Stackoverflow question triggered by this issue

http://stackoverflow.com/questions/23349349/argparse-with-required-subparser

--

___
Python tracker 

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



[issue21381] python build crash on Mavericht

2014-04-28 Thread Christian Tismer

Christian Tismer added the comment:

Ned: """In general, we don't test or claim to support building for a deployment 
target lower than the system being built on."""

This is not convincing, because the cpython builds are always
against <$ MACOSX_DEPLOYMENT_TARGET=10.6> .

Other builds use the current OS deployment. See for instance homebrew.
My script uses them all, from a 10.9 version.
This is because I never know what users use for building, and I don't care and 
build just everything.

By your default builds that are uploaded, you do claim that things build for 
10.6 exactly, and nothing else.

I just think that all targets for all versions should build.

Am I mistaken here?

--
priority: low -> normal

___
Python tracker 

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



[issue21381] python build crash on Mavericht

2014-04-28 Thread Ned Deily

Ned Deily added the comment:

In general, we don't test or claim to support building for a deployment target 
lower than the system being built on.  It's always safer to build on the same 
version as the deployment target.  I'll take a look at it, though.

--
nosy: +ned.deily

___
Python tracker 

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



[issue21381] python build crash on Mavericht

2014-04-28 Thread Christian Tismer

New submission from Christian Tismer:

Building python on OSX Mavericks (10.9)
of Python 3.4 crashes when this is set:

MACOSX_DEPLOYMENT_TARGET=10.7

This happens with OSX 10.9.2,
all current updates installed,
as of 2014-04-28.

Demo script:
You can use my attached script to validate this error.
The script builds PySide for 16 configurations.
Exactly on Python 3.4 / OSX 10.7 it crashes.

You can easily tweak the creating loop to just build the crashing case.

Cheers -- Chris

--
components: Build
files: pyside_builder.py
messages: 217458
nosy: Christian.Tismer
priority: low
severity: normal
stage: needs patch
status: open
title: python build crash on Mavericht
type: crash
versions: Python 3.4
Added file: http://bugs.python.org/file35081/pyside_builder.py

___
Python tracker 

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



[issue10872] Add mode to TextIOWrapper repr

2014-04-28 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
resolution: accepted -> 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



[issue13248] deprecated in 3.2/3.3, should be removed in 3.4

2014-04-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2cceb8cb552b by Giampaolo Rodola' in branch 'default':
fix isuse #13248: remove previously deprecated asyncore.dispatcher __getattr__ 
cheap inheritance hack.
http://hg.python.org/cpython/rev/2cceb8cb552b

--

___
Python tracker 

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



[issue15088] PyGen_NeedsFinalizing is public, but undocumented

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

For the record, PyGen_NeedsFinalizing still exists but it isn't used anymore in 
the code base (following PEP 442).

--
nosy: +pitrou

___
Python tracker 

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



[issue18727] test for writing dictionary rows to CSV

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Hi Muhammad,
Sorry, I had forgotten about this issue. I have now committed the patch to 3.5. 
Thanks for your contribution!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue18727] test for writing dictionary rows to CSV

2014-04-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2502843dbedf by Antoine Pitrou in branch 'default':
Issue #18727: improve test coverage of the csv module by testing for 
DictWriter.writerows.
http://hg.python.org/cpython/rev/2502843dbedf

--
nosy: +python-dev

___
Python tracker 

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



[issue18564] Integer overflow in socketmodule

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Michele, do you plan to update this patch?

--

___
Python tracker 

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



[issue13248] deprecated in 3.2/3.3, should be removed in 3.4

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Apparently we missed some of the stuff here.

--

___
Python tracker 

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



[issue19420] Leak in _hashopenssl.c

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

3.3 is in security mode now, so this can be closed IMO.

--
nosy: +pitrou
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue19767] pathlib: iterfiles() and iterdirs()

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Having an `iterdirs()` method next to `iterdir()` is very confusing.
We should find something else, so how about `files()` and `subdirs()`?

--
nosy: +pitrou

___
Python tracker 

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



[issue18400] Minor increase to Pickle test coverage

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Why only test the _Pickler class and not both the Python and C versions?

--
nosy: +pitrou

___
Python tracker 

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



[issue18616] enable more ssl socket options with get_server_certificate

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

To be frank, it's quite easy to open the connection and read the cert yourself, 
so I don't think complicating this API is very useful.
Still, I'm leaving this open so that other developers can chime in.

--
nosy: +christian.heimes, dstufft, giampaolo.rodola, janssen, pitrou

___
Python tracker 

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



[issue20064] PyObject_Malloc is not documented

2014-04-28 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +haypo

___
Python tracker 

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



[issue9307] Py_TPFLAGS_LONG_SUBCLASS is not documented

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This is committed, thank you.

--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed
versions: +Python 3.4 -Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue9307] Py_TPFLAGS_LONG_SUBCLASS is not documented

2014-04-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 37786ae8cc1c by Antoine Pitrou in branch '3.4':
Issue #9307: document the various Py_TPFLAGS_*_SUBCLASS flags.  Patch by Yury 
V. Zaytsev.
http://hg.python.org/cpython/rev/37786ae8cc1c

New changeset d1a03834cec7 by Antoine Pitrou in branch 'default':
Issue #9307: document the various Py_TPFLAGS_*_SUBCLASS flags.  Patch by Yury 
V. Zaytsev.
http://hg.python.org/cpython/rev/d1a03834cec7

--
nosy: +python-dev

___
Python tracker 

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



[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-28 Thread Nathaniel Smith

Nathaniel Smith added the comment:

> It would be interesting to see some NumPy benchmarks (Nathaniel?).

What is it you want to see? NumPy already uses calloc; we benchmarked it when 
we added it and it made a huge difference to various realistic workloads :-). 
What NumPy gets out of this isn't calloc, it's access to tracemalloc.

--

___
Python tracker 

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



[issue7105] weak dict iterators are fragile because of unpredictable GC runs

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Since this is backported, shouldn't it be closed?

--

___
Python tracker 

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



[issue1615158] POSIX capabilities support

2014-04-28 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
stage: patch review -> needs patch

___
Python tracker 

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



[issue9815] assertRaises as a context manager keeps tracebacks and frames alive

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I've committed an alternate patch using traceback.clear_frames().

--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue9815] assertRaises as a context manager keeps tracebacks and frames alive

2014-04-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6ab3193e890e by Antoine Pitrou in branch '3.4':
Issue #9815: assertRaises now tries to clear references to local variables in 
the exception's traceback.
http://hg.python.org/cpython/rev/6ab3193e890e

New changeset 553fe27521be by Antoine Pitrou in branch 'default':
Issue #9815: assertRaises now tries to clear references to local variables in 
the exception's traceback.
http://hg.python.org/cpython/rev/553fe27521be

--
nosy: +python-dev

___
Python tracker 

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



[issue10203] sqlite3.Row doesn't support sequence protocol

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Issue #13583 ("sqlite3.Row doesn't support slice indexes") is partly related.

--
nosy: +jesstess, pitrou

___
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-28 Thread Antoine Pitrou

Antoine Pitrou 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. 

I think it's ok to stay focussed and restrict this issue to threading.Lock (and 
perhaps RLock).

Berker, do you want to provide an updated patch?

--
nosy: +pitrou

___
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-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

The patch is a bit problematic, because Py_BytesWarningFlag may also be set by 
e.g. an application embedding Python, but then Python's main.c won't be 
executed.

--

___
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-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Committed. Thanks, Arfrever!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
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-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 78c0d80a04f9 by Antoine Pitrou in branch 'default':
Issue #20355: -W command line options now have higher priority than the 
PYTHONWARNINGS environment variable.  Patch by Arfrever.
http://hg.python.org/cpython/rev/78c0d80a04f9

New changeset 925c0b611c02 by Antoine Pitrou in branch 'default':
Remove a workaround for fixed issue #20355.
http://hg.python.org/cpython/rev/925c0b611c02

--
nosy: +python-dev

___
Python tracker 

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



[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-28 Thread Stefan Krah

Stefan Krah added the comment:

The order of the nelem/elsize matters for readability. Otherwise it is
not intuitive what happens after the jump to redirect in _PyObject_Alloc().

Why would you assert that 'nelem' is one?

--

___
Python tracker 

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



[issue19940] ssl.cert_time_to_seconds() returns wrong results if local timezone is not UTC

2014-04-28 Thread akira

akira added the comment:

Antoine, thank you for reviewing. I appreciate the patience.

--

___
Python tracker 

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



[issue21273] don't defined socket constants which are not implemented for GNU/Hurd

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ok, rejecting.

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



[issue21305] PEP 466: update os.urandom

2014-04-28 Thread Donald Stufft

Donald Stufft added the comment:

Just verified that 3.x also does not exhibit this behavior with 
random.SystemRandom (except implicitly through os.urandom doing it).

--

___
Python tracker 

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



[issue17227] devguide: buggy heading numbers

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I agree with Chris, changing the tocdepth doesn't sound like the right 
solution. Is this a Sphinx bug? Georg, could you please take a look?

--

___
Python tracker 

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



[issue21353] document Popen.args attribute

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Gregory, do you think this is ok to document?

--
nosy: +gregory.p.smith, pitrou
stage:  -> patch review
versions:  -Python 3.3

___
Python tracker 

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



[issue5404] Cross-compiling Python

2014-04-28 Thread Stefan Krah

Stefan Krah added the comment:

Here's a cross-compile script for arm-linux-gnueabi. Building 3.4 works
on Ubuntu 14.04.  I cannot run the tests, since I only have an old
Debian-ARM qemu image with the wrong glibc version.

For 3.5 we have a regression due to the new matrix operator.

--
Added file: http://bugs.python.org/file35080/arm-linux-gnueabi.sh

___
Python tracker 

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



[issue21305] PEP 466: update os.urandom

2014-04-28 Thread Donald Stufft

Donald Stufft added the comment:

Well except random.SystemRandom doesn't keep the file open (At least in 2.7) 
and actually it just calls os.urandom under the covers, also it doesn't make it 
very nice to get a glob of random bytes.

--

___
Python tracker 

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



[issue21225] io.py: Improve docstrings for classes

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I've backported Andrew's change.

--
nosy: +pitrou
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue21225] io.py: Improve docstrings for classes

2014-04-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6e23afdee4e4 by Andrew Kuchling in branch '2.7':
#21225: copy docstrings from base classes
http://hg.python.org/cpython/rev/6e23afdee4e4

--

___
Python tracker 

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



[issue19217] Calling assertEquals for moderately long list takes too long

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ezio, do you intend to add a test to your patch?

--
nosy: +pitrou

___
Python tracker 

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



[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2014-04-28 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +brian.curtin, tim.golden

___
Python tracker 

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



[issue21305] PEP 466: update os.urandom

2014-04-28 Thread STINNER Victor

STINNER Victor added the comment:

Please don't backport this "feature". We had to wait 20 years before someone 
requested the feature, but only a few months before the first user reported an 
issue ("regression"?).

IMO it would be much better to use explicitly a random.SystemRandom instance 
which would keep the fd open, and only use it if you hit the bug (*many* 
threads calling os.urandom in parallel.

--
nosy: +haypo

___
Python tracker 

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



[issue21380] timezone support in strftime methods broken

2014-04-28 Thread Michael P. Soulier

New submission from Michael P. Soulier:

msoulier@cappuccino:~$ python
Python 2.7.3 (default, Mar 13 2014, 11:03:55)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from datetime import datetime
>>> now = datetime.now()
>>> now.strftime("%z")
''
>>> import time
>>> time.strftime("%z", time.localtime(time.time()))
'+'
>>>

I think those calls should be printing the UTC offset, no?

--
components: Extension Modules
messages: 217424
nosy: msoulier
priority: normal
severity: normal
status: open
title: timezone support in strftime methods broken
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue21233] Add *Calloc functions to CPython memory allocation API

2014-04-28 Thread STINNER Victor

STINNER Victor added the comment:

> Hmm, obmalloc.c changed as well, so already the gcc optimizer can take
> different paths and produce different results.

If decimal depends on allocator performances, you should maybe try to
implement a freelist.

> Also I did set mpd_callocfunc to PyMem_Calloc().

I don't understand. 2% slowdown is when you use calloc? Do you have the
same speed if you don't use calloc? According to my benchmarks, calloc is
slower if some bytes are modified later.

> The bytes() speedup is very nice. Allocations that took one second
> are practically instant now.

Is it really useful? Who need bytes(10**8) object?

Faster creation of bytearray(int) may be useful in real applications. I
really like bytearray and memoryview to avoid memory copies.

--

___
Python tracker 

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



[issue21378] ImportError: No module named 'concurrent.futures'

2014-04-28 Thread Ned Deily

Ned Deily added the comment:

FWIW, works for me using the python.org 3.4 64-bin installer.  What is the 
output of:

python3 -c 'import sys;print(sys.version)'

As Claudiu suggests, check for a concurrent.py shadowing the standard library 
version.

Also, why are you setting PYTHONPATH to include 
/Library/Frameworks/Python.framework/Versions/{3.4,2.7}/lib/python3.4/site-packages/?
  Those are the standard locations for site-packages are included automatically 
in sys.path by the respective interpreters.  Setting PYTHONPATH should not 
normally be needed.

--
nosy: +ned.deily

___
Python tracker 

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



[issue21379] StopIteration is silenced when raised by generator within context manager

2014-04-28 Thread Hannan Aharonov

Changes by Hannan Aharonov :


--
type:  -> behavior

___
Python tracker 

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



[issue21379] StopIteration is silenced when raised by generator within context manager

2014-04-28 Thread Hannan Aharonov

New submission from Hannan Aharonov:

If the code that defines a context manager performs some operations on a 
generator that cause it to raise StopIteration, this exception is propagated to 
the context manager's __exit__() method and there swallowed by a try..except 
block. 

This can cause unexpected/unintuitive behaviour.
The following simplified example shows an infinite loop caused by this:

---
from contextlib import contextmanager

@contextmanager
def manager(gen):
yield
gen.next()

emptygen = (_ for _ in ())

while True:
with manager(emptygen):
print "Infinite Loop"
---

In this case, even though the generator is empty, the loop will never stop, 
because the generator's StopIteration exception is swallowed by the context 
manager. (If `gen.next()` was wrapped by try..except that reraises exception 
as, say, RuntimeError, the program would stop.)

I've looked at the source (here: 
http://hg.python.org/cpython/file/tip/Lib/contextlib.py line 67)
and I understand why this is happening: the context manager can't tell the 
difference between the two kinds of StopIteration - one that is raised by its 
own completion, and one that is raised by a call in its body. 

I don't know if this is a bug or expected behavior of nested generators. In any 
case, I haven't seen this issue mentioned in the documentation, and the 
behavior is unintuitive.

I've searched the bug tracker and found a similar issue that handled swallowing 
of StopIteration in the code wrapped by the context manager 
(http://bugs.python.org/issue1705170), and another similar issue 
(http://bugs.python.org/issue16610) that was closed without resolution.

--
components: Interpreter Core, Library (Lib)
messages: 217421
nosy: hannan.aha, ncoghlan
priority: normal
severity: normal
status: open
title: StopIteration is silenced when raised by generator within context manager
versions: Python 2.7

___
Python tracker 

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



[issue21378] ImportError: No module named 'concurrent.futures'

2014-04-28 Thread Claudiu.Popa

Claudiu.Popa added the comment:

Do you have a module/file named concurrent.py in your PATH?

--
nosy: +Claudiu.Popa

___
Python tracker 

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



[issue17386] Bring Doc/make.bat as close to Doc/Makefile as possible

2014-04-28 Thread Zachary Ware

Zachary Ware added the comment:

New patch, fixes a typo bug in a useless statement (by removing the statement) 
and a few pesky tabs that made their way into make.bat.  Also, a little better 
organization in the vars at the top.

--
Added file: http://bugs.python.org/file35079/issue17386.v2.diff

___
Python tracker 

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



[issue21378] ImportError: No module named 'concurrent.futures'

2014-04-28 Thread Bill Bergmann

New submission from Bill Bergmann:

python 3.4 attempting to run example at 
https://docs.python.org/3/library/concurrent.futures.html
17.4.2.1

$ python3 17_4_2.py 
Traceback (most recent call last):
  File "", line 2195, in _find_and_load_unlocked
AttributeError: 'module' object has no attribute '__path__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "17_4_2.py", line 1, in 
import concurrent.futures
ImportError: No module named 'concurrent.futures'; 'concurrent' is not a package

os: OS X 10.6

from $env:
PATH=/Library/Frameworks/Python.framework/Versions/3.4/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:
 ...

PYTHONPATH=/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/:/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/:
 ...

--
components: Library (Lib)
messages: 217418
nosy: Bill.Bergmann
priority: normal
severity: normal
status: open
title: ImportError: No module named 'concurrent.futures'
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



[issue17861] put opcode information in one place

2014-04-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 1fd9c3f6cf68 by Ned Deily in branch 'default':
Issue #17861: Allow generate_opcode_h to run with a system Python 2.5.
http://hg.python.org/cpython/rev/1fd9c3f6cf68

--

___
Python tracker 

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



[issue17861] put opcode information in one place

2014-04-28 Thread Ned Deily

Ned Deily added the comment:

Thanks, David. Ideally, the generator script shouldn't run during an installer 
build since presumably the generated file should be up-to-date in the repo.  
"make touch" could handle that but the installer build does use a separate 
build/object directory and doesn't currently use "make touch".  For Python 3.5, 
the installer build now does need at least a Python 2.6 to build the 
documentation but there's no reason to unnecessarily break the main build with 
such a simple fix available.

--
nosy: +ned.deily

___
Python tracker 

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



[issue8776] Bytes version of sys.argv

2014-04-28 Thread STINNER Victor

STINNER Victor added the comment:

Today I regret os.environb (I added it). If I remember correctly, os.environb 
was added before the PEP 383 (surrogateescape). This PEP makes os.environb 
almost useless. In Python 3, Unicode is the natural choice, and thanks to the 
PEP 383, it's still possible to use any "raw bytes".

argvb can be computed in one line: list(map(os.fsencode, sys.argv)).

I now suggest to close this issue as wontfix.

--

___
Python tracker 

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



[issue20962] Rather modest chunk size in gzip.GzipFile

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

Charles-François Natali added the comment:

> Perhaps so, but I think we should open a separate ticket for that
> instead of instituting some feature creep here (no matter how
> reasonable the concept or its changes would be).

Agreed.

The patch looks good to me, so feel free to commit!
(FWIW, gzip apparently uses a fixed-32K buffer read).

--

___
Python tracker 

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



[issue20962] Rather modest chunk size in gzip.GzipFile

2014-04-28 Thread Skip Montanaro

Skip Montanaro added the comment:

On Mon, Apr 28, 2014 at 3:08 PM, Charles-François Natali
 wrote:
> In short, I think the overall buffering should be rewritten :-)

Perhaps so, but I think we should open a separate ticket for that
instead of instituting some feature creep here (no matter how
reasonable the concept or its changes would be).

S

--

___
Python tracker 

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



[issue20962] Rather modest chunk size in gzip.GzipFile

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

Charles-François Natali added the comment:

That could make sense, dunno.

Note that the bz2 module uses a harcoded 8K value.

Note that the buffer size should probably be passed to the open() call.

Also, the allocation is quite peculiar: it uses an exponential buffer
size, starting at a tiny value:

202 # Starts small, scales exponentially
203 self.min_readsize = 100

In short, I think the overall buffering should be rewritten :-)

--

___
Python tracker 

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



[issue21321] itertools.islice() doesn't release reference to the source iterator when the slice is exhausted

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

(note I haven't looked at the C part of the patch)

--

___
Python tracker 

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



[issue17861] put opcode information in one place

2014-04-28 Thread David Bolen

David Bolen added the comment:

This generator script breaks the daily OSX DMG builds on my bolen-dmg 
buildslave for the 3.x branch.

The issue is with the use of "with" as the slave uses Python 2.5 to build the 
installer.  Now, that's old, and I'm not even sure how necessary the daily 
builds are to keep running, but I believe the Mac build-installer script still 
tries to target 2.5 as a minimum - though I'm not sure if that's true for all 
build tools.  But the fix is fairly simple (a __future__ import).

See attached patch.

Alternatively, if the minimum Python to build the installer should be bumped, I 
can work on that for the slave.

--
nosy: +db3l
Added file: http://bugs.python.org/file35078/generate_opcode_h.diff

___
Python tracker 

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



[issue21321] itertools.islice() doesn't release reference to the source iterator when the slice is exhausted

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Anton, the test is wrong: it is taking a reference to the iterable object (the 
list), not the iterator.

To check the reference to the original iterator is released, something like 
this would work:

>>> import itertools, weakref
>>> it = (x for x in (1, 2))
>>> wr = weakref.ref(it)
>>> it = itertools.islice(it, 1)
>>> wr() is None
False
>>> list(it)
[1]
>>> wr() is None  # returns True with the patch, False without
True

--

___
Python tracker 

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



[issue8776] Bytes version of sys.argv

2014-04-28 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Without commenting on this specific proposal, I would like to make an overall 
observation that Python is impairing its usability by adding 
too-many-ways-to-it in a number of categories (file descriptor variants of file 
methods, multiple versions of time.time, byte variants of everything that is 
done with strings).  Python 3 was intended to be a cleaner, more learnable 
version of Python.  Instead, it is growing enums, multiple dispatch, and 
multiple variants of every function.   Professional programmers can be well 
served by some of the these tools, but the Python universe is much larger than 
that and the other users are not being well served by these additions (too many 
choices impairs usability and learnability).

--
nosy: +rhettinger

___
Python tracker 

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



[issue21321] itertools.islice() doesn't release reference to the source iterator when the slice is exhausted

2014-04-28 Thread Anton Afanasyev

Changes by Anton Afanasyev :


Added file: http://bugs.python.org/file35077/issue21321_3.4_8c8315bac6a8_3.diff

___
Python tracker 

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



[issue21321] itertools.islice() doesn't release reference to the source iterator when the slice is exhausted

2014-04-28 Thread Anton Afanasyev

Anton Afanasyev added the comment:

Hi Antoine,
I have no found a way to check resource usage in test infrastructure and I 
don't think it could be done carefully. The only method I found to test issue 
is straightforward: just to check source iterator is not referenced from 
itertools.islice() after the latter has been exhausted:


a = [random.random() for i in range(10)]
before = sys.getrefcount(a)
b = islice(a, 5)
for i in b: pass
after = sys.getrefcount(a)
self.assertEqual(before, after)


Attaching "issue21321_2.7_e3217efa6edd_3.diff" and 
"issue21321_3.4_8c8315bac6a8_3.diff" patches with this test included in 
"Lib/test/test_itertools.py".

--
Added file: http://bugs.python.org/file35076/issue21321_2.7_e3217efa6edd_3.diff

___
Python tracker 

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



[issue21377] PyBytes_Concat could try to concat in-place

2014-04-28 Thread Antoine Pitrou

New submission from Antoine Pitrou:

Currently, PyBytes_Concat always creates a new bytes object for the result. 
However, when Py_REFCNT(*pv) == 1, it could instead call _PyBytes_Resize() and 
then concat the second argument in place.

(like e.g. _PyUnicode_Append does)

--
components: Interpreter Core
messages: 217406
nosy: haypo, nikratio, pitrou
priority: normal
severity: normal
status: open
title: PyBytes_Concat could try to concat in-place
type: performance
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



[issue21057] TextIOWrapper does not support reading bytearrays or memoryviews

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> My usecase is that I have a binary stream class that internally uses 
> memoryviews.

Ok, I think it is a reasonable use case. I'm gonna look at your patch and give 
it a review.

--
stage:  -> patch review

___
Python tracker 

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



[issue21372] multiprocessing.util.register_after_fork inconsistency

2014-04-28 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +sbt

___
Python tracker 

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



[issue18314] Have os.unlink remove junction points

2014-04-28 Thread Tim Golden

Tim Golden added the comment:

I'm just pinging #python-dev to see if there's a way to request a buildbot 
build from a specific server-side clone. 

Meanwhile, though, I definitely introduced a change into your code which I 
thought I had reverted, but clearly hadn't! The code, as committed, used 
PyMem_RawAlloc in place of the calloc() call you had, but didn't replace the 
later free() by its PyMem counterpart.

If I don't get any joy with the clone-specific buildbot question, I'll just 
rebuild from your original patch, re-commit, and watch the buildbots.

--

___
Python tracker 

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



[issue5404] Cross-compiling Python

2014-04-28 Thread Gregory P. Smith

Gregory P. Smith added the comment:

I haven't tried a cross compile in ages.  If nothing else I don't think this 
issue should be closed until we have at least one buildbot setup to cross 
compile it and run it on the target platform.

That's on my long "todo for python" wish list but I haven't had time to figure 
out how to set that up yet.

--

___
Python tracker 

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



[issue21376] asyncio docs refer to wrong TimeoutError

2014-04-28 Thread Guido van Rossum

Guido van Rossum added the comment:

I considered this, and decided against unifying the two TimeoutErrors.

First the builtin TimeoutError is specifically a subclass of OSError 
representing the case where errno is ETIMEDOUT.  But asyncio.TimeoutError means 
nothing of the sort.

Second, the precedent is concurrent.futures.TimeoutError. The asyncio one is 
used under the same conditions as that one.

I think we should just update the links in the docs to be correct.

--

___
Python tracker 

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



[issue20962] Rather modest chunk size in gzip.GzipFile

2014-04-28 Thread Skip Montanaro

Skip Montanaro added the comment:

On Mon, Apr 28, 2014 at 1:59 PM, Antoine Pitrou  wrote:
> Well, I think that compressed files in general would benefit from a
> larger buffer size than plain binary I/O, but that's just a hunch.

I agree. When writing my patch, my (perhaps specious) thinking went like this.

* We have a big-ass file, so we compress it.
* On average, when seeking to another point in that file, we probably
want to go a long way.
* It's possible that operating system read-ahead semantics will make
read performance relatively high.
* That would put more burden on the Python code to be efficient.
* Larger buffer sizes will reduce the amount of Python bytecode which
must be executed.

So, if I have a filesystem block size of 8192 bytes, while that would
represent some sort of "optimal" chunk size, in practice, I think
operating system read-ahead and post-read processing of the bytes read
will tend to suggest larger chunk sizes. Hence my naive choice of 16k
bytes for _CHUNK_SIZE in my patch.

Skip

--

___
Python tracker 

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



[issue16104] Compileall script: add option to use multiple cores

2014-04-28 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy:  -pitrou

___
Python tracker 

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



[issue21376] asyncio docs refer to wrong TimeoutError

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Gasp. Perhaps concurrent.futures.TimeoutError can inherit from the standard 
TimeoutError? The following patch doesn't seem to disrupt the test suite:

diff --git a/Lib/concurrent/futures/_base.py b/Lib/concurrent/futures/_base.py
--- a/Lib/concurrent/futures/_base.py
+++ b/Lib/concurrent/futures/_base.py
@@ -49,7 +49,7 @@ class CancelledError(Error):
 """The Future was cancelled."""
 pass
 
-class TimeoutError(Error):
+class TimeoutError(Error, TimeoutError):
 """The operation exceeded the given deadline."""
 pass

--
assignee: docs@python -> 
components: +Library (Lib)
nosy: +giampaolo.rodola, gvanrossum, haypo, pitrou, yselivanov

___
Python tracker 

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



[issue16104] Compileall script: add option to use multiple cores

2014-04-28 Thread Jim Jewett

Jim Jewett added the comment:

Trying to put bounds on the disagreements.  Does anyone disagree with any of 
the following:

(1)  compileall currently runs single-threaded in a single process.


(2)  This enhancement intends to allow parallelization by process.


(3)  Users MAY need to express whether they (require/forbid/are expressly 
apathetic concerning) paralellization.

(3A)  There is some doubt that this even needs to be user-controlled.

(3B)  If it is user-controlled, the patch proposes adding a "processes" 
parameter to do this.

(3C)  There have been suggestions of other names (notably "workers"), but *if* 
it is user-controlled, the idea of a new parameter is not controversial.


(4)  Users MAY need to control the degree of parallelization.

(4A)  If so, setting the value of the new parameter to a positive integer > 1 
is an acceptable solution.

(4B)  There is not yet consensus on how to represent "Use multi-processing, 
with the default degree for this system.", "Do NOT use multiprocessing.", or "I 
don't care."

(4C)  Suggested values have included 1, 0, -1, any negative number, None, and 
specific strings.  The precise mapping between some of these and the three 
cases of 4B is not agreed.


(5)  If multiprocessing is explicitly requested, what should happen when it is 
not available?

(5A)  Fall back to the current way, without multi-processing.

(5B)  Fall back to the current way, without multi-processing, but issue a 
Warning.

(5C)  Raise an Exception.  (ValueError, ImportError, NotImplemented?)


(6)  Portions of the documentation unrelated to this should be fixed.  But 
ideally, that would be done separately, and it will NOT be a pre-requisite to 
this patch.


---

Another potential value set

None (the default) ==> let the system parallelize as best it can -- as it does 
in multiprocessing.  If the system picks "not in parallel at all", that is also 
OK, and no warning is raised.

0 ==> Do not parallelize.

positive integers ==> Use that many processes.

negative ==> ValueError

Would these uses of 0 and negative be too surprising for someone?

--

___
Python tracker 

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



[issue21312] Update thread_foobar.h to include timed locking and TLS support

2014-04-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7bb1bda5dcef by Antoine Pitrou in branch 'default':
Issue #21312: Update the thread_foobar.h template file to include newer 
threading APIs.  Patch by Jack McCracken.
http://hg.python.org/cpython/rev/7bb1bda5dcef

--
nosy: +python-dev

___
Python tracker 

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



[issue21312] Update thread_foobar.h to include timed locking and TLS support

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Ok, noone chimed in, so I committed the patch :-)
Thank you very much for your contribution!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue19940] ssl.cert_time_to_seconds() returns wrong results if local timezone is not UTC

2014-04-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7191c37238d5 by Antoine Pitrou in branch 'default':
Issue #19940: ssl.cert_time_to_seconds() now interprets the given time string 
in the UTC timezone (as specified in RFC 5280), not the local timezone.
http://hg.python.org/cpython/rev/7191c37238d5

--
nosy: +python-dev

___
Python tracker 

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



[issue20962] Rather modest chunk size in gzip.GzipFile

2014-04-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Sure, it might not be optimal for compressed files, but I gues that
> the optimal value is function of the compression-level block size and
> many other factors which are just too varied to come up with a
> reasonable heuristic.

Well, I think that compressed files in general would benefit from a
larger buffer size than plain binary I/O, but that's just a hunch.

--

___
Python tracker 

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



  1   2   >