[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-17 Thread STINNER Victor

STINNER Victor added the comment:

Patch version 3:

* pattern_hash() includes isbytes, I also shifted flags by 1 bit to not erase 
the isbytes bit (FYI maximum value of flags is 256)
* pattern_richcompare() avoids calling PyObject_RichCompareBool() if flags or 
isbytes is different
* unit test ensures that no BytesWarning warning is raised
* checks hash() in unit tests
* fix also the unit test with a different flag (use the same pattern)
* document also in the unit test that the comparison is case sensitive

--
Added file: http://bugs.python.org/file45528/pattern_compare-3.patch

___
Python tracker 

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



[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Your plan LGTM.

--

___
Python tracker 

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



[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread STINNER Victor

STINNER Victor added the comment:

Ok, let me propose a plan for 3.5, 3.6 and 3.7:

* Remove warnings.filters test on Python 3.5 from regrtest
* Implement comparison for SRE_Pattern in Python 3.6 and 3.7: issue #28727

I consider that the issue #28727 is a minor enhancement and so is still good 
for Python 3.6.

So we avoid the ugly *warnings_key.patch*.

Reminder: this issue only occurs in the Python test suite which explicitly 
reloads modules. It should not occur in the wild.

--

___
Python tracker 

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



[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread STINNER Victor

STINNER Victor added the comment:

> The key is based on (action, message, category, module). I think you should 
> add item[4] (lineno).

Oops, right!

--

___
Python tracker 

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



[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread Martin Panter

Martin Panter added the comment:

I didn’t really like adding the _add_filter() special handling in the first 
place, but I went ahead because I couldn’t think of a better way to avoid the 
problem with reloading the warnings modules. So unless anyone can suggest 
anything better, I am okay with your patch (even if you dislike it :).

+return (item[0], _pattern_key(item[1]), item[2], _pattern_key(item[3]))

The key is based on (action, message, category, module). I think you should add 
item[4] (lineno).

--

___
Python tracker 

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



[issue28159] Deprecate isdst argument in email.utils.localtime

2016-11-17 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Hi Alexander,

Is the idea here to raise deprecation warning starting in 3.6 and remove it by 
3.8?

Thanks :)

--
nosy: +Mariatta

___
Python tracker 

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



[issue28730] __reduce__ not being called in dervied extension class from datetime.datetime

2016-11-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

That is because some datetime classes now define __reduce_ex__ instead of 
__reduce__ (see issue24773). It has higher priority.

--
nosy: +belopolsky, serhiy.storchaka

___
Python tracker 

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



[issue24764] cgi.FieldStorage can't parse multipart part headers with Content-Length and no filename in Content-Disposition

2016-11-17 Thread Bert JW Regeer

Bert JW Regeer added the comment:

I've uploaded a patchset to bug #2 that fixes this issue by fixing 
make_file, and doesn't cause Python to throw out the content-length information.

It also fixes FieldStorage for when you provide it a non-multipart form 
submission and there is no list in FS.

Please see http://bugs.python.org/issue2

--
nosy: +X-Istence

___
Python tracker 

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



[issue27777] cgi.FieldStorage can't parse simple body with Content-Length and no Content-Disposition

2016-11-17 Thread Bert JW Regeer

Bert JW Regeer added the comment:

@berker.peksag:

Attached is a patch with a test case that exercises this issue.

Code path is that read_single() checks if the length is greater than 0, and 
then it reads binary, otherwise it reads it as a single line. This fixes 
make_file so that if self.length is greater than or equal to 0, it opens the 
file in binary mode, this matches the checks that write stuff as binary.

This also undoes the change that was made in 
https://bugs.python.org/issue24764. Fixing this issue fixed that one as well, 
and arguably throwing data away doesn't seem like a good idea.

--
keywords: +patch
Added file: http://bugs.python.org/file45527/bug2.patch

___
Python tracker 

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



[issue20572] subprocess.Popen.wait() undocumented "endtime" parameter

2016-11-17 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

1. So, is it ok to remove the endtime parameter now?
2. Can the attached downloadfile.htm be removed? It's a spam.

Thanks :)

--
nosy: +Mariatta

___
Python tracker 

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



[issue28723] tkinter, radiobutton, indicatoron=0 has no effect.

2016-11-17 Thread Simon Holland

Simon Holland added the comment:

FYI, it seems that the Tk team are unable to use cocoa for this
functionality so indicatoron has not worked on OSX for Radiobuttons or
Checkbuttons for over 4 years.

On 17 November 2016 at 18:21, Simon Holland  wrote:

>
> Simon Holland added the comment:
>
> Thank you
>
> On 17 November 2016 at 15:29, Serhiy Storchaka 
> wrote:
>
> >
> > Serhiy Storchaka added the comment:
> >
> > Works to me on Linux (identical results with Tkinter and Tk). In any case
> > if there is some bug on your platform, this is not Tkinter bug, but Tk
> bug.
> > Tkinter doesn't handle this option specially, it just pass it to Tk.
> File a
> > bug on Tk bugtracker: http://core.tcl.tk/tk/ticket .
> >
> > --
> > resolution:  -> third party
> > stage:  -> resolved
> > status: open -> closed
> >
> > ___
> > Python tracker 
> > 
> > ___
> >
>
> --
>
> Simon Holland BA Hons
> Medan, Indonesia
> 
> Mobile : +62 81 26055297
> Fax : +62 81 6613280
>
>  [image: Twitter]  [image: LinkedIn]
>  [image: YouTube]
>  [image: Google Talk]
> 
>
> --
>
> ___
> Python tracker 
> 
> ___
>

-- 

Simon Holland BA Hons
Medan, Indonesia

Mobile : +62 81 26055297
Fax : +62 81 6613280

 [image: Twitter]  [image: LinkedIn]
 [image: YouTube]
 [image: Google Talk]


--

___
Python tracker 

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



[issue28728] test_host_resolution in test_socket fails on duplicate assert

2016-11-17 Thread R. David Murray

R. David Murray added the comment:

It might be interesting to stick a 'with subtest' in there and see which 
address is failing to raise.

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



[issue28728] test_host_resolution in test_socket fails on duplicate assert

2016-11-17 Thread Martin Panter

Martin Panter added the comment:

That’s not exactly a duplicate; one is host-by-NAME, the other host-by-ADDR

--
nosy: +martin.panter

___
Python tracker 

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



[issue28730] __reduce__ not being called in dervied extension class from datetime.datetime

2016-11-17 Thread Jeff Reback

New submission from Jeff Reback:

xref to https://github.com/pandas-dev/pandas/issues/14679.

pandas has had a cython extension class to datetime.datetime for quite some 
time. A simple __reduce__ is defined.

def __reduce__(self):
object_state = self.value, self.freq, self.tzinfo
print(object_state)
return (Timestamp, object_state)

In 3.5.2:

Python 3.5.2 |Continuum Analytics, Inc.| (default, Jul  2 2016, 17:52:12) 
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as pd
>>> import pickle
>>> pickle.dumps(pd.Timestamp('20130101'))
(13569984000, None, None)
b'\x80\x03cpandas.tslib\nTimestamp\nq\x00\x8a\x08\x00\x00\xc6\xe8\xda\x06\xd5\x12NN\x87q\x01Rq\x02.'

But in 3.6.03b

Python 3.6.0b3 | packaged by conda-forge | (default, Nov  2 2016, 03:28:12) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.54)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as pd
>>> import pickle
>>> pickle.dumps(pd.Timestamp('20130101'))
b'\x80\x03cpandas.tslib\nTimestamp\nq\x00C\n\x07\xdd\x01\x01\x00\x00\x00\x00\x00\x00q\x01\x85q\x02Rq\x03.'


So it appears __reduce__ is no longer called at all (I tried defining 
__getstate__, __getnewargs__ as well, but to no avail). Instead it looks like 
datetime.datetime.__reduce__ (well a c function is actually called).

Link to the codebase. 
https://github.com/pandas-dev/pandas/blob/master/pandas/tslib.pyx#L490

--
components: IO
messages: 281070
nosy: Jeff Reback
priority: normal
severity: normal
status: open
title: __reduce__ not being called in dervied extension class from 
datetime.datetime
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



[issue28729] Exception from sqlite3 adapter masked by sqlite3.InterfaceError

2016-11-17 Thread Julien Palard

Julien Palard added the comment:

I missed an occurrence of this "if/else" block, and by changing it, a lot of 
tests are failing, typically:

```==
ERROR: CheckBlob (sqlite3.test.types.SqliteTypeTests)
--
Traceback (most recent call last):
  File "/home/mdk/cpython/Lib/sqlite3/test/types.py", line 72, in CheckBlob
self.cur.execute("insert into test(b) values (?)", (val,))
sqlite3.InterfaceError: Problem in adapter

```

So this "if/else" giving back the unadapted parameter even when need_adapt is 
true is necessary, we'll have to understand why and how we can properly detect 
an adapter failure.

--

___
Python tracker 

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



[issue28729] Exception from sqlite3 adapter masked by sqlite3.InterfaceError

2016-11-17 Thread Julien Palard

Julien Palard added the comment:

Problems looks from `Modules/_sqlite/statement.c`:

```
if (!_need_adapt(current_param)) {
adapted = current_param;
} else {
adapted = pysqlite_microprotocols_adapt(current_param, 
(PyObject*)_PrepareProtocolType, NULL);
if (adapted) {
Py_DECREF(current_param);
} else {
PyErr_Clear();
adapted = current_param;
}
}
```

It has not changed since 2006, since e200ab5b3e (backport from pysqlite2 SVN 
repository).

I read it as "If an parameter needs an adapter, and the adapter fails, that's 
OK, continue with the original (unadapted) parameter.", which looks wrong to 
me, but I may miss something obvious? I tried to set an error instead of 
restoring the `current_param` and the 261 tests went well, but I'm not yet 
aware of the coverage of adapters in tests.

--
nosy: +mdk

___
Python tracker 

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



[issue28673] When using pyro4 with more than 15 threads, python 2.7.12 cores frequently

2016-11-17 Thread Michael Hu

Michael Hu added the comment:

Could you please look into the core (attached into this bug) to figure out? 
This issue does not happen always. We are tight on resource to reproduce this.

--

___
Python tracker 

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



[issue28729] Exception from sqlite3 adapter masked by sqlite3.InterfaceError

2016-11-17 Thread Peter Inglesby

New submission from Peter Inglesby:

The following code raises `sqlite3.InterfaceError: Error binding parameter 0 - 
probably unsupported type.` when I would expect it to raise `AssertionError: 
Problem in adapter`.


import sqlite3

class Point:
def __init__(self, x, y):
self.x, self.y = x, y

def adapt_point(point):
assert False, 'Problem in adapter'

sqlite3.register_adapter(Point, adapt_point)

con = sqlite3.connect(":memory:")
cur = con.cursor()

p = Point(4.0, -3.2)
cur.execute("select ?", (p,))

--
messages: 281066
nosy: inglesp
priority: normal
severity: normal
status: open
title: Exception from sqlite3 adapter masked by sqlite3.InterfaceError
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue28724] Add method send_io, recv_io to the socket module.

2016-11-17 Thread Julien Palard

Julien Palard added the comment:

Hi, thanks for your contribution!

Documentation give examples implementation of your methods:

 - https://docs.python.org/3/library/socket.html#socket.socket.sendmsg 
 - https://docs.python.org/3/library/socket.html#socket.socket.recvmsg

and from here, some remarks:

 - Why allowing people to mix fds and file objects? I'm not a fan of this: I 
prefer the clarity of allowing only file descriptors. Have you seen such 
methods (allowing both fd and file obj) in the stdlib?
 - The documented implementation for recv_io checks for integer truncation, 
there may be a good reason, should'n you do the same?
 - The documented implementation allows to pass a message, shouldn't you at 
least allow for an optional message to be passed?

Adding those methods may make sense if people are copying send_fds/recv_fds in 
their code, but I found only two copy/paste in github, so I think the best is 
to put your code as a module on pypi and see, from here, if it gets popular?

You should also write a few tests, and comply to the PEP8 (your two methods 
should probably be separated by a newline).

Bests

--
nosy: +mdk

___
Python tracker 

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



[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-11-17 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file45526/update_one_slot2-2.7.patch

___
Python tracker 

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



[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2016-11-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here are updated patches with tests for 3.x and 2.7.

--
components: +Interpreter Core
nosy: +serhiy.storchaka
stage:  -> patch review
versions: +Python 2.7, Python 3.5, Python 3.6, Python 3.7 -Python 2.6
Added file: http://bugs.python.org/file45525/update_one_slot2-3.x.patch

___
Python tracker 

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



[issue28684] [asyncio] bind() on a unix socket raises PermissionError on Android for a non-root user

2016-11-17 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy:  -giampaolo.rodola

___
Python tracker 

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



[issue28684] [asyncio] bind() on a unix socket raises PermissionError on Android for a non-root user

2016-11-17 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-17 Thread Matthew Barnett

Matthew Barnett added the comment:

I hope you make it clear what you mean by 'equal', i.e. that it's comparing the 
pattern and the flags (AFAICT), so re.compile('(?x)a') != re.compile('(?x) a ').

--

___
Python tracker 

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



[issue25008] Deprecate smtpd (based on deprecated asyncore/asynchat): write a new smtp server with asyncio

2016-11-17 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue25002] Deprecate asyncore/asynchat

2016-11-17 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-17 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Regular Expressions
nosy: +ezio.melotti, mrabarnett

___
Python tracker 

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



[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Added comments on Rietveld.

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

___
Python tracker 

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



[issue28728] test_host_resolution in test_socket fails on duplicate assert

2016-11-17 Thread SilentGhost

New submission from SilentGhost:

Commit 540a9c69c2ea introduced double assertRaises which now is failing on 
ubuntu 16.10

If it is necessary, then it's not obvious why and there is no comment, but here 
is the one-line patch that removes the duplicated line and makes the test pass 
for me.

--
components: Tests
files: test_socket.diff
keywords: patch
messages: 281061
nosy: SilentGhost, neologix
priority: normal
severity: normal
stage: patch review
status: open
title: test_host_resolution in test_socket fails on duplicate assert
type: behavior
versions: Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45524/test_socket.diff

___
Python tracker 

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



[issue28699] Imap from ThreadPool behaves unexpectedly

2016-11-17 Thread Xiang Zhang

Xiang Zhang added the comment:

> Your patch looks to be introducing a number of changes to the structure of 
> the data being passed around between threads and even monitored/indirectly 
> shared across processes. 

That's why I say even myself don't like it. To solve an edge case some long 
introduced codes have to been changed. Sigh.

> Under relevant conditions, check both _items and _unsorted (not only _items) 
> before declaring that we truly have all results in.

I think you mean your patch. But how does it solve the reentrant problem? Yeah, 
actually it's not reentrant. If the problematic job is not the first job with 
id 0, then the exception won't be set.

With your patch, repeatedly execute print(list(pool.imap(str, gen(. Only 
the first time there is an exception.

--

___
Python tracker 

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



[issue28699] Imap from ThreadPool behaves unexpectedly

2016-11-17 Thread Davin Potts

Davin Potts added the comment:

@xiang.zhang: Your patch looks to be introducing a number of changes to the 
structure of the data being passed around between threads and even 
monitored/indirectly shared across processes.  It's looking increasingly high 
risk to me.

We already have logic for handling exceptions arising during jobs but the one 
situation overlooked in this logic is if the exception occurs "quickly in an 
unfortunate order", meaning the exception is encountered and reported before 
any of the other individual tasks can complete and respond with a result.  This 
oversight of logic can be addressed a couple of ways:
1.  Add a flag to our IMapIterator to indicate when any exception is 
encountered.
2.  Modify the tuples / data structures being maintained across IMapIterator's 
_cache, _items, _unsorted, _index, and _length.
3.  Under relevant conditions, check both _items and _unsorted (not only 
_items) before declaring that we truly have all results in.

I regard option 1 as being potentially a bit fragile and option 2 as 
introducing non-trivial complexity and risk.  With option 3, there's 
effectively no risk and no measurable cost getting to the truth of what has 
actually happened.

--

___
Python tracker 

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



[issue28708] Low FD_SETSIZE limit on Windows

2016-11-17 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> To implement an efficient event loop, IOCP is the way to do: the asyncio 
> module supports it using ProactorEventLoop.

Not everyone uses asyncio, though, so it would still be nice to see the 
select() limit raised anyway.

Implementing your own event loop using IOCP is a hard exercise, much harder 
than getting something to work with select().

--
nosy: +pitrou

___
Python tracker 

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



[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-17 Thread STINNER Victor

STINNER Victor added the comment:

> Ten subtest in test_re fail with: TypeError: unhashable type: 
> '_sre.SRE_Pattern'

Oops, right. Updated patch implements also hash() on patterns.

--
Added file: http://bugs.python.org/file45523/pattern_compare-2.patch

___
Python tracker 

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



[issue28699] Imap from ThreadPool behaves unexpectedly

2016-11-17 Thread Xiang Zhang

Xiang Zhang added the comment:

Here is a patch which is just a try. I don't quite like the implementation but 
I can not figure out a better solution. The examples in this one and #28696 
seems to work and no test fails currently.

--
Added file: http://bugs.python.org/file45522/issue28699_try.patch

___
Python tracker 

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



[issue28725] Awaiting an awaitable returned from an async function does nothing

2016-11-17 Thread Yury Selivanov

Yury Selivanov added the comment:

This isn't a bug.  Python doesn't magically unwind awaitables, you have to do 
that yourself:

  async def two():
  await (await one())

Broadly speaking, returning awaitables from coroutines is an anti-pattern.

Closing this one. Feel free to re-open or ask questions :)

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



[issue28726] py.exe launches wrong version

2016-11-17 Thread Pravic Ehysta

Pravic Ehysta added the comment:

Well, I deleted outdated registry keys, now it works fine.

Thanks for helping and I am going to close this issue since it isn't a bug.

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

___
Python tracker 

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



[issue28726] py.exe launches wrong version

2016-11-17 Thread Steve Dower

Steve Dower added the comment:

Were Python 3.5 and 3.4 installed into the same location? That would explain 
some of the problems. It looks like it's finding it from the 3.4 key and then 
skipping the 3.5 key because the path is the same - hence "py -3.5" doesn't 
find it.

Also, we apparently are lacking some Unicode support in the launcher :)

If you delete all of the PythonCore keys and run repair installs for the 
versions of Python you want, that will restore the ones you need. Our installer 
deliberately does not remove anything in site-packages (except for pip, and 
only if it were installed by our installer).

--

___
Python tracker 

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



[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-17 Thread SilentGhost

SilentGhost added the comment:

Ten subtest in test_re fail with

TypeError: unhashable type: '_sre.SRE_Pattern'

--
nosy: +SilentGhost

___
Python tracker 

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



[issue28726] py.exe launches wrong version

2016-11-17 Thread Pravic Ehysta

Pravic Ehysta added the comment:

d:\>py -3.5
launcher build: 32bit
launcher executable: Console
File 'C:\Users\owle\AppData\Local\py.ini' non-existent
File 'C:\Windows\py.ini' non-existent
Called with command line: -3.5
locating Pythons in 64bit registry
locate_pythons_for_key: D:\perl\python\278\python.exe is a 32bit executable
locate_pythons_for_key: D:\perl\python\278\PCBuild\win32\python.exe: ??? ?? 
??? ? ? .
locate_pythons_for_key: D:\perl\python\278\PCBuild\amd64\python.exe: ??? ?? 
??? ? ? .
locate_pythons_for_key: D:\perl\python\278\PCBuild\python.exe: ??? ?? 
??? ? ? .
HKCU\SOFTWARE\Python\PythonCore\3.4\InstallPath: ?? ??? ? ? 
.
HKLM\SOFTWARE\Python\PythonCore\2.7\InstallPath: ?? ??? ? ? 
.
locate_pythons_for_key: D:\perl\python\3\python.exe is a 64bit executable
locate_pythons_for_key: D:\perl\python\3\PCBuild\win32\python.exe: ??? ?? 
??? ? ? .
locate_pythons_for_key: D:\perl\python\3\PCBuild\amd64\python.exe: ??? ?? 
??? ? ? .
locate_pythons_for_key: D:\perl\python\3\PCBuild\python.exe: ??? ?? ??? 
? ? .
locate_pythons_for_key: D:\Perl\python\3\python.exe: already found
locate_pythons_for_key: D:\Perl\python\3\PCBuild\win32\python.exe: ??? ?? 
??? ? ? .
locate_pythons_for_key: D:\Perl\python\3\PCBuild\amd64\python.exe: ??? ?? 
??? ? ? .
locate_pythons_for_key: D:\Perl\python\3\PCBuild\python.exe: ??? ?? ??? 
? ? .
locating Pythons in native registry
locate_pythons_for_key: D:\perl\python\278\python.exe: already found
locate_pythons_for_key: D:\perl\python\278\PCBuild\win32\python.exe: ??? ?? 
??? ? ? .
locate_pythons_for_key: D:\perl\python\278\PCBuild\amd64\python.exe: ??? ?? 
??? ? ? .
locate_pythons_for_key: D:\perl\python\278\PCBuild\python.exe: ??? ?? 
??? ? ? .
HKCU\SOFTWARE\Python\PythonCore\3.4\InstallPath: ?? ??? ? ? 
.
locate_pythons_for_key: D:\perl\python\2\python.exe is a 32bit executable
locate_pythons_for_key: D:\perl\python\2\PCBuild\win32\python.exe: ??? ?? 
??? ? ? .
locate_pythons_for_key: D:\perl\python\2\PCBuild\amd64\python.exe: ??? ?? 
??? ? ? .
locate_pythons_for_key: D:\perl\python\2\PCBuild\python.exe: ??? ?? ??? 
? ? .
HKLM\SOFTWARE\Python\PythonCore\3.4\InstallPath: ?? ??? ? ? 
.
search for Python version '3.5' found no interpreter
Requested Python version (3.5) not installed


It seems, there are old registry keys which were not deleted by installer. 

HKEY_CURRENT_USER\Software\Python\PythonCore - contains 2.7 and invalid 3.4 
(with "modules" subkey only)

HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore - contains 2.7 (modules only), 
3.4 and 3.5.

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore - contains 2.7 and 
3.4 (modules only).

Quiet messy. How can I clean my registry without reinstalling site packages?

--

___
Python tracker 

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



[issue26941] android: test_threading hangs on armv7

2016-11-17 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
stage: patch review -> commit review

___
Python tracker 

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



[issue26940] android: test_importlib hangs on armv7

2016-11-17 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
stage: patch review -> commit review

___
Python tracker 

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



[issue26939] android: test_functools hangs on armv7

2016-11-17 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
stage: patch review -> commit review

___
Python tracker 

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



[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread STINNER Victor

STINNER Victor added the comment:

FYI Python 2.7 is not impacted by this bug because it seems like reimporting 
warnings.py twice gets a new fresh list from _warnings.filters. I don't 
undertand how/why.

--
versions: +Python 3.5, Python 3.6

___
Python tracker 

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



[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread STINNER Victor

STINNER Victor added the comment:

> * Fix warnings._add_filter() to implement a custom comparator operator for 
> regular expression objects: compare pattern and flags

Attached patch warnings_key.patch implements this. I really dislike the patch 
:-(

--
keywords: +patch
Added file: http://bugs.python.org/file45521/warnings_key.patch

___
Python tracker 

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



[issue28726] py.exe launches wrong version

2016-11-17 Thread Steve Dower

Steve Dower added the comment:

Can you do "set PYLAUNCH_DEBUG=1" and then run "py -3.4" again and paste the 
full output?

Also, is there anything unusual about how you installed Python? Did you 
customize any settings?

--

___
Python tracker 

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



[issue28726] py.exe launches wrong version

2016-11-17 Thread Pravic Ehysta

New submission from Pravic Ehysta:

d:\>py -3.5
Requested Python version (3.5) not installed

d:\>py -3.3
Requested Python version (3.3) not installed

d:\>py -3.4
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> ^Z

--
components: Windows
messages: 281045
nosy: Pravic Ehysta, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: py.exe launches wrong version
type: behavior
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



[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-17 Thread Eryk Sun

Eryk Sun added the comment:

Thanks, Serihy. When I looked at this previously, I mistakenly assumed that any 
undefined codes would be decoded using the codepage's default Unicode 
character. But for single-byte codepages in the range above 0x9F, Windows 
instead maps undefined codes to the Private Use Area (PUA). For example, using 
decode() from above:

ERROR_NO_UNICODE_TRANSLATION = 0x0459
codepages = 857, 864, 874, 1253, 1255, 1257
for cp in codepages:
undefined = []
for i in range(256):
b = bytes([i])
try:
decode(cp, b)
except OSError as e:
if e.winerror == ERROR_NO_UNICODE_TRANSLATION:
c = decode(cp, b, False)
undefined.append('{:02x}=>{:04x}'.format(ord(b), ord(c)))
print(cp, *undefined, sep=', ')

output:

857, d5=>f8bb, e7=>f8bc, f2=>f8bd
864, a6=>f8be, a7=>f8bf, ff=>f8c0
874, db=>f8c1, dc=>f8c2, dd=>f8c3, de=>f8c4, fc=>f8c5, fd=>f8c6, 
fe=>f8c7, ff=>f8c8
1253, aa=>f8f9, d2=>f8fa, ff=>f8fb
1255, d9=>f88d, da=>f88e, db=>f88f, dc=>f890, dd=>f891, de=>f892, 
df=>f893, fb=>f894, fc=>f895, ff=>f896
1257, a1=>f8fc, a5=>f8fd

Do you think Python's 'replace' handler should prevent adding the 
MB_ERR_INVALID_CHARS flag for PyUnicode_DecodeCodePageStateful? One benefit is 
that the PUA code can be encoded back to the original byte value:

>>> codecs.code_page_encode(1257, '\uf8fd')
(b'\xa5', 1)

> cp932: 0xA0, 0xFD, 0xFE, 0xFF are errors instead of mapping to U+F8F0-U+F8F3.

Windows maps these byte values to PUA codes if the MB_ERR_INVALID_CHARS flag 
isn't used:

>>> decode(932, b'\xa0\xfd\xfe\xff', False)
'\uf8f0\uf8f1\uf8f2\uf8f3'

--

___
Python tracker 

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



[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread STINNER Victor

STINNER Victor added the comment:

> * Implement comparision in _sre.SRE_Pattern

I wrote a patch and opened the issue #28727: "Implement comparison (x==y and 
x!=y) for _sre.SRE_Pattern".

--

___
Python tracker 

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



[issue28727] Implement comparison (x==y and x!=y) for _sre.SRE_Pattern

2016-11-17 Thread STINNER Victor

New submission from STINNER Victor:

Attached patch implements rich comparison for _sre.SRE_Pattern objects created 
by re.compile().

Comparison between patterns is used in the warnings module to not add 
duplicated filters, see issue #18383:

New changeset f57f4e33ba5e by Martin Panter in branch '3.5':
Issue #18383: Avoid adding duplicate filters when warnings is reloaded
https://hg.python.org/cpython/rev/f57f4e33ba5e

For the warnings module, it became a problem in test_warnings since the Python 
test runner started to clear all caches. When re.purge() is called, 
re.compile() creates a new object, whereas with the cache it returns the same 
object and so the two patterns are equal since it's the same object. => see 
issue #28688

--
files: pattern_compare.patch
keywords: patch
messages: 281046
nosy: haypo
priority: normal
severity: normal
status: open
title: Implement comparison (x==y and x!=y) for _sre.SRE_Pattern
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file45520/pattern_compare.patch

___
Python tracker 

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



[issue28725] Awaiting an awaitable returned from an async function does nothing

2016-11-17 Thread Gavin Panella

New submission from Gavin Panella:

The following will sleep:

  async def one():
  await asyncio.sleep(10)

  async def two():
  await one()

  loop.run_until_complete(two())

but the following will not:

  async def one():
  return asyncio.sleep(10)

  async def two():
  await one()

  loop.run_until_complete(two())

I would expect run_until_complete to keep bouncing awaitable results back into 
the event-loop until a non-awaitable is returned. In my code I work around this 
with:

  result = loop.run_until_complete(...)
  while inspect.isawaitable(result):
  result = loop.run_until_complete(result)

I would also expect that the await in `two` would have DTRT with the returned 
generator/coroutine.

--
components: asyncio
messages: 281043
nosy: allenap, gvanrossum, yselivanov
priority: normal
severity: normal
status: open
title: Awaiting an awaitable returned from an async function does nothing
type: behavior
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



[issue28688] Warning -- warnings.filters was modified by test_warnings

2016-11-17 Thread STINNER Victor

STINNER Victor added the comment:

Hum, this issue is a regression caused by the issue #23839. The environment 
warning was already fixed by the issue #18383 (duplicate: issue #26742):

New changeset f57f4e33ba5e by Martin Panter in branch '3.5':
Issue #18383: Avoid adding duplicate filters when warnings is reloaded
https://hg.python.org/cpython/rev/f57f4e33ba5e

The problem is that _sre.SRE_Pattern doesn't import rich compare: so two 
patterns are only equal if it's exactly the same object... which is likely when 
re caches the compiled expression... But the Python test runner now starts by 
clearing the re cache!

I see different options:

* Find something else to not re-initialize warning filters, 
"_processoptions(sys.warnoptions)" in warnings.py.
* Fix warnings._add_filter() to implement a custom comparator operator for 
regular expression objects: compare pattern and flags
* Implement comparision in _sre.SRE_Pattern

--

___
Python tracker 

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



[issue28724] Add method send_io, recv_io to the socket module.

2016-11-17 Thread Shinya Okano

New submission from Shinya Okano:

This patch makes it easy to pass file descriptor in using AF_UNIX.

Ruby language libraries have such methods.

see slso:
 - https://docs.ruby-lang.org/en/2.3.0/UNIXSocket.html#method-i-send_io

--
components: Library (Lib)
files: socket_send_io_recv_io.patch
keywords: patch
messages: 281041
nosy: tokibito
priority: normal
severity: normal
status: open
title: Add method send_io, recv_io to the socket module.
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file45519/socket_send_io_recv_io.patch

___
Python tracker 

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



[issue28699] Imap from ThreadPool behaves unexpectedly

2016-11-17 Thread Xiang Zhang

Xiang Zhang added the comment:

What's more, this case seems non-reentrant. Since there is no task in this 
case, the job id is always 0 which is not true. This means after the first 
time, we can not set even the exception.

--

___
Python tracker 

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



[issue27945] Various segfaults with dict

2016-11-17 Thread INADA Naoki

INADA Naoki added the comment:

I modified the patch to avoid incref when pair is not list, because 
tuple is common for such case.
But I can't get back original performance.

(python 2.7 is modified version of patch)

inada-n@test1:~/work/bench$ ~/local/py27/bin/master -m perf timeit --rigorous  
--python ~/local/py27/bin/python2.7 --compare-to ~/local/py27/bin/master -s 'L 
= [(i,i) for i in range(1)]' -- 'dict(L)'
master: . 1.47 ms +- 0.06 ms
python2.7: . 1.55 ms +- 0.06 ms

Median +- std dev: [master] 1.47 ms +- 0.06 ms -> [python2.7] 1.55 ms +- 0.06 
ms: 1.05x slower
inada-n@test1:~/work/bench$ ~/local/py27/bin/master -m perf timeit --rigorous  
--python ~/local/py27/bin/python2.7 --compare-to ~/local/py27/bin/patched -s 'L 
= [(i,i) for i in range(1)]' -- 'dict(L)'
patched: . 1.56 ms +- 0.08 ms
python2.7: . 1.55 ms +- 0.09 ms

Median +- std dev: [patched] 1.56 ms +- 0.08 ms -> [python2.7] 1.55 ms +- 0.09 
ms: 1.01x faster
Not significant!

--

___
Python tracker 

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



[issue28684] [asyncio] bind() on a unix socket raises PermissionError on Android for a non-root user

2016-11-17 Thread Xavier de Gaye

Xavier de Gaye added the comment:

With this patch, test_asyncio runs successfully with no ResourceWarning when 
run on the android-24 emulator.

--
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file45518/test_asyncio_bind.patch

___
Python tracker 

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



[issue27945] Various segfaults with dict

2016-11-17 Thread INADA Naoki

INADA Naoki added the comment:

I'm sorry, dict.fromkeys() didn't use PyDict_MergeFromSeq2().

This may be microbench for worst case:

$ ~/local/py35/bin/master -m perf timeit --rigorous  --python 
~/local/py35/bin/patched --compare-to ~/local/py35/bin/master -s 'L = [(i,i) 
for i in range(1)]' -- 'dict(L)'
master: . 2.06 ms +- 0.11 ms
patched: . 2.16 ms +- 0.09 ms

Median +- std dev: [master] 2.06 ms +- 0.11 ms -> [patched] 2.16 ms +- 0.09 ms: 
1.05x slower

$ ~/local/py27/bin/master -m perf timeit --rigorous  --python 
~/local/py27/bin/patched --compare-to ~/local/py27/bin/master -s 'L = [(i,i) 
for i in range(1)]' -- 'dict(L)'
master: . 1.48 ms +- 0.06 ms
patched: . 1.57 ms +- 0.09 ms

Median +- std dev: [master] 1.48 ms +- 0.06 ms -> [patched] 1.57 ms +- 0.09 ms: 
1.06x slower

--

___
Python tracker 

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



[issue25924] investigate if getaddrinfo(3) on OSX is thread-safe

2016-11-17 Thread A. Jesse Jiryu Davis

A. Jesse Jiryu Davis added the comment:

Here's a retelling of this bug report as a silly fantasy saga:

https://engineering.mongodb.com/post/the-saga-of-concurrent-dns-in-python-and-the-defeat-of-the-wicked-mutex-troll/

--

___
Python tracker 

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



[issue27945] Various segfaults with dict

2016-11-17 Thread INADA Naoki

INADA Naoki added the comment:

Only patch which affects to hot loop is:

--- a/Objects/dictobject.c  Tue Nov 15 21:21:35 2016 -0500
+++ b/Objects/dictobject.c  Wed Nov 16 11:40:51 2016 +
@@ -1550,11 +1550,18 @@ PyDict_MergeFromSeq2(PyObject *d, PyObje
 /* Update/merge with this (key, value) pair. */
 key = PySequence_Fast_GET_ITEM(fast, 0);
 value = PySequence_Fast_GET_ITEM(fast, 1);
+Py_INCREF(key);
+Py_INCREF(value);
 if (override || PyDict_GetItem(d, key) == NULL) {
 int status = PyDict_SetItem(d, key, value);
-if (status < 0)
+if (status < 0) {
+Py_DECREF(key);
+Py_DECREF(value);
 goto Fail;
+}
 }
+Py_DECREF(key);
+Py_DECREF(value);
 Py_DECREF(fast);
 Py_DECREF(item);
 }

Microbenchmark for it:

$ ~/local/py35/bin/master -m perf timeit --rigorous -t --python 
~/local/py35/bin/patched --compare-to ~/local/py35/bin/master -s 'L = [(i,i) 
for i in range(1)]' -- 'dict.fromkeys(L)'
Benchmark master


.Total duration: 21.2 sec
Start date: 2016-11-17 12:21:39
End date: 2016-11-17 12:22:13
Raw sample minimum: 109 ms
Raw sample maximum: 144 ms

Number of runs: 41
Total number of samples: 120
Number of samples per run: 3
Number of warmups per run: 1
Loop iterations per sample: 32

Minimum: 3.41 ms (-13%)
Median +- std dev: 3.92 ms +- 0.19 ms
Mean +- std dev: 3.92 ms +- 0.19 ms
Maximum: 4.50 ms (+15%)

Median +- std dev: 3.92 ms +- 0.19 ms

Benchmark patched
=

.Total duration: 21.3 sec
Start date: 2016-11-17 12:22:13
End date: 2016-11-17 12:22:47
Raw sample minimum: 108 ms
Raw sample maximum: 152 ms

Number of runs: 41
Total number of samples: 120
Number of samples per run: 3
Number of warmups per run: 1
Loop iterations per sample: 32

Minimum: 3.39 ms (-14%)
Median +- std dev: 3.92 ms +- 0.23 ms
Mean +- std dev: 3.95 ms +- 0.23 ms
Maximum: 4.74 ms (+21%)

Median +- std dev: 3.92 ms +- 0.23 ms

Compare
===

Median +- std dev: [master] 3.92 ms +- 0.19 ms -> [patched] 3.92 ms +- 0.23 ms: 
1.00x slower
Not significant!

--

___
Python tracker 

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



[issue27945] Various segfaults with dict

2016-11-17 Thread INADA Naoki

INADA Naoki added the comment:

I run performance 0.5.0 on Python 3.5.
Since it took long time even without -b all option, I haven't run it for Python 
2.7 yet.

On Python 3.5:

$ ./venv/cpython3.5-846d5b1f0b61/bin/python -m perf compare_to py35-master.json 
py35-patched.json  -G
Slower (14):
- logging_silent: 2.92 us +- 0.15 us -> 3.05 us +- 0.18 us: 1.04x slower
- pickle: 93.2 us +- 4.7 us -> 95.8 us +- 5.0 us: 1.03x slower
- python_startup: 72.6 ms +- 4.7 ms -> 74.6 ms +- 4.8 ms: 1.03x slower
- meteor_contest: 766 ms +- 13 ms -> 779 ms +- 15 ms: 1.02x slower
- scimark_sor: 2.00 sec +- 0.04 sec -> 2.04 sec +- 0.03 sec: 1.02x slower
- fannkuch: 3.86 sec +- 0.05 sec -> 3.91 sec +- 0.04 sec: 1.01x slower
- python_startup_no_site: 37.4 ms +- 2.4 ms -> 38.0 ms +- 2.6 ms: 1.01x slower
- regex_dna: 958 ms +- 13 ms -> 973 ms +- 16 ms: 1.01x slower
- regex_compile: 1.41 sec +- 0.02 sec -> 1.43 sec +- 0.02 sec: 1.01x slower
- raytrace: 5.46 sec +- 0.06 sec -> 5.52 sec +- 0.07 sec: 1.01x slower
- scimark_lu: 1.88 sec +- 0.09 sec -> 1.90 sec +- 0.12 sec: 1.01x slower
- nbody: 887 ms +- 19 ms -> 895 ms +- 21 ms: 1.01x slower
- 2to3: 3.01 sec +- 0.03 sec -> 3.03 sec +- 0.04 sec: 1.01x slower
- scimark_fft: 2.52 sec +- 0.05 sec -> 2.54 sec +- 0.04 sec: 1.01x slower

Faster (16):
- scimark_sparse_mat_mult: 35.0 ms +- 1.8 ms -> 32.7 ms +- 2.0 ms: 1.07x faster
- xml_etree_process: 1.13 sec +- 0.03 sec -> 1.07 sec +- 0.03 sec: 1.06x faster
- xml_etree_generate: 1.35 sec +- 0.03 sec -> 1.29 sec +- 0.03 sec: 1.05x faster
- mako: 154 ms +- 8 ms -> 149 ms +- 7 ms: 1.04x faster
- telco: 87.4 ms +- 3.7 ms -> 84.2 ms +- 4.1 ms: 1.04x faster
- tornado_http: 1.75 sec +- 0.03 sec -> 1.70 sec +- 0.03 sec: 1.03x faster
- call_simple: 45.5 ms +- 2.1 ms -> 44.3 ms +- 1.4 ms: 1.03x faster
- sympy_integrate: 202 ms +- 9 ms -> 198 ms +- 7 ms: 1.02x faster
- sympy_str: 2.08 sec +- 0.06 sec -> 2.04 sec +- 0.06 sec: 1.02x faster
- django_template: 1.65 sec +- 0.03 sec -> 1.61 sec +- 0.03 sec: 1.02x faster
- call_method_unknown: 65.1 ms +- 0.9 ms -> 64.3 ms +- 0.9 ms: 1.01x faster
- xml_etree_parse: 1.34 sec +- 0.04 sec -> 1.32 sec +- 0.04 sec: 1.01x faster
- sympy_sum: 1.01 sec +- 0.03 sec -> 998 ms +- 35 ms: 1.01x faster
- call_method_slots: 59.3 ms +- 0.8 ms -> 58.6 ms +- 1.0 ms: 1.01x faster
- float: 1.24 sec +- 0.03 sec -> 1.23 sec +- 0.02 sec: 1.01x faster
- chaos: 1.20 sec +- 0.02 sec -> 1.19 sec +- 0.02 sec: 1.01x faster

Benchmark hidden because not significant (31): call_method, chameleon, 
crypto_pyaes, deltablue, dulwich_log, genshi_text, genshi_xml, go, hexiom, 
html5lib, json_dumps, json_loads, logging_format, logging_simple, nqueens, 
pathlib, pickle_dict, pickle_list, pickle_pure_python, pidigits, regex_effbot, 
regex_v8, richards, scimark_monte_carlo, spectral_norm, sympy_expand, 
unpack_sequence, unpickle, unpickle_list, unpickle_pure_python, 
xml_etree_iterparse

--

___
Python tracker 

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



[issue28723] tkinter, radiobutton, indicatoron=0 has no effect.

2016-11-17 Thread Simon Holland

Simon Holland added the comment:

Thank you

On 17 November 2016 at 15:29, Serhiy Storchaka 
wrote:

>
> Serhiy Storchaka added the comment:
>
> Works to me on Linux (identical results with Tkinter and Tk). In any case
> if there is some bug on your platform, this is not Tkinter bug, but Tk bug.
> Tkinter doesn't handle this option specially, it just pass it to Tk. File a
> bug on Tk bugtracker: http://core.tcl.tk/tk/ticket .
>
> --
> resolution:  -> third party
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

-- 

Simon Holland BA Hons
Medan, Indonesia

Mobile : +62 81 26055297
Fax : +62 81 6613280

 [image: Twitter]  [image: LinkedIn]
 [image: YouTube]
 [image: Google Talk]


--

___
Python tracker 

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



[issue28696] imap from ThreadPool hangs by an exception in a generator function

2016-11-17 Thread Xiang Zhang

Xiang Zhang added the comment:

In Py3.6, it raises error:

>>> next((pool.imap(str, gen(
Traceback (most recent call last):
  File "/opt/lib/python3.7/multiprocessing/pool.py", line 684, in next
item = self._items.popleft()
IndexError: pop from an empty deque

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/lib/python3.7/multiprocessing/pool.py", line 690, in next
item = self._items.popleft()
IndexError: pop from an empty deque

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File "/opt/lib/python3.7/multiprocessing/pool.py", line 693, in next
raise StopIteration
StopIteration

But this doesn't looks good. I think it should raise TypeError. It can be fixed 
in #28699.

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue7659] Attribute assignment on object() instances raises wrong exception

2016-11-17 Thread Pascal Chambon

Pascal Chambon added the comment:

I guess it can, since retrocompatibility prevents some normalization here.

Or is it worth updating the doc about "AttributeError", misleading regarding 
the type of exception expected in this case ?

--
status: pending -> open

___
Python tracker 

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



[issue26926] test_io large file test failure on 32 bits Android platforms

2016-11-17 Thread Xavier de Gaye

Changes by Xavier de Gaye :


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

___
Python tracker 

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



[issue26931] android: test_distutils fails

2016-11-17 Thread Xavier de Gaye

Changes by Xavier de Gaye :


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

___
Python tracker 

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



[issue7659] Attribute assignment on object() instances raises wrong exception

2016-11-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Could this issue be closed now?

--
nosy: +serhiy.storchaka
status: open -> pending

___
Python tracker 

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



[issue28699] Imap from ThreadPool behaves unexpectedly

2016-11-17 Thread Xiang Zhang

Xiang Zhang added the comment:

Hi Davin, could it be fixed like this?

diff -r 05a728e1da15 Lib/multiprocessing/pool.py
--- a/Lib/multiprocessing/pool.py   Wed Nov 16 16:35:53 2016 -0800
+++ b/Lib/multiprocessing/pool.py   Thu Nov 17 16:35:38 2016 +0800
@@ -398,7 +398,7 @@
 except Exception as ex:
 job, ind = task[:2] if task else (0, 0)
 if job in cache:
-cache[job]._set(ind + 1, (False, ex))
+cache[job]._set(ind + 1 if task else 0, (False, ex))
 if set_length:
 util.debug('doing set_length()')
 set_length(i+1)

It seems to me the bug is _handle_tasks doesn't treat the exception correctly 
if it's on the very first. Every time it _set(ind + 1) since if there is any 
exception the task is the previous task and + 1 is needed. But if the exception 
occurs at the very first, task is None and the + 1 is not needed.

I am not very sure but the reported cases work correctly now:

list(Pool(processes=2).imap(double, get_numbers()))  # raises error now
list(pool.imap(str, gen()))  # raises error now

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue28723] tkinter, radiobutton, indicatoron=0 has no effect.

2016-11-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Works to me on Linux (identical results with Tkinter and Tk). In any case if 
there is some bug on your platform, this is not Tkinter bug, but Tk bug. 
Tkinter doesn't handle this option specially, it just pass it to Tk. File a bug 
on Tk bugtracker: http://core.tcl.tk/tk/ticket .

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



[issue26926] test_io large file test failure on 32 bits Android platforms

2016-11-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d616304b82aa by Xavier de Gaye in branch '3.6':
Issue #26926: Skip some test_io tests on platforms without large file support
https://hg.python.org/cpython/rev/d616304b82aa

New changeset 878f91b4ad19 by Xavier de Gaye in branch 'default':
Issue #26926: Merge 3.6
https://hg.python.org/cpython/rev/878f91b4ad19

--
nosy: +python-dev

___
Python tracker 

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



[issue26786] bdist_msi duplicates directories with names in ALL CAPS to a bogus location

2016-11-17 Thread Ivan Pozdeev

Changes by Ivan Pozdeev :


--
versions: +Python 3.7

___
Python tracker 

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



[issue28712] Non-Windows mappings for a couple of Windows code pages

2016-11-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Eryk. That is what I want. I just missed that code_page_decode() 
returns a tuple.

Seems Windows maps undefined codes to Unicode characters if they are in the 
range 0x80-0x9f and makes an error if they are outside of this range. But if 
the code starts multibyte sequence, the single byte is an error even if it is 
in the range 0x80-0x9f (codepages 932, 949, 950).

This could be emulated by either decoding with errors='surrogateescape' and 
postprocessing the result (replace '\udc80'-'\udc9f' with '\x80'-'\x9f' and 
handle '\udca0'-'\udcff' as error) or writing custom error handler that does 
the job (but perhaps needed several error handlers corresponding 'strict', 
'replace', 'ignore', etc). Adding a new codec of cause is an option too.

There are few other minor differences between Python and Windows:

cp864: On Windows 0x25 is mapped to '%' (U+0025) instead of '٪' (U+066A).
cp932: 0xA0, 0xFD, 0xFE, 0xFF are errors instead of mapping to U+F8F0-U+F8F3.
cp1255: 0xCA is mapped to U+05BA instead of be undefined.

The first two differences can be handled by postprocessing, the latter needs 
changing the codec.

--

___
Python tracker 

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



[issue26931] android: test_distutils fails

2016-11-17 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cea3b621973f by Xavier de Gaye in branch '3.6':
Issue 26931: Skip the test_distutils tests using a compiler executable
https://hg.python.org/cpython/rev/cea3b621973f

New changeset 99d69fd1b24e by Xavier de Gaye in branch 'default':
Issue 26931: Merge 3.6
https://hg.python.org/cpython/rev/99d69fd1b24e

--
nosy: +python-dev

___
Python tracker 

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