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

2016-08-08 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

Here is an updated version (for 3.6) of the patch of maciej.szulik.

I have executed all the tests.

Please, could you review this patch.

Thank you

--
nosy: +matrixise
versions: +Python 3.6 -Python 3.5
Added file: http://bugs.python.org/file44044/issue1100942-3.6.patch

___
Python tracker 

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



[issue27706] Random.seed, whose purpose is purportedly determinism, behaves non-deterministically with strings due to hash randomization

2016-08-08 Thread Cory Benfield

Changes by Cory Benfield :


--
nosy: +Lukasa

___
Python tracker 

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



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

2016-08-08 Thread Mark Lawrence

Changes by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue20842] pkgutil docs should reference glossary terms not PEP 302

2016-08-08 Thread Oren Milman

Oren Milman added the comment:

ImpImporter was first added in changeset 37808 
(https://hg.python.org/cpython/rev/ccc0b5412799) and updated a day later in 
changeset 37821 (https://hg.python.org/cpython/rev/3135648026c4).
Both of these commits were introduced to support PEP 302. 
Since then, ImpImporter remained quite the same, and was never changed to suit 
later relevant PEPs (e.g. PEP 420 and PEP 451).

Thus, IMHO, we should go with your second option, Martin, and retain the PEP 
302 reference in ImpImporter documentation.

With regard to the accuracy of Python's 'finder' glossary entry, it was updated 
recently, in changeset 99434 (https://hg.python.org/cpython/rev/88cee7d16ccb), 
to suit PEP 302, PEP 420 and PEP 451, so ISTM there is no need to adjust it.

--

___
Python tracker 

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



[issue27707] List reports incorrect length if modifed after yield

2016-08-08 Thread Robin

New submission from Robin:

reproduction script below. In the last print statement, it shows me a list with 
items in it, but with a length of 0

def generator():
l = []
yield l
l.append(1)
# this correctly prints 1
print(len(l))

# this should print [([1], 1)], but actually gives [([1], 0)]
print([(l, len(l)) for l in generator()])

--
components: Interpreter Core
messages: 272151
nosy: robinh
priority: normal
severity: normal
status: open
title: List reports incorrect length if modifed after yield
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



[issue27707] List reports incorrect length if modifed after yield

2016-08-08 Thread Stéphane Wirtel

Changes by Stéphane Wirtel :


--
status: closed -> open

___
Python tracker 

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



[issue27707] List reports incorrect length if modifed after yield

2016-08-08 Thread SilentGhost

SilentGhost added the comment:

At the time the len function in list comprehension is called .append has not 
executed, the len call in list comprehension operates on object as it is, 
whereas the object itself is only referenced rather than copied. If you were to 
copy the yielded list, then a more expected behaviour of returning [([], 0)] 
would be demonstrated.

--
nosy: +SilentGhost
resolution:  -> not a bug
stage:  -> 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



[issue27707] List reports incorrect length if modifed after yield

2016-08-08 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

when you yield, the list is empty, in this case, the length of your list is 
just 0 and not 1.

--
nosy: +matrixise
status: open -> closed

___
Python tracker 

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



[issue26209] TypeError in smtpd module with string arguments

2016-08-08 Thread Ram Vallury

Ram Vallury added the comment:

Updated the documentation of smtpd.
https://docs.python.org/3/library/smtpd.html#smtpserver-objects




* this is my first patch, please revert back to me or make learn if I do any 
mistake*

--
keywords: +patch
nosy: +rvallury
Added file: http://bugs.python.org/file44045/smtpd_doc_updated.patch

___
Python tracker 

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



[issue26945] difflib.HtmlDiff().make_file() treat few change as whole line change

2016-08-08 Thread JW

JW added the comment:

please find attached the reproducer C.7z

this issue only happens with this format of data before and after the difference

--
Added file: http://bugs.python.org/file44046/C.7z

___
Python tracker 

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



[issue23369] integer overflow in _json.encode_basestring_ascii

2016-08-08 Thread immerse

immerse added the comment:

I noticed that this is only fixed for python 3.3 and 3.4, not for 2.7. Is that 
intentional? If so, why?

--
nosy: +immerse -pkt

___
Python tracker 

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



[issue23322] parser module docs missing second example

2016-08-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b479e74f7706 by Berker Peksag in branch '3.5':
Issue #23322: Remove outdated reference to an example in parser docs
https://hg.python.org/cpython/rev/b479e74f7706

New changeset 099fd7954941 by Berker Peksag in branch 'default':
Issue #23322: Merge from 3.5
https://hg.python.org/cpython/rev/099fd7954941

--
nosy: +python-dev

___
Python tracker 

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



[issue23322] parser module docs missing second example

2016-08-08 Thread Berker Peksag

Berker Peksag added the comment:

Thanks, Sahil.

--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed
type:  -> behavior
versions: +Python 3.6 -Python 3.4

___
Python tracker 

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



[issue26209] TypeError in smtpd module with string arguments

2016-08-08 Thread Ram Vallury

Ram Vallury added the comment:

Submitting patch 2 for smtpd doc changes

--
Added file: http://bugs.python.org/file44047/smtpd_doc_updated_2.patch

___
Python tracker 

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



[issue26209] TypeError in smtpd module with string arguments

2016-08-08 Thread Berker Peksag

Changes by Berker Peksag :


--
stage: needs patch -> patch review

___
Python tracker 

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



[issue27708] Roudning/Large Int representation error with multiplication and division

2016-08-08 Thread Ethan Glass

New submission from Ethan Glass:

Python represents large integers as floating-points, which may or may not be 
the cause or part of the cause of division of said large integers evaluating to 
a floating-point number usually within a 1-integer range of the correct result.

--
components: ctypes
messages: 272160
nosy: eglass
priority: normal
severity: normal
status: open
title: Roudning/Large Int representation error with multiplication and division
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue27702] [Patch] Only use SOCK_RAW when defined

2016-08-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 535f88ad80d8 by Berker Peksag in branch 'default':
Issue #27702: Only expose SOCK_RAW when defined
https://hg.python.org/cpython/rev/535f88ad80d8

--
nosy: +python-dev

___
Python tracker 

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



[issue27702] Only use SOCK_RAW when defined

2016-08-08 Thread Berker Peksag

Berker Peksag added the comment:

Thanks!

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
title: [Patch] Only use SOCK_RAW when defined -> Only use SOCK_RAW when defined
type:  -> enhancement

___
Python tracker 

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



[issue27708] Roudning/Large Int representation error with multiplication and division

2016-08-08 Thread Eric V. Smith

Eric V. Smith added the comment:

Actually, Python represents large integers exactly. Can you provide a specific 
example of a problem you're seeing?

--
components: +Interpreter Core -ctypes
nosy: +eric.smith

___
Python tracker 

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



[issue12319] [http.client] HTTPConnection.request not support "chunked" Transfer-Encoding to send data

2016-08-08 Thread Rolf Krahl

Rolf Krahl added the comment:

Martin,

> I wonder if it would be safer to test for TextIOBase. With the
> read(0) hack, the zero size may be unexpected. A file object may
> need special handling to generate an empty result, or to not
> interpret it as an EOF indicator. See e.g. Issue 23804, about
> zero-sized SSL reads, where both of these problems happened. As long
> as we document that the text file logic has changed, I think it
> would be okay. IMO it is better to keep things simple and robust for
> byte files than add more hacks for text files.

The problem is that there is no accepted definition of what a file-like object 
is.  As a consequence, each test method will fail in some cases.  Not all 
file-like objects are derived from the base classes in the io module.  It is 
common praxis to simply define an object with a read() method and to consider 
this a file-like.  This pattern can even be found in the official Python test 
suite.  Testing for TextIOBase will fail in these cases.

There seem to be at least a minimal consensus that each file-like (that 
supports reading) must have the read() method implementing the interface as 
defined by the io base classes.  The read(0) test (I wouldn't call it a hack, 
as it only uses this documented API) has the advantage of making no other 
assumptions then this.  And I even would not accept Issue 23804 as a counter 
example as this was clearly a bug in the ssl module.

The current test using the mode attribute is certainly the worst one as it even 
fails for standard classes from the io module.

Anyway.  Even though I would prefer the read(0) test, I am happy to accept any 
other method.  Please tell me what I should use.


> However I still don’t see why the checks are worthwhile. Sure having
> both is a technical violation of the current HTTP protocols. But if
> a caller is likely to end up in one of these situations, it may
> indicate a problem with the API that we should fix instead. If the
> checks are unlikely to ever fail, then drop them.

The question is whether we should apply sanity checks on caller's input or 
whether we should rather send bullshit out and wait for the request to fail.  
I'd rather give the caller a somewhat helpful error message rather then a 
lesser helpful "400 Bad Request" from the server.  But if you really insist, I 
can also remove these checks.

I don't understand your remark on the API and what the likeliness of rubbish 
header values set by the caller has to do with it, sorry.

> Otherwise, I don’t think any of the bugs I pointed out have been
> addressed.

Could you elaborate on what bugs you are talking about?  I really don't know, 
sorry.

> I don’t like converting bytes-like to bytes. I understand one of the
> main purposes of accepting bytes-like objects is to avoid copying
> them, but converting to bytes defeats that. Also, the copying is
> inconsistent with the lack of copying in _read_iterable().

I added this conversion because you mentioned Issue 27340 and the problem to 
send byte-like objects with the ssl module.  I agree to leave this to Issue 
27340 to find a better solution and will remove the conversion.

> I am wondering if it would be best to keep new logic out of send();
> just put it into _send_output() instead. Once upon a time, send()
> was a simple wrapper around socket.sendall() without much bloat. But
> with the current patch, in order to send a single buffer, we have to
> jump through a bunch of checks, create a dummy lambda and singleton
> tuple, loop over the singleton, call the lambda, realize there is no
> chunked encoding, etc. IMO the existing support for iterables should
> have been put in _send_output() too (when that was an option). There
> is no need to use send() to send the whole body when endheaders()
> already supports that.

No problem, I can move all this to _send_output().  The only problem that I see 
then, is that the current library version of send() already accepts file-like 
(both text and byte streams), bytes, and iterables.  So we will end up with two 
different methods accepting this variety of data types and behaving differently 
in the respective cases.

Maybe, as a consequence, one should restrict send() to accept only bytes in 
order to tighten consistency.  But this is not in the scope of this Issue and 
will not be covered by my patch.


Please note that I will be in holidays starting with next Monday.  We should 
try to get this done during this week.

--

___
Python tracker 

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



[issue26470] Make OpenSSL module compatible with OpenSSL 1.1.0

2016-08-08 Thread Christian Heimes

Christian Heimes added the comment:

Stéphane, I have addressed your code review.

def __new__() no longer hard-codes protocol. We can change that in a later 
version of Python. OpenSSL has deprecated all SSL methods except of the generic 
TLS method. The TLS method was formerly known as SSLv23 method and does 
auto-negotiation of the latest supported method.

Lib/test/test_ssl.py:1183: LibreSSL does not support SSL_CA_PATH and SSL_CA_DIR 
env vars. I have changed the comment on the test.

Modules/_hashopenssl.c:127: _hashopenssl.c now does error checks on EVP digest 
copy. The copy operation can fail when an EVP ENGINE is involved.

HAS_FAST_PKCS5_PBKDF2_HMAC is defined in _hashopenssl.c. OpenSSL used to have a 
bad implementation of PKBDF2. I fixed it in 2013. The workaround is no longer 
required for OpenSSL >= 1.1.0. You can find more details in 
https://jbp.io/2015/08/11/pbkdf2-performance-matters/

--
Added file: 
http://bugs.python.org/file44048/Port-Python-s-SSL-module-to-OpenSSL-1.1.0-2.patch

___
Python tracker 

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



[issue27690] os.path.normcase broken.

2016-08-08 Thread R. David Murray

Changes by R. David Murray :


--
type: crash -> behavior

___
Python tracker 

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



[issue27687] Linux shutil.move between mountpoints as root does not retain ownership

2016-08-08 Thread R. David Murray

R. David Murray added the comment:

This is as documented (see copystat).  To do anything with user and group would 
be an enhancement.

--
nosy: +r.david.murray
type: behavior -> enhancement
versions: +Python 3.6 -Python 2.7, Python 3.4

___
Python tracker 

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



[issue27708] Roudning/Large Int representation error with multiplication and division

2016-08-08 Thread Steven D'Aprano

Steven D'Aprano added the comment:

Your description is hard to understand, and doesn't give enough detail, but I 
*think* I can guess what you might be referring to.

If you start with a really big integer, and divide, you get a float. But really 
big floats cannot represent every number exactly (they only have a limited 
precision). For example:

py> n = 12345678901234567
py> print(n, n/1)
12345678901234567 1.2345678901234568e+16

Converting n to an int (you don't need to use division, calling float() will do 
the same thing) rounds to the nearest possible 64-bit floating point value, 
which happens to be one larger.

If this is the error you are talking about, there's nothing that can be done 
about it. It is fundamental to the way floating point numbers work.

If you mean something different, please explain.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue27708] Roudning/Large Int representation error with multiplication and division

2016-08-08 Thread Steven D'Aprano

Steven D'Aprano added the comment:

> Converting n to an int

Oops. Obviously I meant converting n *from* an int *to* a float.

--

___
Python tracker 

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



[issue27694] Socket incorrectly states IP address that start with a zero after a dot are illegal

2016-08-08 Thread R. David Murray

R. David Murray added the comment:

See also issue 27612.

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



[issue20004] csv.DictReader classic class has a property with setter

2016-08-08 Thread Mathieu Dupuy

Mathieu Dupuy added the comment:

Yeah, it turned out I was actually browsing Python 2.7 sources. My bad.

2016-08-08 16:39 GMT+02:00 R. David Murray :
>
> R. David Murray added the comment:
>
> I don't believe it was ever committed to 3.x, nor do I see it there.
>
> --
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue20004] csv.DictReader classic class has a property with setter

2016-08-08 Thread R. David Murray

R. David Murray added the comment:

I don't believe it was ever committed to 3.x, nor do I see it there.

--

___
Python tracker 

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



[issue26945] difflib.HtmlDiff().make_file() treat few change as whole line change

2016-08-08 Thread SilentGhost

SilentGhost added the comment:

JW, this doens't seem anything to do with the original issue. I'm going to 
close this issue and open a new one that's dealing with your case, I have a fix 
for it.

--
resolution:  -> not a bug
stage:  -> 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



[issue27709] difflib.HtmlDiff produces different output from difflib.ndiff

2016-08-08 Thread SilentGhost

New submission from SilentGhost:

msg264842 in issue26945 reports an odd results of HtmlDiff.make_file, digging 
into it I've noticed couple of things: different output to one generated 
directly from difflib.ndiff and underlying issue further up the stack that 
generates same faulty output with a slightly modified files.

The patch I'm attaching fixes the issue with different outputs, from make_file 
and ndiff, by not removing EOL characters, I had to re-generate expected test 
output file.

--
components: Library (Lib)
files: donttrim.diff
keywords: patch
messages: 272173
nosy: SilentGhost, jlwing, loewis
priority: normal
severity: normal
stage: patch review
status: open
title: difflib.HtmlDiff produces different output from difflib.ndiff
type: behavior
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file44049/donttrim.diff

___
Python tracker 

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



[issue27710] Disallow fold not in [0, 1] in time and datetime constructors

2016-08-08 Thread Alexander Belopolsky

New submission from Alexander Belopolsky:

The current implementation does not restrict values accepted by the fold 
argument:

>>> from datetime import *
>>> time(fold=2)
datetime.time(0, 0, fold=2)
>>> datetime(1, 1, 1, fold=2)
datetime.datetime(1, 1, 1, 0, 0, fold=2)

--
assignee: belopolsky
messages: 272174
nosy: belopolsky
priority: normal
severity: normal
status: open
title: Disallow fold not in [0, 1] in time and datetime constructors
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue27711] datetime.utctimetuple() method should respect fold disambiguation

2016-08-08 Thread Alexander Belopolsky

New submission from Alexander Belopolsky:

With TZ = America/New_York:

>>> t0 = datetime(2016, 11, 6, 1, 30, fold=0)
>>> t1 = datetime(2016, 11, 6, 1, 30, fold=1)
>>> t0.utctimetuple()[:6]
(2016, 11, 6, 1, 30, 0)
>>> t1.utctimetuple()[:6]
(2016, 11, 6, 1, 30, 0)
>>> t0.timestamp()
1478410200.0
>>> t1.timestamp()
1478413800.0

The correct values for utctimetuple() should be the same as

>>> datetime.utcfromtimestamp(t0.timestamp()).timetuple()[:6]
(2016, 11, 6, 5, 30, 0)
>>> datetime.utcfromtimestamp(t1.timestamp()).timetuple()[:6]
(2016, 11, 6, 6, 30, 0)

--
assignee: belopolsky
messages: 272175
nosy: belopolsky
priority: normal
severity: normal
status: open
title: datetime.utctimetuple() method should respect fold disambiguation
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue27711] datetime.utctimetuple() method should respect fold disambiguation

2016-08-08 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

This would be a feature not anticipated by PEP 495.

--
resolution:  -> rejected
status: open -> closed
type: behavior -> enhancement

___
Python tracker 

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



[issue27712] Tiny typos in import.rst

2016-08-08 Thread Xiang Zhang

Changes by Xiang Zhang :


--
assignee: docs@python
components: Documentation
files: import_doc.patch
keywords: patch
nosy: docs@python, xiang.zhang
priority: normal
severity: normal
status: open
title: Tiny typos in import.rst
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file44050/import_doc.patch

___
Python tracker 

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



[issue27392] Add a server_side keyword parameter to create_connection

2016-08-08 Thread Guido van Rossum

Guido van Rossum added the comment:

Did the patch not get merged??

On Sun, Aug 7, 2016 at 11:32 AM, Jim Fulton  wrote:

>
> Jim Fulton added the comment:
>
> FTR another use case for this. :)
>
> We have a ZEO applications where individual database users authenticate
> via self-signed certs. The server's SSL connection has to have this
> collection of certs. User CRUD operations can add and remove certs to
> authenticate against.  SSL contexts don't provide an API for removing (or
> even clearing) CAs used for authentication, so we need to create new SSL
> contexts when the set of valid certs change.  There's no way to update the
> SSL context used by a server, so we're wrapping accepted sockets ourselves,
> so we can use dynamic SSL contexts.
>
> Some alternatives:
>
> - Add an SSLContext API for removing or clearing CAs
>
> - Add a Server API to update the SSL context used for new connections.  (I
> may pursue this at some point. I spent a few minutes trying to find where a
> Server's SSL context is stored, but failed and can't spend more time ATM.)
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue27392] Add a server_side keyword parameter to create_connection

2016-08-08 Thread Jim Fulton

Jim Fulton added the comment:

idk if the patch got merged.

I just added the last comment for informational purposes. :)

Perhaps this issue can be closed.

--

___
Python tracker 

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



[issue27392] Add a server_side keyword parameter to create_connection

2016-08-08 Thread Yury Selivanov

Yury Selivanov added the comment:

> Did the patch not get merged??

connect_accepted_socket was merged.  The docs patch is still pending (nothing 
wrong with it, I just need to commit it)

--

___
Python tracker 

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



[issue27700] Document asyncio.AbstractEventLoop, not asyncio.BaseEventLoop

2016-08-08 Thread Guido van Rossum

Guido van Rossum added the comment:

Here's a tentative diff. I did a global replace BaseEventLoop -> 
AbstractEventLoop and added an entry for BaseEventLoop (just above 
AbstractEventLoop) explaining that it should not be used.  Please review for 
obvious mistakes.

--

___
Python tracker 

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



[issue27700] Document asyncio.AbstractEventLoop, not asyncio.BaseEventLoop

2016-08-08 Thread Guido van Rossum

Guido van Rossum added the comment:

Here's the file (I hope).

--

___
Python tracker 

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



[issue27700] Document asyncio.AbstractEventLoop, not asyncio.BaseEventLoop

2016-08-08 Thread Guido van Rossum

Changes by Guido van Rossum :


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

___
Python tracker 

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



[issue27700] Document asyncio.AbstractEventLoop, not asyncio.BaseEventLoop

2016-08-08 Thread Guido van Rossum

Guido van Rossum added the comment:

Uploading the file.

--

___
Python tracker 

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



[issue27700] Document asyncio.AbstractEventLoop, not asyncio.BaseEventLoop

2016-08-08 Thread Guido van Rossum

Guido van Rossum added the comment:

Here's the file.

--
keywords: +patch
Added file: http://bugs.python.org/file44051/Base2Abstract.diff

___
Python tracker 

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



[issue27700] Document asyncio.AbstractEventLoop, not asyncio.BaseEventLoop

2016-08-08 Thread Guido van Rossum

Changes by Guido van Rossum :


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

___
Python tracker 

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



[issue27700] Document asyncio.AbstractEventLoop, not asyncio.BaseEventLoop

2016-08-08 Thread Guido van Rossum

Changes by Guido van Rossum :


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

___
Python tracker 

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



[issue9998] ctypes find_library should search LD_LIBRARY_PATH on Linux

2016-08-08 Thread Vinay Sajip

Vinay Sajip added the comment:

Updated the last patch with code for handling the case where ld is not 
available.

--
Added file: http://bugs.python.org/file44052/refresh-2016-08-08.diff

___
Python tracker 

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



[issue9998] ctypes find_library should search LD_LIBRARY_PATH on Linux

2016-08-08 Thread Daniel Blanchard

Changes by Daniel Blanchard :


--
nosy:  -Daniel.Blanchard

___
Python tracker 

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



[issue27698] socketpair not in socket.__all__ on Windows

2016-08-08 Thread R. David Murray

R. David Murray added the comment:

I don't see any special casing for windows in the socketpair code in the 
current socket module, nor do I see any mention of socketpair in the 3.5 
whatsnew.  Based on a quick scan of the socket code I don't see how socketpair 
could be defined on a platform without also automatically being included in 
__all__.

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



[issue27713] Spurious "platform dependent libraries" warnings when running make

2016-08-08 Thread Chris Jerdonek

New submission from Chris Jerdonek:

When installing Python 3.5.2 from source on Ubuntu 14.04 and running
make, I get the below "Could not find platform dependent libraries"
warnings (which I prefixed with "***" for better visibility).

>From this message which has more background, these warnings are
apparently harmless:

https://mail.python.org/pipermail/python-dev/2016-August/145783.html


  -DHGBRANCH="\"`LC_ALL=C `\"" \
  -o Modules/getbuildinfo.o ./Modules/getbuildinfo.c
gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 
-Wall -Wstrict-prototypes-Werror=declaration-after-statement   -I. 
-IInclude -I./Include-DPy_BUILD_CORE -o Programs/_freeze_importlib.o 
Programs/_freeze_importlib.c
gcc -pthread   -o Programs/_freeze_importlib Programs/_freeze_importlib.o 
Modules/getbuildinfo.o Parser/acceler.o [**snipped for brevity**]  
Modules/xxsubtype.o -lpthread -ldl  -lutil   -lm  
if test "no" != "yes"; then \
./Programs/_freeze_importlib \
./Lib/importlib/_bootstrap.py Python/importlib.h; \
fi
***: Could not find platform dependent libraries 
***: Consider setting $PYTHONHOME to [:]
if test "no" != "yes"; then \
./Programs/_freeze_importlib \
./Lib/importlib/_bootstrap_external.py 
Python/importlib_external.h; \
fi
***: Could not find platform dependent libraries 
***: Consider setting $PYTHONHOME to [:]
gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 
-Wall -Wstrict-prototypes-Werror=declaration-after-statement   -I. 
-IInclude -I./Include-DPy_BUILD_CORE -o Python/frozen.o Python/frozen.c
rm -f libpython3.5m.a
ar rc libpython3.5m.a Modules/getbuildinfo.o

--
components: Installation
messages: 272186
nosy: chris.jerdonek
priority: normal
severity: normal
status: open
title: Spurious "platform dependent libraries" warnings when running make
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



[issue27698] socketpair not in socket.__all__ on Windows

2016-08-08 Thread SilentGhost

SilentGhost added the comment:

> nor do I see any mention of socketpair in the 3.5 whatsnew
socket.socketpair has a versionchanged 3.5: Windows support added.

--
nosy: +SilentGhost

___
Python tracker 

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



[issue27698] socketpair not in socket.__all__ on Windows

2016-08-08 Thread Eryk Sun

Eryk Sun added the comment:

See issue 18643, which added a Windows implementation of socketpair(). Since 
it's not defined in the _socket extension module, it isn't added to 
socket.__all__. Someone simply forgot to add 
`__all__.append("sockpetpair")` after the definition on line 485.

--
nosy: +eryksun

___
Python tracker 

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



[issue27698] socketpair not in socket.__all__ on Windows

2016-08-08 Thread Eryk Sun

Changes by Eryk Sun :


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

___
Python tracker 

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



[issue27698] socketpair not in socket.__all__ on Windows

2016-08-08 Thread Eryk Sun

Eryk Sun added the comment:

See issue 18643, which added a Windows implementation of socketpair(). Since 
it's not defined in the _socket extension module, it isn't added to 
socket.__all__. Someone simply forgot to add `__all__.append("socketpair")` 
after the definition on line 485.

--

___
Python tracker 

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



[issue27595] Document PEP 495 (Local Time Disambiguation) features

2016-08-08 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I am attaching the first cut of the documentation changes.  Note that I am 
deliberately trying to keep the information about the fold to the minimum in 
the reference manual.  I don't think the details of how fold works are of 
interest to anyone other then those who implement the tzinfo subclasses.

--
keywords: +patch
Added file: http://bugs.python.org/file44053/issue27595.diff

___
Python tracker 

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



[issue27700] Document asyncio.AbstractEventLoop, not asyncio.BaseEventLoop

2016-08-08 Thread Guido van Rossum

Changes by Guido van Rossum :


--
stage: needs patch -> patch review

___
Python tracker 

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



[issue27700] Document asyncio.AbstractEventLoop, not asyncio.BaseEventLoop

2016-08-08 Thread Yury Selivanov

Yury Selivanov added the comment:

The patch looks good.

I have a question: do we actually want to document BaseEventLoop?  It's not a 
user-facing class, and the knowledge that it exists doesn't add to anything IMO.

--

___
Python tracker 

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



[issue27710] Disallow fold not in [0, 1] in time and datetime constructors

2016-08-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 035778fdc641 by Alexander Belopolsky in branch 'default':
Closes #27710: Disallow fold not in [0, 1] in time and datetime constructors.
https://hg.python.org/cpython/rev/035778fdc641

--
nosy: +python-dev
resolution:  -> fixed
stage:  -> 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



[issue27700] Document asyncio.AbstractEventLoop, not asyncio.BaseEventLoop

2016-08-08 Thread Guido van Rossum

Guido van Rossum added the comment:

The reason I kept some mention of BaseEventLoop is just that until now it
was the only thing documented and people might have references to it. It
would be good if searching for BaseEventLoop took them to a section
explaining they shouldn't use it, rather than just mysteriously failing to
turn up any search results at all.

And given that it *is* the base class I think we can't mark it as
deprecated (and I don't think that's needed yet).

--

___
Python tracker 

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



[issue27700] Document asyncio.AbstractEventLoop, not asyncio.BaseEventLoop

2016-08-08 Thread Yury Selivanov

Yury Selivanov added the comment:

Fair enough.  I don't have any other questions about the patch.

--

___
Python tracker 

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



[issue27700] Document asyncio.AbstractEventLoop, not asyncio.BaseEventLoop

2016-08-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 87e3a58ed3c3 by Guido van Rossum in branch '3.5':
Issue #27700: Document AbstractEventLoop, not BaseEventLoop.
https://hg.python.org/cpython/rev/87e3a58ed3c3

New changeset d69f782d642d by Guido van Rossum in branch 'default':
Issue #27700: Document AbstractEventLoop, not BaseEventLoop. (Merge 3.5->3.6)
https://hg.python.org/cpython/rev/d69f782d642d

--
nosy: +python-dev

___
Python tracker 

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



[issue27700] Document asyncio.AbstractEventLoop, not asyncio.BaseEventLoop

2016-08-08 Thread Guido van Rossum

Changes by Guido van Rossum :


--
stage: patch review -> resolved

___
Python tracker 

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



[issue27700] Document asyncio.AbstractEventLoop, not asyncio.BaseEventLoop

2016-08-08 Thread Guido van Rossum

Changes by Guido van Rossum :


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



[issue27709] difflib.HtmlDiff produces different output from difflib.ndiff

2016-08-08 Thread SilentGhost

SilentGhost added the comment:

The degenerate behaviour appears ultimately due to the autojunk heuristic. 
Given that autojunk defaults to True and there isn't any way to change via most 
user-facing functions, I don't think there is an easy resolution that can be 
found here. I'm going to withdraw the earlier patch, since it feels like a 
half-measure which enable correct behaviour by accident.

--
nosy: +eli.bendersky, terry.reedy
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



[issue27709] difflib.HtmlDiff produces different output from difflib.ndiff

2016-08-08 Thread SilentGhost

Changes by SilentGhost :


Removed file: http://bugs.python.org/file44049/donttrim.diff

___
Python tracker 

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



[issue27380] IDLE: add base Query dialog with ttk widgets

2016-08-08 Thread Ned Deily

Ned Deily added the comment:

test_click_help_source fails on OS X:

==
FAIL: test_click_help_source (idlelib.idle_test.test_query.HelpsourceGuiTest)
--
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/idlelib/idle_test/test_query.py",
 line 389, in test_click_help_source
Equal(dialog.result, ('__test__', __file__))
AssertionError: Tuples differ: ('__test__', 
'file:///Library/Frameworks/Python.framewo[58 chars].py') != ('__test__', 
'/Library/Frameworks/Python.framework/Vers[51 chars].py')

First differing element 1:
'file:///Library/Frameworks/Python.framewo[57 chars]y.py'
'/Library/Frameworks/Python.framework/Vers[50 chars]y.py'

  ('__test__',
-  
'file:///Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/idlelib/idle_test/test_query.py')
?   ---

+  
'/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/idlelib/idle_test/test_query.py')

--
nosy: +ned.deily
resolution: fixed -> 
stage: resolved -> needs patch
status: closed -> open

___
Python tracker 

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



[issue27128] Add _PyObject_FastCall()

2016-08-08 Thread STINNER Victor

STINNER Victor added the comment:

I spent the last 3 months on making the CPython benchmark suite more stable and 
enhance my procedure to run benchmarks to ensure that benchmarks are more 
stable.

See my articles:
https://haypo-notes.readthedocs.io/microbenchmark.html#my-articles

I forked and enhanced the benchmark suite to use my perf module to run 
benchmarks in multiple processes:
https://hg.python.org/sandbox/benchmarks_perf

I ran this better benchmark suite on fastcall-2.patch on my laptop. The result 
is quite good: 

$ python3 -m perf compare_to ref.json fastcall.json -G  --min-speed=5
Slower (4):
- fastpickle/pickle_dict: 326 us +- 15 us -> 350 us +- 29 us: 1.07x slower
- regex_effbot: 49.4 ms +- 1.3 ms -> 53.0 ms +- 1.2 ms: 1.07x slower
- fastpickle/pickle: 432 us +- 8 us -> 457 us +- 10 us: 1.06x slower
- pybench.ComplexPythonFunctionCalls: 838 ns +- 11 ns -> 884 ns +- 8 ns: 1.05x 
slower

Faster (13):
- spectral_norm: 289 ms +- 6 ms -> 250 ms +- 5 ms: 1.16x faster
- pybench.SimpleIntFloatArithmetic: 622 ns +- 9 ns -> 559 ns +- 10 ns: 1.11x 
faster
- pybench.SimpleIntegerArithmetic: 621 ns +- 10 ns -> 560 ns +- 9 ns: 1.11x 
faster
- pybench.SimpleLongArithmetic: 891 ns +- 12 ns -> 816 ns +- 10 ns: 1.09x faster
- pybench.DictCreation: 852 ns +- 13 ns -> 788 ns +- 16 ns: 1.08x faster
- pybench.ForLoops: 10.8 ns +- 0.3 ns -> 9.99 ns +- 0.23 ns: 1.08x faster
- pybench.NormalClassAttribute: 1.85 us +- 0.02 us -> 1.72 us +- 0.04 us: 1.08x 
faster
- pybench.SpecialClassAttribute: 1.86 us +- 0.02 us -> 1.73 us +- 0.03 us: 
1.07x faster
- pybench.NestedForLoops: 21.9 ns +- 0.3 ns -> 20.7 ns +- 0.3 ns: 1.05x faster
- pybench.SimpleListManipulation: 501 ns +- 4 ns -> 476 ns +- 5 ns: 1.05x faster
- elementtree/process: 192 ms +- 3 ms -> 183 ms +- 2 ms: 1.05x faster
- elementtree/generate: 225 ms +- 5 ms -> 214 ms +- 4 ms: 1.05x faster
- hexiom2/level_25: 21.3 ms +- 0.3 ms -> 20.3 ms +- 0.1 ms: 1.05x faster

Benchmark hidden because not significant (84): (...)


Most benchmarks are not significant which is expected since fastcall-2.patch is 
really the most simple patch to start the work on "FASTCALL", it doesn't really 
implement any optimization, it only adds a new infrastructure to implement new 
optimizations.

A few benchmarks are faster (only benchmarks at least 5% faster are shown using 
--min-speed=5).

4 benchmarks are slower, but the slowdown should be temporarily: new 
optimizations should these benchmarks slower. See the issue #26814 for more a 
concrete implementation and a lot of benchmark results if you don't trust me :-)

I consider that benchmarks proved that there is no major slowdown, so 
fastcall-2.patch can be merged to be able to start working on real 
optimizations.

--

___
Python tracker 

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



[issue10910] pyport.h FreeBSD/Mac OS X "fix" causes errors in C++ compilation

2016-08-08 Thread Brett Cannon

Brett Cannon added the comment:

What do you think, Ned?

--
assignee: ronaldoussoren -> ned.deily
nosy: +benjamin.peterson, brett.cannon, georg.brandl, larry, ned.deily
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



[issue27714] some test_idle tests are not re-runnable, producing false failures with regrtest -w option

2016-08-08 Thread Ned Deily

New submission from Ned Deily:

If you run test_idle using the standard Python regression test runner, 
regrtest, and use regrtest's -w option (to re-run failure test verbosely) 
*without* using regrtest's -j option (to run tests in separate processes), any 
real test failure triggering a rerun will cause a number of additional false 
IDLE test case failures because some test cases modify global state in such a 
way as to be not re-runable.

An example: at the moment there is a real IDLE test case failure (see 
Issue27830).  If I run test_idle with both -w and -j options:

$ /usr/local/bin/python3.6 -m test -w -j2 -uall test_idle
Run tests in parallel using 2 child processes
0:00:01 [1/1/1] test_idle failed
can't invoke "event" command:  application has been destroyed
while executing
"event generate $w <>"
(procedure "ttk::ThemeChanged" line 6)
invoked from within
"ttk::ThemeChanged"
test test_idle failed -- Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/idlelib/idle_test/test_query.py",
 line 389, in test_click_help_source
Equal(dialog.result, ('__test__', __file__))
AssertionError: Tuples differ: ('__test__', 
'file:///Library/Frameworks/Python.framewo[58 chars].py') != ('__test__', 
'/Library/Frameworks/Python.framework/Vers[51 chars].py')

First differing element 1:
'file:///Library/Frameworks/Python.framewo[57 chars]y.py'
'/Library/Frameworks/Python.framework/Vers[50 chars]y.py'

  ('__test__',
-  
'file:///Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/idlelib/idle_test/test_query.py')
?   ---

+  
'/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/idlelib/idle_test/test_query.py')
1 test failed:
test_idle
Re-running failed tests in verbose mode
Re-running test 'test_idle' in verbose mode
test_autocomplete_event (idlelib.idle_test.test_autocomplete.AutoCompleteTest) 
... ok
test_delayed_open_completions 
(idlelib.idle_test.test_autocomplete.AutoCompleteTest) ... ok
[...]
test_shell_show (idlelib.idle_test.test_warning.ShellWarnTest) ... ok
test_showwarnings (idlelib.idle_test.test_warning.ShellWarnTest) ... ok

==
FAIL: test_click_help_source (idlelib.idle_test.test_query.HelpsourceGuiTest)
--
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/idlelib/idle_test/test_query.py",
 line 389, in test_click_help_source
Equal(dialog.result, ('__test__', __file__))
AssertionError: Tuples differ: ('__test__', 
'file:///Library/Frameworks/Python.framewo[58 chars].py') != ('__test__', 
'/Library/Frameworks/Python.framework/Vers[51 chars].py')

First differing element 1:
'file:///Library/Frameworks/Python.framewo[57 chars]y.py'
'/Library/Frameworks/Python.framework/Vers[50 chars]y.py'

  ('__test__',
-  
'file:///Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/idlelib/idle_test/test_query.py')
?   ---

+  
'/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/idlelib/idle_test/test_query.py')

--
Ran 219 tests in 0.977s

FAILED (failures=1)

only the 1 valid test case failure shows up.

But if I run test_idle with just -w (no -j) options:

$ /usr/local/bin/python3.6 -m test -w -uall test_idle
Run tests sequentially
0:00:00 [1/1] test_idle
can't invoke "event" command:  application has been destroyed
while executing
"event generate $w <>"
(procedure "ttk::ThemeChanged" line 6)
invoked from within
"ttk::ThemeChanged"
test test_idle failed -- Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/idlelib/idle_test/test_query.py",
 line 389, in test_click_help_source
Equal(dialog.result, ('__test__', __file__))
AssertionError: Tuples differ: ('__test__', 
'file:///Library/Frameworks/Python.framewo[58 chars].py') != ('__test__', 
'/Library/Frameworks/Python.framework/Vers[51 chars].py')

First differing element 1:
'file:///Library/Frameworks/Python.framewo[57 chars]y.py'
'/Library/Frameworks/Python.framework/Vers[50 chars]y.py'

  ('__test__',
-  
'file:///Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/idlelib/idle_test/test_query.py')
?   ---

+  
'/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/idlelib/idle_test/test_query.py')

test_idle failed
1 test failed:
test_idle
Re-running failed tests in verbose mode
Re-running test 'test_idle' in verbose mode
test_autocomplete_event (idlelib.idle_test.test_autocomplete.AutoCompleteTest) 
... ok
test_delayed_open_completions 
(idlelib.idle_test.test_autocomplete.AutoCompleteTest) ... ok
[...]
test_no_delete (idlelib.idle_test.test_text.TkTextTest) ... ok
test_init_modal (idlelib.idle_test.test_textview.TextViewTest) ... ERROR
test_init_nonmodal (idlelib.idle_test

[issue27574] Faster parsing keyword arguments

2016-08-08 Thread STINNER Victor

STINNER Victor added the comment:

See also the old issue #17170 "string method lookup is too slow".

--
nosy: +haypo

___
Python tracker 

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



[issue26988] Add AutoNumberedEnum to stdlib

2016-08-08 Thread Ethan Furman

Changes by Ethan Furman :


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



[issue23591] Add Flags and IntFlags

2016-08-08 Thread Ethan Furman

Ethan Furman added the comment:

Flags -> int-backed, but not ints; useful for pure Python flags
IntFlags -> ints (like IntEnum); useful for interfacing with other systems

Are there better names?

--
title: Add IntFlags -> Add Flags and IntFlags

___
Python tracker 

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



[issue27392] Add a server_side keyword parameter to create_connection

2016-08-08 Thread Yury Selivanov

Yury Selivanov added the comment:

Hm, I'm working on adding connect_accepted_socket to the uvloop.  There is one 
difference between connect_accepted_socket and 
create_server/create_unix_server:  the latter APIs forbid to pass boolean `ssl` 
argument, they require `ssl` to be an instance of `SSLContext`.

Should we have the same requirement for the 'ssl' argument of newly added 
'connect_accepted_socket'?

--

___
Python tracker 

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



[issue27392] Add a server_side keyword parameter to create_connection

2016-08-08 Thread Yury Selivanov

Yury Selivanov added the comment:

Also I think we should add a check, that the passed socket is AF_UNIX or 
AF_INET(6)

--

___
Python tracker 

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



[issue27392] Add a server_side keyword parameter to create_connection

2016-08-08 Thread Guido van Rossum

Guido van Rossum added the comment:

Oh, I see. create_connection(..., ssl=True) creates a default SSLContext,
but create_server(..., ssl=True) is invalid, it requires
ssl=SSLContext(...). I like the latter for connect_accepted_socket(). I
think Jim will happily comply.

What would happen if some other socket type was passed? Would anything go
wrong, assuming it's a socket type that understands connections? (I think
checking for SOCK_STREAM is more important maybe).

--

___
Python tracker 

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



[issue27392] Add a server_side keyword parameter to create_connection

2016-08-08 Thread Yury Selivanov

Yury Selivanov added the comment:

> What would happen if some other socket type was passed? Would anything go
wrong, assuming it's a socket type that understands connections? (I think
checking for SOCK_STREAM is more important maybe).

In uvloop I have to create different libuv handles for AF_UNIX and AF_INET.  I 
think I can only support those families.  Cheking for SOCK_STREAM is also 
important.

--

___
Python tracker 

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



[issue27392] Add a server_side keyword parameter to create_connection

2016-08-08 Thread Guido van Rossum

Guido van Rossum added the comment:

I think it's okay if uvloop only handles those socket types. But if asyncio
may be able to handle other types we shouldn't reject them just because we
haven't heard about them. (E.g. IIRC someone was using Bluetooth sockets.)

--

___
Python tracker 

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



[issue27682] Windows Error 10053, ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

2016-08-08 Thread Philip Lee

Philip Lee added the comment:

I use the following django view function also produce the same exception 

def sendFiles(request): 
fileName = request.GET['fileName']

pathToFile = os.path.join(filesDir, fileName)
response = FileResponse(open(pathToFile, 'rb'))

response['Content-Type'] = 'application/octet-stream'
response[
'Content-Disposition'] = 'attachment; fileName="{}"'.format(fileName)
response['Content-Length'] = os.path.getsize(pathToFile)
# HttpResponse(open(os.path.join(os.getcwd(), 'LYYDownloaderServer.log'), 
'r'), content_type='text/plain')
return response

Tested with sending file Git-2.8.4-32-bit.exe (29.8MB), if tested with sending 
file GitHubSetup.exe(670kb),then no exception occurred.

the exception like the following 

return self._sock.send(b)
ConnectionAbortedError: [WinError 10053] 您的主机中的软件中止了一个已建立的连接
。
[09/Aug/2016 10:30:13] "GET /FileHost/?fileName=Git-2.8.4-32-bit.exe HTTP/1.1" 5
00 59

Exception happened during processing of request from ('127.0.0.1', 62237)
Traceback (most recent call last):
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 138, in run
self.finish_response()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 180, in finish_response
self.write(data)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 274, in write
self.send_headers()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 332, in send_headers
self.send_preamble()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 255, in send_preamble
('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 453, in _write
result = self.stdout.write(data)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\socket.py", lin
e 593, in write
return self._sock.send(b)
ConnectionAbortedError: [WinError 10053] 您的主机中的软件中止了一个已建立的连接
。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 141, in run
self.handle_error()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\site-packages\d
jango\core\servers\basehttp.py", line 92, in handle_error
super(ServerHandler, self).handle_error()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 368, in handle_error
self.finish_response()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 180, in finish_response
self.write(data)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 274, in write
self.send_headers()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 331, in send_headers
if not self.origin_server or self.client_is_modern():
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 344, in client_is_modern
return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\socketserver.py
", line 625, in process_request_thread
self.finish_request(request, client_address)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\socketserver.py
", line 354, in finish_request
self.RequestHandlerClass(request, client_address, self)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\site-packages\d
jango\core\servers\basehttp.py", line 99, in __init__
super(WSGIRequestHandler, self).__init__(*args, **kwargs)
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\socketserver.py
", line 681, in __init__
self.handle()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\site-packages\d
jango\core\servers\basehttp.py", line 179, in handle
handler.run(self.server.get_app())
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 144, in run
self.close()
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\simple_
server.py", line 36, in close
self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'

[09/Aug/2016 10:30:13] "GET /FileHost/?fileName=Git-2.8.4-32-bit.exe HTTP/1.1" 2
00 8192
Traceback (most recent call last):
  File "C:\Users\i\AppData\Local\Programs\Python\Python35-32\lib\wsgiref\handler
s.py", line 138, in run
self.finish_response()
  

[issue27715] call-matcher breaks if a method is mocked with spec=True

2016-08-08 Thread Carl Meyer

New submission from Carl Meyer:

When constructing call-matchers to match expected vs actual calls, if 
`spec=True` was used when patching a function, mock attempts to bind the 
recorded (and expected) call args to the function signature. But if a method 
was mocked, the signature includes `self` and the recorded call args don't. 
This can easily lead to a `TypeError`:

```
from unittest.mock import patch

class Foo:
def bar(self, x):
return x

with patch.object(Foo, 'bar', spec=True) as mock_bar:
f = Foo()
f.bar(7)

mock_bar.assert_called_once_with(7)

```

The above code worked in mock 1.0, but fails in Python 3.5 and 3.6 tip with 
this error:

```
TypeError: missing a required argument: 'x'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "../mock-method.example.py", line 11, in 
mock_bar.assert_called_once_with(7)
  File "/home/carljm/projects/python/cpython/Lib/unittest/mock.py", line 203, 
in assert_called_once_with
return mock.assert_called_once_with(*args, **kwargs)
  File "/home/carljm/projects/python/cpython/Lib/unittest/mock.py", line 822, 
in assert_called_once_with
return self.assert_called_with(*args, **kwargs)
  File "/home/carljm/projects/python/cpython/Lib/unittest/mock.py", line 811, 
in assert_called_with
raise AssertionError(_error_message()) from cause
AssertionError: Expected call: bar(7)
Actual call: bar(<__main__.Foo object at 0x7fdca80b7550>, 7)
```
```

If you try to pass in the instance as an expected call arg, the error goes away 
but it just fails to match:

```
AssertionError: Expected call: bar(<__main__.Foo object at 0x7f5cbab35fd0>, 7)
Actual call: bar(7)
```

So AFAICT there is no way to successfully use `spec=True` when patching a 
method of a class.

Oddly, using `autospec=True` instead of `spec=True` _does_ record the instance 
as an argument in the recorded call args, meaning that you have to pass it in 
as an argument to e.g. `assert_called_with`. But in many (most?) cases where 
you're patching a method of a class, your test doesn't have access to the 
instance, elsewise you'd likely just patch the instance instead of the class in 
the first place.

I don't see a good reason why `autospec=True` and `spec=True` should differ in 
this way (if both options are needed, there should be a separate flag to 
control that behavior; it doesn't seem related to the documented differences 
between autospec and spec). I do think a) there needs to be some way to record 
call args to a method and assert against those call args without needing the 
instance (or resorting to manual assertions against a sliced `call_args`), and 
b) there should be some way to successfully use `spec=True` when patching a 
method of a class.

--
components: Library (Lib)
files: mock-method.example.py
messages: 272209
nosy: carljm
priority: normal
severity: normal
status: open
title: call-matcher breaks if a method is mocked with spec=True
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file44054/mock-method.example.py

___
Python tracker 

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



[issue27715] call-matcher breaks if a method is mocked with spec=True

2016-08-08 Thread Carl Meyer

Carl Meyer added the comment:

(This bug is also present in Python 3.4.4.)

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



[issue27715] call-matcher breaks if a method is mocked with spec=True

2016-08-08 Thread Carl Meyer

Carl Meyer added the comment:

It seems likely that this regression originated with 
https://hg.python.org/cpython/rev/b888c9043566/ (can't confirm via bisection as 
the commits around that time fail to compile for me).

--
nosy: +michael.foord, pitrou

___
Python tracker 

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



[issue27715] call-matcher breaks if a method is mocked with spec=True

2016-08-08 Thread Carl Meyer

Changes by Carl Meyer :


Removed file: http://bugs.python.org/file44054/mock-method.example.py

___
Python tracker 

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



[issue27715] call-matcher breaks if a method is mocked with spec=True

2016-08-08 Thread Carl Meyer

Carl Meyer added the comment:

`hg clean --all` resolved the compilation issues; confirmed that 
https://hg.python.org/cpython/rev/b888c9043566/ is at fault.

Also, the exception trace I provided above looks wrong; it must be from when I 
was messing about with `autospec=True` or passing in the instance. The actual 
trace from the sample code in the original report  has no mention of the 
instance:

```
TypeError: missing a required argument: 'x'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "../mock-method.example.py", line 11, in 
mock_bar.assert_called_once_with(7)
  File "/home/carljm/projects/python/cpython/Lib/unittest/mock.py", line 822, 
in assert_called_once_with
return self.assert_called_with(*args, **kwargs)
  File "/home/carljm/projects/python/cpython/Lib/unittest/mock.py", line 811, 
in assert_called_with
raise AssertionError(_error_message()) from cause
AssertionError: Expected call: bar(7)
Actual call: bar(7)

```

--

___
Python tracker 

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



[issue27703] Replace two Py_XDECREFs with Py_DECREFs in do_raise

2016-08-08 Thread Antti Haapala

Antti Haapala added the comment:

No, I was just trying to explain why your change could be considered beneficial.

--

___
Python tracker 

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



[issue27701] [posixmodule] [Refactoring patch] Simply call into *at() functions unconditionally when present

2016-08-08 Thread Alex Willmer

Changes by Alex Willmer :


--
nosy: +Alex.Willmer

___
Python tracker 

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



[issue27181] Add geometric mean to `statistics` module

2016-08-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9eb5edfcf604 by Steven D'Aprano in branch 'default':
Issue27181 add geometric mean.
https://hg.python.org/cpython/rev/9eb5edfcf604

--
nosy: +python-dev

___
Python tracker 

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



[issue26750] Mock autospec does not work with subclasses of property()

2016-08-08 Thread Gregory P. Smith

Gregory P. Smith added the comment:

Probably just Amaury and I forgetting that existed.  Amaury, 
inspect.isdatadescriptor's implementation is a bit different than this change's 
_is_data_descriptor.  Thoughts?

--
stage: resolved -> commit review

___
Python tracker 

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



[issue27380] IDLE: add base Query dialog with ttk widgets

2016-08-08 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The Mac failure comes from this piece of code:

if sys.platform == 'darwin':
path = self.result[1]
if path.startswith(('www', 'file:', 'http:', https:')):
pass
else:
# Mac Safari insists on using the URI form for local files
self.result = list(self.result)
self.result[1] = "file://" + path

Before I do anything,
is the comment right about needing to add "file://" for Safari?
is Safari still the default and/or correct way to open a local file?

The code that opens the supplementary help file or url is elsewhere, but it 
could be changed if outdated on the Mac.

--

___
Python tracker 

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



[issue27181] Add geometric mean to `statistics` module

2016-08-08 Thread Ram Rachum

Ram Rachum added the comment:

Thanks for the patch Steven! I won't comment about the code because I don't 
know enough about these algorithms, but I'm thinking, since you also did a 
refactoring of the statistics module, maybe these should be two separate 
patches/commits so it'll be easy to see which part is the new feature and which 
part is moving existing code around?

--

___
Python tracker 

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



[issue27181] Add geometric mean to `statistics` module

2016-08-08 Thread Ram Rachum

Ram Rachum added the comment:

Also... I like the detailed docstrings with the real-life examples! That stuff 
helps when coding and using an unfamiliar function (since I see the docs in a 
panel of my IDE), so I wish I'd see more detailed docstrings like these ones in 
the standard library. For `geometric_mean`, maybe I'd add one sentence that 
describes how the geometric mean is calculated.

--

___
Python tracker 

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