[issue17162] Py_LIMITED_API needs a PyType_GenericDealloc

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

Martin v. Löwis added the comment:

I propose a more general solution: add a function PyType_GetSlot.

--
keywords: +patch
Added file: http://bugs.python.org/file33762/getslot.diff

___
Python tracker 

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



[issue19081] zipimport behaves badly when the zip file changes while the process is running

2014-01-28 Thread Gregory P. Smith

Gregory P. Smith added the comment:

Fixed in the 2.7 branch.  The existing patch in the 3.3 and 3.4 branches is 
incomplete and does not actually fix the problem.  Despite what the Misc/NEWS 
entry claims.  The patch I am attaching now (applies to 3.3, I will forward 
port it to 3.4) fixes the remaining issue with zipimport failing subimports 
when the zip file has changed while the process is running.

Marking as a release blocker as one of the following needs to happen for both 
3.3 and 3.4 prior to their final release:

A) The -gps05 patch needs to be applied (and forward ported to 3.4); I can do 
that.

B) The Misc/NEWS entry claiming that this issue is fixed should simply be 
removed from the Misc/NEWS file and the releases should happen without this 
patch.  After 3.4.0 and 3.3.4 I will commit this patch and re-add the Misc/NEWS 
entry under the 3.4.1 and 3.3.5 sections.

Release managers for 3.3 and 3.4, please chime in. (+nosy'd)

--
nosy: +georg.brandl, larry
priority: normal -> release blocker
versions:  -Python 2.7
Added file: 
http://bugs.python.org/file33763/issue19081-subimport-fixes-py33-gps05.diff

___
Python tracker 

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



[issue20326] Argument Clinic should use a non-error-prone syntax to mark text signatures

2014-01-28 Thread Larry Hastings

Larry Hastings added the comment:

Attached is a second patch.

* Now includes input and output checksums.  Checksums are now
  truncated to 16 characters each, otherwise the line is >80 columns.

* Fixes the doubled-up signature lines for type object slot default
  signatures.  I ran "gcc -E" and wrote a quick script to print out
  all lines with doubled-up signatures.  There were only two: divmod
  and rdivmod.

* Pretty sure this was in the first patch, but just thought I'd mention
  it: for functions using optional groups, we can't generate a legal
  signature.  So Clinic kicks out the name of the function instead
  of "sig=", meaning that it puts back the docstring first line
  for human consumption!  I am so clever, tee hee.

--
keywords: +patch
Added file: 
http://bugs.python.org/file33764/larry.sig=.marker.for.signatures.diff.2.diff

___
Python tracker 

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



[issue19081] zipimport behaves badly when the zip file changes while the process is running

2014-01-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ca5431a434d6 by Gregory P. Smith in branch '2.7':
Remove unneeded use of globals() and locals() in test on imports
http://hg.python.org/cpython/rev/ca5431a434d6

--

___
Python tracker 

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



[issue20414] Python 3.4 has two Overlapped types

2014-01-28 Thread STINNER Victor

STINNER Victor added the comment:

> One sub issue then is naming: _overlapped renamed 
> Overlapped.GetOverlappedResult to Overlapped.getresult. I think the _winapi 
> name is better, since all other methods also use Windows API function names.

I also prefer Overlapped.GetOverlappedResult name.

There are other differences. Using _overlapped, the overlapped object is 
created before calling an operation like WriteFile() or AcceptEx() (ex: 
ov.WriteFile(...)). Using _winapi, the operation may create an overlapped 
object if asked (ex: WriteFile(..., overlapped=True)).

The structure is different.

_winapi.c:
---
typedef struct {
PyObject_HEAD
OVERLAPPED overlapped;
/* For convenience, we store the file handle too */
HANDLE handle;
/* Whether there's I/O in flight */
int pending;
/* Whether I/O completed successfully */
int completed;
/* Buffer used for reading (optional) */
PyObject *read_buffer;
/* Buffer used for writing (optional) */
Py_buffer write_buffer;
} OverlappedObject;
---

overlapped.c:
---
enum {TYPE_NONE, TYPE_NOT_STARTED, TYPE_READ, TYPE_WRITE, TYPE_ACCEPT,
  TYPE_CONNECT, TYPE_DISCONNECT, TYPE_CONNECT_NAMED_PIPE,
  TYPE_WAIT_NAMED_PIPE_AND_CONNECT};

typedef struct {
PyObject_HEAD
OVERLAPPED overlapped;
/* For convenience, we store the file handle too */
HANDLE handle;
/* Error returned by last method call */
DWORD error;
/* Type of operation */
DWORD type;
union {
/* Buffer used for reading (optional) */
PyObject *read_buffer;
/* Buffer used for writing (optional) */
Py_buffer write_buffer;
};
} OverlappedObject;
---

And the object in overlapped.c has much more methods.

_winapi.c:
---
static PyMethodDef overlapped_methods[] = {
{"GetOverlappedResult", (PyCFunction) overlapped_GetOverlappedResult,
METH_O, NULL},
{"getbuffer", (PyCFunction) overlapped_getbuffer, METH_NOARGS, NULL},
{"cancel", (PyCFunction) overlapped_cancel, METH_NOARGS, NULL},
{NULL}
};
---

overlapped.c:
---
static PyMethodDef Overlapped_methods[] = {
{"getresult", (PyCFunction) Overlapped_getresult,
 METH_VARARGS, Overlapped_getresult_doc},
{"cancel", (PyCFunction) Overlapped_cancel,
 METH_NOARGS, Overlapped_cancel_doc},
{"ReadFile", (PyCFunction) Overlapped_ReadFile,
 METH_VARARGS, Overlapped_ReadFile_doc},
{"WSARecv", (PyCFunction) Overlapped_WSARecv,
 METH_VARARGS, Overlapped_WSARecv_doc},
{"WriteFile", (PyCFunction) Overlapped_WriteFile,
 METH_VARARGS, Overlapped_WriteFile_doc},
{"WSASend", (PyCFunction) Overlapped_WSASend,
 METH_VARARGS, Overlapped_WSASend_doc},
{"AcceptEx", (PyCFunction) Overlapped_AcceptEx,
 METH_VARARGS, Overlapped_AcceptEx_doc},
{"ConnectEx", (PyCFunction) Overlapped_ConnectEx,
 METH_VARARGS, Overlapped_ConnectEx_doc},
{"DisconnectEx", (PyCFunction) Overlapped_DisconnectEx,
 METH_VARARGS, Overlapped_DisconnectEx_doc},
{"ConnectNamedPipe", (PyCFunction) Overlapped_ConnectNamedPipe,
 METH_VARARGS, Overlapped_ConnectNamedPipe_doc},
{"WaitNamedPipeAndConnect",
 (PyCFunction) Overlapped_WaitNamedPipeAndConnect,
 METH_VARARGS, Overlapped_WaitNamedPipeAndConnect_doc},
{NULL}
};
---

_winapi.c doesn't provide AcceptEx() nor Accept().

--

___
Python tracker 

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



[issue20264] Update patchcheck to looks for files with clinic comments

2014-01-28 Thread Larry Hastings

Larry Hastings added the comment:

I've attached a script here that uses the new tweaked format of Clinic
blocks.  The new tweaked format isn't checked in yet--that change is being 
tracked with #20326.

Once that's checked in, though, the attached script will check that both the 
input and output blocks are unchanged and up-to-date, respectively.

--
dependencies: +Argument Clinic should use a non-error-prone syntax to mark text 
signatures
Added file: http://bugs.python.org/file33765/detect.py

___
Python tracker 

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



[issue17162] Py_LIMITED_API needs a PyType_GenericDealloc

2014-01-28 Thread STINNER Victor

STINNER Victor added the comment:

+return  *(void**)(((char*)type) + slotoffsets[slot]);

New Python versions may add new slots. What do you think of returning NULL if 
the slot number is higher than the maximum slot?

It looks like "#define Py_tp_free 74" is the highest slot number since Python 
3.2.

For example, Python 3.4 has a new "tp_finalize" slot, but I don't see it in 
typeslots.h.

--
nosy: +haypo

___
Python tracker 

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



[issue20414] Python 3.4 has two Overlapped types

2014-01-28 Thread Richard Oudkerk

Richard Oudkerk added the comment:

_overlapped is linked against the socket library whereas _winapi is not so
it can be bundled in with python3.dll.

I did intend to switch multiprocessing over to using _overlapped but I did
not get round to it.

Since this is a private module the names of methods do not matter to much.
Note that getresult and GetOverlappedResult return values in different
forms.

--

___
Python tracker 

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



[issue20414] Python 3.4 has two Overlapped types

2014-01-28 Thread STINNER Victor

STINNER Victor added the comment:

> I did intend to switch multiprocessing over to using _overlapped
> but I did not get round to it.

Do you mean that _overlapped module is newer and should be used instead of 
_winapi? If multiprocssing is patched to use _overlapped, we can drop 
overlapped code from _winapi, should we keep functions like WriteFile() without 
overlapped support? (I think that we should keep these functions, it was 
discussed to support the native Windows API for files.)

IMO such change can be done in Python 3.5, it is risky and can wait.

But until that, I'm concerned by overlapped deallocator which is different in 
the two modules. Attached fixes _overlapped module to use the same logic than 
_winapi: give up on Windows XP during Python finalization if the overlapped is 
still pending, don't deallocate memory, exit immediatly. See issue #19565 for 
the rationale of this change.

--
keywords: +patch
Added file: http://bugs.python.org/file33766/overlapped_dealloc.patch

___
Python tracker 

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



[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2014-01-28 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Here is the updated patch for list module based on Zachary and Serhiy's reviews.

--
Added file: http://bugs.python.org/file33767/clinic_listobject_v4.patch

___
Python tracker 

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



[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2014-01-28 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Forgot to say that, in list module, anything is convertable except __getitem__.

--

___
Python tracker 

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



[issue20326] Argument Clinic should use a non-error-prone syntax to mark text signatures

2014-01-28 Thread Larry Hastings

Larry Hastings added the comment:

I'm surprised it made a review link.  It didn't apply cleanly for me here.

While merging I noticed that the imperative declension fix had snuck out of the 
diff somehow.  So I redid that.

Attached is an updated patch.


Also I should mention: clinic.py currently accepts both the old and new comment 
format.  I'll leave support for the old one in until just before the last 
release candidate.

--
Added file: 
http://bugs.python.org/file33768/larry.sig=.marker.for.signatures.diff.3.diff

___
Python tracker 

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



[issue20415] Could method "isinstance" take a list as parameter?

2014-01-28 Thread Chen ZHANG

New submission from Chen ZHANG:

Since the usage of isinstance could be "isinstance(1, (int, float))", I'm 
wondering why it doesn't accept "[int, float]", if I do so, it would raise 
TypeError saying "arg 2 must be a type or tuple of types". What's the 
difference in effect between a tuple and a list here? (I know a tuple is 
immutable, but I think it doesn't matter when passing some other types of 
non-string iterables(yielding strings), am I right?

--
components: Library (Lib)
messages: 209519
nosy: Chen.ZHANG
priority: normal
severity: normal
status: open
title: Could method "isinstance" take a list as parameter?
type: enhancement

___
Python tracker 

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



[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2014-01-28 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Here is the updated patch for marshal module based on Zachary's review.

--
Added file: http://bugs.python.org/file33769/clinic_marshal_v4.patch

___
Python tracker 

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



[issue20308] inspect.Signature doesn't support user classes without __init__ or __new__

2014-01-28 Thread Stefan Krah

Stefan Krah added the comment:

One test fails --without-doc-strings:

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.0%203.x/builds/6266/steps/test/logs/stdio

--
nosy: +skrah

___
Python tracker 

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



[issue20415] Could method "isinstance" take a list as parameter?

2014-01-28 Thread Mark Dickinson

Mark Dickinson added the comment:

See related discussion on python-ideas here:

https://mail.python.org/pipermail/python-ideas/2011-July/010610.html

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue20338] Idle: increase max calltip width

2014-01-28 Thread Stefan Krah

Stefan Krah added the comment:

I think test_idle is failing on many build slaves following this
commit.

--
nosy: +skrah

___
Python tracker 

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



[issue20416] Marshal: special case int and float, don't use references

2014-01-28 Thread STINNER Victor

New submission from STINNER Victor:

Attached patched disables references for int and float types.

--
files: marshal3_numbers.patch
keywords: patch
messages: 209524
nosy: haypo
priority: normal
severity: normal
status: open
title: Marshal: special case int and float, don't use references
type: performance
versions: Python 3.4
Added file: http://bugs.python.org/file33770/marshal3_numbers.patch

___
Python tracker 

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



[issue20416] Marshal: special case int and float, don't use references

2014-01-28 Thread STINNER Victor

STINNER Victor added the comment:

Use attached bench.py to compare performances.

Without the patch:
---
dumps v0: 389.6 ms
data size v0: 45582.9 kB
loads v0: 573.3 ms

dumps v1: 391.4 ms
data size v1: 45582.9 kB
loads v1: 558.0 ms

dumps v2: 166.9 ms
data size v2: 41395.4 kB
loads v2: 482.2 ms

dumps v3: 431.2 ms
data size v3: 41395.4 kB
loads v3: 543.8 ms

dumps v4: 361.8 ms
data size v4: 37000.9 kB
loads v4: 560.4 ms
---

With the patch:
---
dumps v0: 391.4 ms
data size v0: 45582.9 kB
loads v0: 578.2 ms

dumps v1: 392.3 ms
data size v1: 45582.9 kB
loads v1: 556.8 ms

dumps v2: 167.7 ms
data size v2: 41395.4 kB
loads v2: 484.6 ms

dumps v3: 170.3 ms
data size v3: 41395.4 kB
loads v3: 467.0 ms

dumps v4: 122.8 ms
data size v4: 37000.9 kB
loads v4: 468.9 ms
---

dumps v3 is 60% faster, loads v3 is also 14% *faster*.

dumps v4 is 66% faster, loads v4 is 16% faster.

--
Added file: http://bugs.python.org/file33771/bench.py

___
Python tracker 

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



[issue20416] Marshal: special case int and float, don't use references

2014-01-28 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +loewis

___
Python tracker 

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



[issue20416] Marshal: special case int and float, don't use references

2014-01-28 Thread STINNER Victor

STINNER Victor added the comment:

Performance of Python 3.3.3+:
---
dumps v0: 374.8 ms
data size v0: 45582.9 kB
loads v0: 625.3 ms

dumps v1: 374.6 ms
data size v1: 45582.9 kB
loads v1: 605.1 ms

dumps v2: 152.9 ms
data size v2: 41395.4 kB
loads v2: 556.5 ms
---

So with the patch, the Python 3.4 default version (4) is *faster* (dump 20% 
faster, load 16% faster) and produces *smaller files* (10% smaller).

--

___
Python tracker 

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



[issue20416] Marshal: special case int and float, don't use references

2014-01-28 Thread STINNER Victor

STINNER Victor added the comment:

Oh by the way, on Python 3.4, the file size (on version 3 and 4) is unchanged 
with my patch. Writing a reference produces takes exactly the same size than an 
integer.

--

___
Python tracker 

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



[issue20166] window x64 c-extensions not works on python3.4.0b2

2014-01-28 Thread Stefan Krah

Stefan Krah added the comment:

Ping. The blocker seems to have passed beta3. :)

--

___
Python tracker 

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



[issue19081] zipimport behaves badly when the zip file changes while the process is running

2014-01-28 Thread Georg Brandl

Georg Brandl added the comment:

Since this is a pretty big code churn, I'd prefer B) for 3.3.4.  (3.3.5 will be 
soon anyway.)

--

___
Python tracker 

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



[issue20416] Marshal: special case int and float, don't use references

2014-01-28 Thread Vajrasky Kok

Vajrasky Kok added the comment:

I am doing clinic conversion for marshal module so I am adding myself to nosy 
list to make sure both tickets are synchronized.

http://bugs.python.org/issue20185

--
nosy: +vajrasky

___
Python tracker 

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



[issue20416] Marshal: special case int and float, don't use references

2014-01-28 Thread STINNER Victor

STINNER Victor added the comment:

> I am doing clinic conversion for marshal module so I am adding myself to nosy 
> list to make sure both tickets are synchronized.

The Derby is suspended until the release of Python 3.4 final.

I consider this issue as an important performance regression that should be 
fixed before Python 3.4 final.

--
nosy: +larry
priority: normal -> release blocker

___
Python tracker 

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



[issue20416] Marshal: special case int and float, don't use references

2014-01-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +kristjan.jonsson, pitrou, serhiy.storchaka

___
Python tracker 

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



[issue20416] Marshal: special case int and float, don't use references

2014-01-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Did you tested for numerous shared int and floats? [1000] * 100 and 
[1000.0] * 100? AFAIK this was important use cases for adding 3 or 4 
versions.

--

___
Python tracker 

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



[issue20416] Marshal: special case int and float, don't use references

2014-01-28 Thread STINNER Victor

STINNER Victor added the comment:

> Did you tested for numerous shared int and floats? [1000] * 100 and 
> [1000.0] * 100? AFAIK this was important use cases for adding 3 or 4 
> versions.

Here are new benchmarks on Python 3.4 with:

Integers: [1000] * 100
Floats: [1000.0] * 100

Integers, without the patch:

dumps v3: 62.8 ms
data size v3: 4882.8 kB
loads v3: 10.7 ms

Integers, with the patch:

dumps v3: 18.6 ms (-70%)
data size v3: 4882.8 kB (same size)
loads v3: 27.7 ms (+158%)

Floats, without the patch:

dumps v3: 62.5 ms
data size v3: 4882.8 kB
loads v3: 11.0 ms

Floats, with the patch:

dumps v3: 29.3 ms (-53%)
data size v3: 8789.1 kB (+80%)
loads v3: 25.5 ms (+132%)

The version 3 was added by:
---
changeset:   82816:01372117a5b4
user:Kristján Valur Jónsson 
date:Tue Mar 19 18:02:10 2013 -0700
files:   Doc/library/marshal.rst Include/marshal.h Lib/test/test_marshal.py 
Misc/NEWS Python/marshal.c
description:
Issue #16475: Support object instancing, recursion and interned strings in 
marshal
---

This issue tells about "sharing string constants, common tuples, even common 
code objects", not sharing numbers.

For real data, here are interesting numbers:
http://bugs.python.org/issue16475#msg176013

Integers only represent 4.8% of serialized data, and only 8.2% of these 
integers can be shared. (Floats represent 0.29%.) Whereas strings repsent 58% 
and 57% can be shared.

--

___
Python tracker 

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



[issue20416] Marshal: special case int and float, don't use references

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

Martin v. Löwis added the comment:

For the record, format 3 was added through issue16475, format 4 was added 
through issue19219.

In msg175962, Kristjan argued that there is no reason _not_ to share int 
objects, e.g. across multiple code objects. Now it seems that this argument is 
flawed: there is a reason, namely the performance impact.

OTOH, I consider both use case (marshaling a large number of integers, and 
desiring to share ints across code objects) equally obscure: you shouldn't 
worry about marshal performance too much if you have loads of tiny int objects, 
and you shouldn't worry whether these ints get shared or not.

As a compromise, we could suppress the sharing for small int objects, since 
they are singletons, anyway. This would allow marshal to preserve/copy the 
object graph, while not impacting the use case that the original poster on 
python-dev presented.

--

___
Python tracker 

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



[issue20416] Marshal: special case int and float, don't use references

2014-01-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> Integers, without the patch:
> 
> dumps v3: 62.8 ms
> data size v3: 4882.8 kB
> loads v3: 10.7 ms
> 
> Integers, with the patch:
> 
> dumps v3: 18.6 ms (-70%)
> data size v3: 4882.8 kB (same size)
> loads v3: 27.7 ms (+158%)

As I wrote on python-dev, dumps performance isn't important for the pyc
use case, but loads performance is. Therefore it appears this patch goes
into the wrong direction.

You are also ignoring the *runtime* benefit of sharing objects: smaller
memory footprint of the actual Python process.

--

___
Python tracker 

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



[issue20417] ensurepip should not be installed with --without-ensurepip

2014-01-28 Thread Arfrever Frehtes Taifersar Arahesis

New submission from Arfrever Frehtes Taifersar Arahesis:

ensurepip should not be installed when --without-ensurepip was passed to 
configure.
I attach the patch.

--
assignee: dstufft
components: Installation
files: ensurepip_installation.patch
keywords: patch
messages: 209536
nosy: Arfrever, dstufft
priority: normal
severity: normal
stage: patch review
status: open
title: ensurepip should not be installed with --without-ensurepip
versions: Python 3.4
Added file: http://bugs.python.org/file33772/ensurepip_installation.patch

___
Python tracker 

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



[issue20417] ensurepip should not be installed with --without-ensurepip

2014-01-28 Thread Donald Stufft

Donald Stufft added the comment:

I don't see any reason not to install ensurepip in this situation. That flag 
controls whether or not ``python -m ensurepip`` will be executed during the 
install, but ensurepip itself will still be installed. It is not an optional 
module

--

___
Python tracker 

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



[issue20166] window x64 c-extensions not works on python3.4.0b2

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

Martin v. Löwis added the comment:

I think the change should be reverted, and the original issue closed as "won't 
fix".

Alternatively, to fix the original issue, the specific linker warning could be 
suppressed.

--

___
Python tracker 

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



[issue20418] socket.getaddrinfo fails for hostname that is all digits 0-9

2014-01-28 Thread ariel-wikimedia

New submission from ariel-wikimedia:

With python 2.7.5 (running on fedora 20 with all updates), socket.getaddrinfo 
for a hostname such as 836937931829 will fail.  Docker produces these sorts of 
hostnames (really random hex strings, but some hex strings only contain digits 
0-9).

How to reproduce:

Add the lines

172.17.10.53blobber
172.17.10.54836937931829

to /etc/hosts

run the following:

import socket
print socket.getaddrinfo('172.17.10.53',80,socket.AF_INET,0,socket.SOL_TCP)
print socket.getaddrinfo('blobber',80,socket.AF_INET,0,socket.SOL_TCP)
print socket.getaddrinfo('172.17.10.54',80,socket.AF_INET,0,socket.SOL_TCP)
print socket.getaddrinfo('836937931829',80,socket.AF_INET,0,socket.SOL_TCP)

Expected output:
[(2, 1, 6, '', ('172.17.10.53', 80))]
[(2, 1, 6, '', ('172.17.10.53', 80))]
[(2, 1, 6, '', ('172.17.10.54', 80))]
[(2, 1, 6, '', ('172.17.10.54', 80))]

Actual output:
[(2, 1, 6, '', ('172.17.10.53', 80))]
[(2, 1, 6, '', ('172.17.10.53', 80))]
[(2, 1, 6, '', ('172.17.10.54', 80))]
Traceback (most recent call last):
  File "./test-getaddrinfo.py", line 6, in 
print socket.getaddrinfo('836937931829',80,socket.AF_INET,0,socket.SOL_TCP)
socket.gaierror: [Errno -2] Name or service not known

--
components: Library (Lib)
messages: 209539
nosy: ariel-wikimedia
priority: normal
severity: normal
status: open
title: socket.getaddrinfo fails for hostname that is all digits 0-9
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



[issue20414] Python 3.4 has two Overlapped types

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

Martin v. Löwis added the comment:

It seems fine to me to link pythonXY.dll with wsock32.dll. This is a standard 
library in Windows NT+, so there is no need to avoid linking with it.

I also now agree that any change that we may make is too big for 3.4, so I 
propose to defer any action on this issue to 3.5.

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



[issue20326] Argument Clinic should use a non-error-prone syntax to mark text signatures

2014-01-28 Thread Nick Coghlan

Nick Coghlan added the comment:

Looks good to me :)

I also like the fact it simplifies the internal APIs by making it really 
trivial to detect the presence of a clinic signature from C.

--

___
Python tracker 

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



[issue20326] Argument Clinic should use a non-error-prone syntax to mark text signatures

2014-01-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d6311829da15 by Larry Hastings in branch 'default':
Issue #20326: Argument Clinic now uses a simple, unique signature to
http://hg.python.org/cpython/rev/d6311829da15

--
nosy: +python-dev

___
Python tracker 

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



[issue20326] Argument Clinic should use a non-error-prone syntax to mark text signatures

2014-01-28 Thread Larry Hastings

Changes by Larry Hastings :


--
resolution:  -> fixed
stage: needs patch -> 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



[issue20326] Argument Clinic should use a non-error-prone syntax to mark text signatures

2014-01-28 Thread Larry Hastings

Larry Hastings added the comment:

Yeah.  I did a pretty terrible job of articulating why the "(" 
signature was a bad idea 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



[issue20338] Idle: increase max calltip width

2014-01-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

On 1/28/2014 4:48 AM, Stefan Krah wrote:
>
> Stefan Krah added the comment:
>
> I think test_idle is failing on many build slaves following this
> commit.

The two failures I saw on the first 4 3.x bots with Idle failures are 
the result of changes in the list docstrings. I presume these are 
related to use of Argument Clinic. I knew and documented that such 
failure was a possibility.

On my Win 7 machine

Jan 20, 32-bit repository build just before I added the tests that now fail.
 >>> list.__doc__
"list() -> new empty list\nlist(iterable) -> new list initialized from 
iterable's items"
 >>> list.__init__.__doc__
'x.__init__(...) initializes x; see help(type(x)) for signature'

Jan 26, 64-bit installed 3.4.0b3:
 >>> list.__doc__
"list(iterable) -> new list initialized from iterable's items"
 >>> list.__init__.__doc__
'Initializes self.  See help(type(self)) for accurate signature.'

At some point, I will switch to using inspect.signature for Idle 
calltips and simplify the Idle code. I will also simplify the tests and 
make them more robust.

I will re-compile and adjust the tests by the end of the day.

Terry

--

___
Python tracker 

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



[issue18795] pstats - allow stats sorting by cumulative time per call and total time per call

2014-01-28 Thread Alexandre Dias

Alexandre Dias added the comment:

Could I get an update on this please?

--

___
Python tracker 

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



[issue9709] test_distutils warning: initfunc exported twice on Windows

2014-01-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 69827c2ab9d0 by Stefan Krah in branch 'default':
Issue #9709: Revert 97fb852c5c26. Many extensions are not using PyMODINIT_FUNC.
http://hg.python.org/cpython/rev/69827c2ab9d0

--

___
Python tracker 

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



[issue20411] IndexError in sys.__interactivehook__ with pyreadline installed

2014-01-28 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

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



[issue20166] window x64 c-extensions not works on python3.4.0b2

2014-01-28 Thread Stefan Krah

Stefan Krah added the comment:

Thanks, that seems to be the best course of action.  Fixed in
69827c2ab9d0.

--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
superseder:  -> test_distutils warning: initfunc exported twice on Windows
type:  -> compile error

___
Python tracker 

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



[issue9709] test_distutils warning: initfunc exported twice on Windows

2014-01-28 Thread Stefan Krah

Stefan Krah added the comment:

Too many extensions are not using PyMODINIT_FUNC (See #20166).
Closing as WONT_FIX.

--
resolution: fixed -> wont fix

___
Python tracker 

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



[issue20411] IndexError in sys.__interactivehook__ with pyreadline installed

2014-01-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ca6efeedfc0e by Jason R. Coombs in branch 'default':
Issue #20411: Use readline.get_current_history_length to check for the presence 
of a history, rather than get_history_item, which assumes a history is present.
http://hg.python.org/cpython/rev/ca6efeedfc0e

--
nosy: +python-dev

___
Python tracker 

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



[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2014-01-28 Thread Vajrasky Kok

Vajrasky Kok added the comment:

Here is the updated patch for float object based on Zachary and Serhiy's 
reviews. Some methods that can not be converted are:

__getnewargs__, __round__, float_new.


So these files are ready for Python 3.4: resource, typeobject, listobject, and 
floatobject.

These files are not ready yet: gc, longobject.

--
Added file: http://bugs.python.org/file33773/clinic_floatobject_v2.patch

___
Python tracker 

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



[issue20411] IndexError in sys.__interactivehook__ with pyreadline installed

2014-01-28 Thread Jason R. Coombs

Jason R. Coombs added the comment:

After further consideration and investigation, I believe the fix is to simply 
use the API as exposed by pyreadline to check the length of the history to 
detect the presence of an existing history. I've tested that fix locally and it 
seems to be working suitably. Please review and suggest corrections as 
appropriate.

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



[issue20172] Derby #3: Convert 67 sites to Argument Clinic across 4 files (Windows)

2014-01-28 Thread Zachary Ware

Changes by Zachary Ware :


Added file: http://bugs.python.org/file33774/bda6dc12a123.diff

___
Python tracker 

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



[issue20172] Derby #3: Convert 67 sites to Argument Clinic across 4 files (Windows)

2014-01-28 Thread Zachary Ware

Changes by Zachary Ware :


Added file: http://bugs.python.org/file33775/41ad3c4fc03c.diff

___
Python tracker 

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



[issue20172] Derby #3: Convert 67 sites to Argument Clinic across 4 files (Windows)

2014-01-28 Thread Zachary Ware

Changes by Zachary Ware :


Removed file: http://bugs.python.org/file33774/conglomerate.v6-post-20326.diff

___
Python tracker 

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



[issue20414] Python 3.4 has two Overlapped types

2014-01-28 Thread Zachary Ware

Changes by Zachary Ware :


--
nosy: +zach.ware

___
Python tracker 

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



[issue18846] python.exe stdout stderr issues again

2014-01-28 Thread SSmith

SSmith added the comment:

Please pay some attention to this. This ISSUE is still valid in 3.4b4! Issue 
#18338 resolves only part of the problem. Look at this part of the OP:
invoking  python.exe   prints its default output to stderr:
[ in]>python 1> null
[out]>Python 3.4.0a1 (v3.4.0a1:46535f65e7f3, Aug  3 2013, 22:59:31) [MSC v.1600 
32 bit (Intel)] on win32
[out]>Type "help", "copyright", "credits" or "license" for more information.
[out]>>>

[ in]>python 2> null
[out]>>>

--

___
Python tracker 

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



[issue18846] python.exe stdout stderr issues again

2014-01-28 Thread SSmith

SSmith added the comment:

r/3.4b4/3.4b3

--

___
Python tracker 

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



[issue3158] Doctest fails to find doctests in extension modules

2014-01-28 Thread Zachary Ware

Zachary Ware added the comment:

Does this patch fix things for you?

--
resolution: fixed -> 
status: closed -> open
Added file: http://bugs.python.org/file33776/issue3158.__objclass__-fix.diff

___
Python tracker 

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



[issue20414] Python 3.4 has two Overlapped types

2014-01-28 Thread Guido van Rossum

Guido van Rossum added the comment:

I'm fine with this refactoring. The upstream tulip/asyncio repo will keep its 
own _overlapped for the purpose of supporting Python 3.3. (I'm not sure what 
Victor wants to do with Trollius but probably the same.)

--

___
Python tracker 

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



[issue20221] #define hypot _hypot conflicts with existing definition

2014-01-28 Thread Zachary Ware

Zachary Ware added the comment:

I'm having difficulty wrapping my head around why the math and cmath modules 
(both of which use hypot) compile fine, but your extensions don't.  Anyone have 
any insight into why that is?

--

___
Python tracker 

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



[issue18846] python.exe stdout stderr issues again

2014-01-28 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Hmm, I'm not sure what the precedence is for that. Where do other interactive 
languages print their header to?

--

___
Python tracker 

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



[issue20075] help(open) eats first line

2014-01-28 Thread Larry Hastings

Larry Hastings added the comment:

Yup, sorry about that.  We're moving pretty fast with the Derby right now, and 
sometimes we don't figure out something important until later, and sometimes 
that means wasted effort.  Sorry!

--

___
Python tracker 

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



[issue20075] help(open) eats first line

2014-01-28 Thread Zachary Ware

Zachary Ware added the comment:

With #20326 fixed, this is no longer an issue.

Gennadiy, thank you for the patch, and I'm sorry it ended up being unused.

--
resolution:  -> out of date
stage: commit review -> 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



[issue20172] Derby #3: Convert 67 sites to Argument Clinic across 4 files (Windows)

2014-01-28 Thread Zachary Ware

Zachary Ware added the comment:

I have high hopes for this latest update :)

--

___
Python tracker 

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



[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2014-01-28 Thread Zachary Ware

Changes by Zachary Ware :


--
nosy: +zach.ware

___
Python tracker 

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



[issue20420] BufferedIncrementalEncoder violates IncrementalEncoder interface

2014-01-28 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

The documentation of IncrementalEncoder.getstate() says:

"""
Return the current state of the encoder which must be an integer. The 
implementation should make sure that 0 is the most common state. (States that 
are more complicated than integers can be converted into an integer by 
marshaling/pickling the state and encoding the bytes of the resulting string 
into an integer).
"""

But implementation of BufferedIncrementalEncoder.getstate() is

def getstate(self):
return self.buffer or 0

self.buffer is "unencoded input that is kept between calls to encode()", e.g. a 
string.

--
messages: 209563
nosy: doerwalter, lemburg, loewis, serhiy.storchaka
priority: normal
severity: normal
status: open
title: BufferedIncrementalEncoder violates IncrementalEncoder interface
type: behavior
versions: Python 2.7, 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



[issue20414] Python 3.4 has two Overlapped types

2014-01-28 Thread STINNER Victor

STINNER Victor added the comment:

Can please someone review overlapped_dealloc.patch? I would like to apply it on 
Python 3.4.

--

___
Python tracker 

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



[issue20421] expose SSL socket protocol version

2014-01-28 Thread Antoine Pitrou

New submission from Antoine Pitrou:

SSL sockets should provide a way to query the current protocol version (e.g. 
"TLSv1.2"). OpenSSL makes it easy through SSL_get_version().

Open question is whether we return the string returned by SSL_get_version(), or 
we convert it to one of the constants ssl.PROTOCOL_XXX.

--
components: Library (Lib)
messages: 209564
nosy: christian.heimes, giampaolo.rodola, janssen, pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: expose SSL socket protocol version
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



[issue20419] it's not possible to set ECDH curve name via ssl.wrap_socket

2014-01-28 Thread Michael Gubser

New submission from Michael Gubser:

One can only set the ECDH curve name via SSLContext.set_ecdh_curve(). 
ssl.wrap_socket() doesn't have a parameter to use it for the wrapping of the 
basic socket. Therefore one always has to do the detour over SSLContext.

--
components: Library (Lib)
messages: 209561
nosy: Michael.Gubser
priority: normal
severity: normal
status: open
title: it's not possible to set ECDH curve name via ssl.wrap_socket
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



[issue20422] Signature.from_builtin should raise a ValueError when no signature can be provided

2014-01-28 Thread Yury Selivanov

New submission from Yury Selivanov:

Right now it may return `None` if no signature can be returned for the given 
builtin. If we decide to implement #17373 in 3.5, I'd like all three methods -- 
from_builtin, from_function, from_callable -- to either return a signature or 
to raise an exception.

--
messages: 209565
nosy: brett.cannon, larry, ncoghlan, yselivanov
priority: normal
severity: normal
status: open
title: Signature.from_builtin should raise a ValueError when no signature can 
be provided
type: behavior
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



[issue20401] inspect.signature removes initial starred method params (bug)

2014-01-28 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3544827d42e6 by Yury Selivanov in branch 'default':
inspect.signature: Handle bound methods with '(*args)' signature correctly 
#20401
http://hg.python.org/cpython/rev/3544827d42e6

--
nosy: +python-dev

___
Python tracker 

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



[issue20401] inspect.signature removes initial starred method params (bug)

2014-01-28 Thread Yury Selivanov

Yury Selivanov added the comment:

Committed. Thank you, Terry.

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



[issue20418] socket.getaddrinfo fails for hostname that is all digits 0-9

2014-01-28 Thread R. David Murray

R. David Murray added the comment:

getaddrinfo is a thin wrapper around the system call.  Have you tried the same 
thing in a C program and had it work?

My guess would be that the all-numeric 'hostname' is being treated as the 
integer form of an IP address.  I can't immediately find any documentation that 
addresses this for getaddrinfo, but the impression I get from googling is that 
turning numbers into ip addresses is not specified behavior but is what (most?) 
libc implementations do.

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



[issue17481] inspect.getfullargspec should use __signature__

2014-01-28 Thread Yury Selivanov

Yury Selivanov added the comment:

Larry and Nick,

Please review the final patch (getargsspec_04.patch). I'd like to commit it 
tomorrow.

This one is the last one (hopefully), and it supports builtin methods properly 
-- i.e. works around 'self' parameter correctly. To do that, I check if the 
'__text_signature__' starts with "($", etc.

--
assignee:  -> yselivanov
stage:  -> patch review
Added file: http://bugs.python.org/file33777/getargsspec_04.patch

___
Python tracker 

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



[issue20185] Derby #17: Convert 49 sites to Argument Clinic across 13 files

2014-01-28 Thread Zachary Ware

Zachary Ware added the comment:

Attaching a conglomerate patch consisting of clinic_resource_v2.patch, 
clinic_typeobject_v2.patch, clinic_listobject_v3.patch, 
clinic_marshal_v4.patch, and clinic_floatobject_v2.patch, with updated 
(post-#20326) clinic output, for easier review.

--
Added file: http://bugs.python.org/file33778/issue20185_conglomerate.diff

___
Python tracker 

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



[issue17481] inspect.getfullargspec should use __signature__

2014-01-28 Thread Yury Selivanov

Changes by Yury Selivanov :


--
keywords: +needs review

___
Python tracker 

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



[issue20221] #define hypot _hypot conflicts with existing definition

2014-01-28 Thread Tabrez Mohammed

Tabrez Mohammed added the comment:

My extension doesn't compile because I treat warnings as errors. I believe 
Blender compiles fine, but crashes at runtime because of the infinite recursion 
(see the second code snippet in Brecht's response 
(http://bugs.python.org/msg208981).

--

___
Python tracker 

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



[issue20221] #define hypot _hypot conflicts with existing definition

2014-01-28 Thread Zachary Ware

Zachary Ware added the comment:

Sorry, I wasn't entirely clear.  By "compile fine", I meant "compiles without 
warnings, and actually works when you try to use it".  Both math and cmath make 
use of hypot (as defined in pyconfig.h), but don't have any problems.

They also have no problems with your patch applied, but I don't feel I 
understand the situation enough yet to move the patch forward.

--

___
Python tracker 

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



[issue20418] socket.getaddrinfo fails for hostname that is all digits 0-9

2014-01-28 Thread Ariel Glenn

Ariel Glenn added the comment:

Yes, I had checked that just in case; getaddrinfo(3) works for the all-digit 
hostname, returning no error.  I'm using these hints:

   memset(&hints, 0, sizeof(struct addrinfo));
   hints.ai_family = AF_UNSPEC;
   hints.ai_socktype = SOCK_STREAM;
   hints.ai_flags = AI_PASSIVE;
   hints.ai_protocol = 0;
   hints.ai_canonname = NULL;
   hints.ai_addr = NULL;
   hints.ai_next = NULL;

Tested on glibc-2.18.

--
nosy: +ariel

___
Python tracker 

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



[issue18846] python.exe stdout stderr issues again

2014-01-28 Thread SSmith

SSmith added the comment:

Interestingly to me, you 're right!
Powershell interpreter does the same. Ironically, failure to launch  python  
from Powershell ISE(Integrated Scripting Environment) was what triggered this 
bug report. And as I see know, PowershellISE doesnt support launching  a 
'nested' powershell interpreter too.

You also direct python.exe verbose output to stderr too. If I uncderstand the 
'problem' correctly, it seems that having  to choose from just 2 output 
channels leads to compromises like these.

Thanks for your time and apologies for bumping this twice!

--

___
Python tracker 

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



[issue19081] zipimport behaves badly when the zip file changes while the process is running

2014-01-28 Thread Gregory P. Smith

Gregory P. Smith added the comment:

Thanks Georg.  I'll leave it until after the 3.3.4 release.  For simplicity's 
sake I'll leave it for 3.4.1 as well unless Larry says otherwise.

--
priority: release blocker -> deferred blocker

___
Python tracker 

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



[issue20221] #define hypot _hypot conflicts with existing definition

2014-01-28 Thread Brecht Van Lommel

Brecht Van Lommel added the comment:

For Visual Studio 2013, here's how to redo the problem. Take this simple 
program:

#include 

int main(int argc, char **argv)
{
return (int)hypot(rand(), rand());
}

And compile it:

cl.exe test.c -I include/python3.3 lib/python33.lib /W4

c:\program files (x86)\microsoft visual studio 12.0\vc\include\math.h(566) : 
warning C4717: '_hypot' : recursive on all control paths, function will cause 
runtime stack overflow

I don't know about the conditions to get a warning in VS 2010, never tried that 
version.

--

___
Python tracker 

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



[issue20423] io.StringIO newline param has wrong default

2014-01-28 Thread couplewavylines

New submission from couplewavylines:

In io.StringIO, the newline argument's default is currently documented as 
"newline=None" in the section header. However, it's described this way:  "The 
default is to do no newline translation."  The behavior of io.StringIO is 
consistent with this description (NO newline translation). 
The header should actually read "newline=''".
"newline=None" would mean there IS newline translation by default, which is not 
the case. Code sample attached as no_translation.py.

--
assignee: docs@python
components: Documentation
files: no_translation.py
messages: 209577
nosy: couplewavylines, docs@python
priority: normal
severity: normal
status: open
title: io.StringIO newline param has wrong default
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file33779/no_translation.py

___
Python tracker 

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



[issue20423] io.StringIO newline param has wrong default

2014-01-28 Thread couplewavylines

Changes by couplewavylines :


Added file: http://bugs.python.org/file33780/no_translation_output.txt

___
Python tracker 

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



[issue20414] Python 3.4 has two Overlapped types

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

Martin v. Löwis added the comment:

See my review in Rietveld.

--

___
Python tracker 

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



[issue20423] io.StringIO newline param has wrong default

2014-01-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

No, actual default is '\n'.

>>> io.StringIO('abc\r\ndef\nghi\rklm').readlines()
['abc\r\n', 'def\n', 'ghi\rklm']
>>> io.StringIO('abc\r\ndef\nghi\rklm', newline=None).readlines()
['abc\n', 'def\n', 'ghi\n', 'klm']
>>> io.StringIO('abc\r\ndef\nghi\rklm', newline='').readlines()
['abc\r\n', 'def\n', 'ghi\r', 'klm']
>>> io.StringIO('abc\r\ndef\nghi\rklm', newline='\n').readlines()
['abc\r\n', 'def\n', 'ghi\rklm']
>>> io.StringIO('abc\r\ndef\nghi\rklm', newline='\r').readlines()
['abc\r', '\r', 'def\r', 'ghi\r', 'klm']
>>> io.StringIO('abc\r\ndef\nghi\rklm', newline='\r\n').readlines()
['abc\r\r\n', 'def\r\n', 'ghi\rklm']

--
keywords: +easy
nosy: +serhiy.storchaka
stage:  -> needs patch
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



[issue20423] io.StringIO newline param has wrong default

2014-01-28 Thread couplewavylines

couplewavylines added the comment:

Serhiy, you're right, I now see the default behavior is "newline='\n'".

So, the header is still wrong, and the text is "The default is to do no newline 
translation" may be incorrect too?  Or just unclear (to me anyway)?

--

___
Python tracker 

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



[issue20423] io.StringIO newline param has wrong default

2014-01-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

On other hand, may be the behavior of io.StringIO is wrong. Because it is 
different from io.TextIOWrapper.

>>> io.TextIOWrapper(io.BytesIO(b'abc\r\ndef\nghi\rklm')).readlines()
['abc\n', 'def\n', 'ghi\n', 'klm']
>>> io.TextIOWrapper(io.BytesIO(b'abc\r\ndef\nghi\rklm'), 
>>> newline=None).readlines()
['abc\n', 'def\n', 'ghi\n', 'klm']
>>> io.TextIOWrapper(io.BytesIO(b'abc\r\ndef\nghi\rklm'), 
>>> newline='').readlines()
['abc\r\n', 'def\n', 'ghi\r', 'klm']
>>> io.TextIOWrapper(io.BytesIO(b'abc\r\ndef\nghi\rklm'), 
>>> newline='\n').readlines()
['abc\r\n', 'def\n', 'ghi\rklm']
>>> io.TextIOWrapper(io.BytesIO(b'abc\r\ndef\nghi\rklm'), 
>>> newline='\r').readlines()
['abc\r', '\ndef\nghi\r', 'klm']
>>> io.TextIOWrapper(io.BytesIO(b'abc\r\ndef\nghi\rklm'), 
>>> newline='\r\n').readlines()
['abc\r\n', 'def\nghi\rklm']

--
nosy: +benjamin.peterson, hynek, pitrou, stutzbach

___
Python tracker 

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



[issue20221] #define hypot _hypot conflicts with existing definition

2014-01-28 Thread Zachary Ware

Changes by Zachary Ware :


--
stage: test needed -> patch review

___
Python tracker 

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



[issue20221] #define hypot _hypot conflicts with existing definition

2014-01-28 Thread Zachary Ware

Zachary Ware added the comment:

Your test program works for VS2010 as well (/W4 is unnecessary, the default 
warning level gives the warning), but still doesn't answer the question of why 
the math module (specifically math.hypot) doesn't show the problem.

I understand why both of your cases *don't* work, I want to understand why 
mathmodule.c and cmathmodule.c (and complexobject.c, for that matter) *do* 
work.  Attempting to compile mathmodule.c alone results in the warning, and 
even picking through mathmodule.i as produced by preprocessing to file, it 
looks like math_hypot should always have the problem.

The fact that math_hypot works when compiled with the rest of Python frankly 
frustrates me quite a lot, because I can see no reason why it should.

--

___
Python tracker 

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



[issue20424] _pyio.StringIO doesn't work with lone surrogates

2014-01-28 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Unlike to io.StringIO, _pyio.StringIO doesn't work with lone surrogates.

>>> import io, _pyio
>>> io.StringIO('\ud880')
<_io.StringIO object at 0xb71426ec>
>>> _pyio.StringIO('\ud880')
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/serhiy/py/cpython/Lib/_pyio.py", line 2065, in __init__
self.write(initial_value)
  File "/home/serhiy/py/cpython/Lib/_pyio.py", line 1629, in write
b = encoder.encode(s)
  File "/home/serhiy/py/cpython/Lib/encodings/utf_8.py", line 20, in encode
return codecs.utf_8_encode(input, self.errors)[0]
UnicodeEncodeError: 'utf-8' codec can't encode character '\ud880' in position 
0: surrogates not allowed

Proposed patch adds support of lone surrogates to _pyio.StringIO.

--
components: IO, Unicode
files: stringio_lone_surrogates.patch
keywords: patch
messages: 209583
nosy: benjamin.peterson, ezio.melotti, haypo, hynek, pitrou, serhiy.storchaka, 
stutzbach
priority: normal
severity: normal
stage: patch review
status: open
title: _pyio.StringIO doesn't work with lone surrogates
type: behavior
versions: Python 3.3, Python 3.4
Added file: http://bugs.python.org/file33781/stringio_lone_surrogates.patch

___
Python tracker 

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



[issue20218] Add `pathlib.Path.write` and `pathlib.Path.read`

2014-01-28 Thread Christopher Welborn

Christopher Welborn added the comment:

Using 'review' with pathlib.readwrite4.patch, it looks like it only modifies 
one file (test_pathlib.py), which can't be right. Maybe you edited the patch 
directly instead of generating a new one? (also, the line-counts haven't 
changed and I think they were suppose to.)

The python-dev guide may help you to move forward with this, and any future 
ideas. I definitely have a lot to learn myself, but I do know that the less 
leg-work core-devs have to do, the easier it is to make a contribution. 

Python dev-guide: http://docs.python.org/devguide/

Here is the 'exclusive' feature with some tests, it raises TypeError when 
'append' and 'exclusive' are used at the same time (mismatched args/kwargs 
usually raise TypeError in python from what I can tell).

It's still missing the Doc changes, and probably more stuff that I don't know 
about yet. 

As usual, all tests pass including the python test-suite, and `make patchcheck` 
removed some whitespace for me.
Thanks,
-Chris (cjwelborn)

--
Added file: 
http://bugs.python.org/file33782/pathlib.readwrite3_with_exclusive.patch

___
Python tracker 

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



[issue20425] inspect.Signature should work on decorated builtins

2014-01-28 Thread Yury Selivanov

Changes by Yury Selivanov :


--
keywords: +needs review

___
Python tracker 

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



[issue20425] inspect.Signature should work on decorated builtins

2014-01-28 Thread Yury Selivanov

New submission from Yury Selivanov:

inspect.signature should work with decorated builtins. Suppose I want to create 
a cached version of 'min' builtin:

   cached_min = functools.lru_cache()(min)

The signature of the 'cached_min' should match the signature of 'min'.

The patch is attached.

--
assignee: yselivanov
files: decorated_builtins_01.patch
keywords: patch
messages: 209585
nosy: brett.cannon, larry, ncoghlan, yselivanov
priority: high
severity: normal
stage: patch review
status: open
title: inspect.Signature should work on decorated builtins
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file33783/decorated_builtins_01.patch

___
Python tracker 

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



[issue20422] Signature.from_builtin should raise a ValueError when no signature can be provided

2014-01-28 Thread Yury Selivanov

Yury Selivanov added the comment:

A patch is attached, please review.

--
keywords: +needs review, patch
stage:  -> patch review
Added file: http://bugs.python.org/file33784/from_builtin_errors_01.patch

___
Python tracker 

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



[issue20414] Python 3.4 has two Overlapped types

2014-01-28 Thread STINNER Victor

STINNER Victor added the comment:

> See my review in Rietveld.

Thanks Martin, but I cannot answer to your question. I didn't write this part 
of the code and I don't know it. Maybe Richard or Antoine would be able to 
answer?

--

___
Python tracker 

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



[issue20424] _pyio.StringIO doesn't work with lone surrogates

2014-01-28 Thread STINNER Victor

STINNER Victor added the comment:

I agree that StringIO should accept lone surrogates as str += str accept them.

The patch looks good, but please mention the issue number in the unit test. And 
add an empty line between the two parts of the test (reader, writer).

--

___
Python tracker 

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



[issue20379] help(instance_of_builtin_class.method) does not display self

2014-01-28 Thread Yury Selivanov

Yury Selivanov added the comment:

FWIW, I solved the first arg consistency for inspect.getfullargspec in #17481. 
The latest patch always shows the first argument (self) for both python-defined 
and C-defined methods.

--
nosy: +yselivanov

___
Python tracker 

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



[issue15582] Enhance inspect.getdoc to follow inheritance chains

2014-01-28 Thread Yury Selivanov

Changes by Yury Selivanov :


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



[issue19573] Fix the docstring of inspect.Parameter and the implementation of _ParameterKind

2014-01-28 Thread Yury Selivanov

Changes by Yury Selivanov :


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



[issue20423] io.StringIO newline param has wrong default

2014-01-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Using '\n' as default is normal: StringIOs are not stored on disk so there's no 
point in converting newlines by default (it's only slower while not improving 
interoperability). '\n' is the default line separator in Python.

So we should just fix the docs here.

The bug when using '\r' or '\r\n' should probably be fixed though (that would 
be a separate issue).

--

___
Python tracker 

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



[issue19573] Fix the docstring of inspect.Parameter and the implementation of _ParameterKind

2014-01-28 Thread Yury Selivanov

Yury Selivanov added the comment:

Antony, the docstrings are fixed. Could you please provide a patch just for the 
_ParameterKind-Enum refactoring? I'll incorporate it into 3.5 then.

--
assignee: docs@python -> yselivanov

___
Python tracker 

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



  1   2   >