[issue28603] traceback module can't format/print unhashable exceptions

2016-12-13 Thread Jelle Zijlstra

Jelle Zijlstra added the comment:

I ran into this bug through Thrift-generated exception classes (also reported 
there as https://issues.apache.org/jira/browse/THRIFT-4002).

I've added a few potential solutions:
- issue28603-listset.patch turns the seen set into a list if hashing fails. 
However, this adds a lot of complexity, especially in C, and because seen is 
changed halfway through the recursion, we may end up showing an exception twice.
- issue28603-list.patch uses a list instead of a set for seen. This is 
theoretically slower, but in practice it seems unlikely that exception 
__cause__ and __context__ would nest deep enough for this to be an issue.
- issue28603-ignore.patch takes a similar approach to Trundle's patch and just 
gives up when the value is not hashable. This means we lose cause/context 
information for these exceptions.

I prefer issue28603-list.patch.

--
nosy: +Jelle Zijlstra
Added file: http://bugs.python.org/file45870/issue28603-list.patch

___
Python tracker 

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



[issue28603] traceback module can't format/print unhashable exceptions

2016-12-13 Thread Jelle Zijlstra

Changes by Jelle Zijlstra :


Added file: http://bugs.python.org/file45871/issue28603-ignore.patch

___
Python tracker 

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



[issue28603] traceback module can't format/print unhashable exceptions

2016-12-13 Thread Jelle Zijlstra

Changes by Jelle Zijlstra :


Added file: http://bugs.python.org/file45872/issue28603-list.patch

___
Python tracker 

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



[issue28680] bdist_wininst generated 64-bit executable looks for 3.5-32

2016-12-13 Thread Christoph Gohlke

Christoph Gohlke added the comment:

Pillow-3.4.2.win-amd64-py3.5.exe fails to install due to this. See 
.

`MS_WIN64` is never defined at 
 
because bdist_wininst does not depend on the Python headers. A possible fix is 
to use `_WIN64` instead of `MS_WIN64`.

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



[issue26856] android does not have pwd.getpwall()

2016-12-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e89c9ab46d77 by Xavier de Gaye in branch '3.6':
Issue #26856: Fix the tests assuming that the pwd module has getpwall() and
https://hg.python.org/cpython/rev/e89c9ab46d77

New changeset 692083f85981 by Xavier de Gaye in branch 'default':
Issue #26856: Merge 3.6.
https://hg.python.org/cpython/rev/692083f85981

--
nosy: +python-dev

___
Python tracker 

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



[issue26936] android: test_socket fails

2016-12-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 95140ff32239 by Xavier de Gaye in branch 'default':
Issue #26936: Fix the test_socket failures on Android - getservbyname(),
https://hg.python.org/cpython/rev/95140ff32239

--
nosy: +python-dev

___
Python tracker 

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



[issue28956] return minimum of modes for a multimodal distribution instead of raising a StatisticsError

2016-12-13 Thread Wolfgang Maier

Wolfgang Maier added the comment:

What's the justification for this proposed change? Isn't it better to report 
the fact that there isn't an unambiguous result instead of returning a rather 
arbitrary one?

--
nosy: +steven.daprano, wolma
versions: +Python 3.7 -Python 3.5

___
Python tracker 

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



[issue28680] bdist_wininst generated 64-bit executable looks for 3.5-32

2016-12-13 Thread Christoph Gohlke

Christoph Gohlke added the comment:

The attached patch was tested with Pillow-3.4.2 on Python 3.6.0rc1, 32-bit and 
64-bit.

It would be nice to get this fixed in Python 3.5.3 and 3.6.0.

--
components: +Windows
keywords: +patch
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
Added file: http://bugs.python.org/file45873/fix_issue28680.diff

___
Python tracker 

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



[issue26071] bdist_wininst created binaries fail to start and find 32bit Pythons

2016-12-13 Thread Christoph Gohlke

Christoph Gohlke added the comment:

The applied patch breaks bdist_wininst installers for 64-bit Python. See 
.

--
nosy: +cgohlke

___
Python tracker 

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



[issue28759] access to mkfifo, mknod and hard links is controled by SELinux MAC on Android

2016-12-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 43f9366d8883 by Xavier de Gaye in branch '3.6':
Issue #28759: Fix the tests that fail with PermissionError when run as
https://hg.python.org/cpython/rev/43f9366d8883

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

--
nosy: +python-dev

___
Python tracker 

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



[issue26936] android: test_socket fails

2016-12-13 Thread Xavier de Gaye

Changes by Xavier de Gaye :


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

___
Python tracker 

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



[issue26856] android does not have pwd.getpwall()

2016-12-13 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



[issue28956] return minimum of modes for a multimodal distribution instead of raising a StatisticsError

2016-12-13 Thread Srikanth Anantharam

Srikanth Anantharam added the comment:

A better choice would be to return a tuple of values (sliced from the
table). And let the user decide which one to use.

Hope that's justifiable...

Thanks & Regards
Srikanth Anantharam
+91 7204 350429
https://sria91.github.io/

Sent from Android

On 13-Dec-2016 2:20 PM, "Wolfgang Maier"  wrote:

>
> Wolfgang Maier added the comment:
>
> What's the justification for this proposed change? Isn't it better to
> report the fact that there isn't an unambiguous result instead of returning
> a rather arbitrary one?
>
> --
> nosy: +steven.daprano, wolma
> versions: +Python 3.7 -Python 3.5
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue7434] general pprint rewrite

2016-12-13 Thread Frazer McLean

Changes by Frazer McLean :


--
nosy: +RazerM

___
Python tracker 

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



[issue28956] return minimum of modes for a multimodal distribution instead of raising a StatisticsError

2016-12-13 Thread Steven D'Aprano

Steven D'Aprano added the comment:

On Tue, Dec 13, 2016 at 09:35:22AM +, Srikanth Anantharam wrote:
> 
> Srikanth Anantharam added the comment:
> 
> A better choice would be to return a tuple of values (sliced from the
> table). And let the user decide which one to use.

The current mode() function is designed for a very basic use-case, where 
you have an obvious single mode from discrete data.

The problem with dealing with multiple modes is that its not easy to 
tell the difference between a genuinely multi-modal sample and one which 
just happens to have a few samples with the same value:

data = [1, 2, 3, 4, 4, 4, 5, 6, 7, 7, 8, 8, 8, 8, 8, 8, 8, 9, 9]

Assuming the sampling is fair, 8 is clearly the mode; but is it bimodal 
with 4 the second mode? Or perhaps even four modes, 8, 4, 7 and 9?

I have plans for introducing a binning function to collect data into 
bins and run statistics on the bins. That might be a better way to deal 
with multi-modal samples: if you bin the data (for discrete data, use a 
bin size of 1) and then look at the frequencies, you can decide how many 
modes there are.

Thanks for the suggestion.

--

___
Python tracker 

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



[issue28956] return minimum of modes for a multimodal distribution instead of raising a StatisticsError

2016-12-13 Thread Srikanth Anantharam

Changes by Srikanth Anantharam :


--
pull_requests: +4

___
Python tracker 

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



[issue28956] return minimum of modes for a multimodal distribution instead of raising a StatisticsError

2016-12-13 Thread Srikanth Anantharam

Srikanth Anantharam added the comment:

Please see the updated pull request PR 50, with the changes.

Thanks & Regards
Srikanth Anantharam
+91 7204 350429
https://sria91.github.io/

Sent from Android

On 13-Dec-2016 3:26 PM, "Srikanth Anantharam" 
wrote:

>
> Changes by Srikanth Anantharam :
>
>
> --
> pull_requests: +4
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue28956] return minimum of modes for a multimodal distribution instead of raising a StatisticsError

2016-12-13 Thread Srikanth Anantharam

Srikanth Anantharam added the comment:

@steven:

data = [1, 2, 3, 4, 4, 4, 5, 6, 7, 7, 8, 8, 8, 8, 8, 8, 8, 9, 9]
is clearly unimodal with mode 8

data would have been bimodal if 4 repeated exactly the same (7) number of
times as 8, like this:
data = [1, 2, 3, 4, 4, 4, 4, 4, 4, 4, 5, 6, 7, 7, 8, 8, 8, 8, 8, 8, 8, 9, 9]

in which case the new patch in PR 50 would return a tuple
(4, 8)

Thanks & Regards
Srikanth Anantharam
+91 7204 350429
https://sria91.github.io/

Sent from Android

On 13-Dec-2016 3:24 PM, "Steven D'Aprano"  wrote:

Steven D'Aprano added the comment:

On Tue, Dec 13, 2016 at 09:35:22AM +, Srikanth Anantharam wrote:
>
> Srikanth Anantharam added the comment:
>
> A better choice would be to return a tuple of values (sliced from the
> table). And let the user decide which one to use.

The current mode() function is designed for a very basic use-case, where
you have an obvious single mode from discrete data.

The problem with dealing with multiple modes is that its not easy to
tell the difference between a genuinely multi-modal sample and one which
just happens to have a few samples with the same value:

data = [1, 2, 3, 4, 4, 4, 5, 6, 7, 7, 8, 8, 8, 8, 8, 8, 8, 9, 9]

Assuming the sampling is fair, 8 is clearly the mode; but is it bimodal
with 4 the second mode? Or perhaps even four modes, 8, 4, 7 and 9?

I have plans for introducing a binning function to collect data into
bins and run statistics on the bins. That might be a better way to deal
with multi-modal samples: if you bin the data (for discrete data, use a
bin size of 1) and then look at the frequencies, you can decide how many
modes there are.

Thanks for the suggestion.

--

___
Python tracker 

___

--

___
Python tracker 

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



[issue26110] Speedup method calls 1.2x

2016-12-13 Thread INADA Naoki

INADA Naoki added the comment:

> And would be nice to extend the optimization to C functions.

I tried it but skipping creating PyCFunction seems impossible for now.

My current idea is adding new `tp_fastcall` slot which has same signature
to _PyFunction_FastCallDict or _PyCFunction_FastCallDict.

If MethodDescrObject implement it, we can skip temporary PyCFunction object and
argument tuple.

But I think it should be separated issue. Patch is large enough already.

--

___
Python tracker 

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



[issue26110] Speedup method calls 1.2x

2016-12-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> But I think it should be separated issue.

Agreed if that so hard.

--

___
Python tracker 

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



[issue28603] traceback module can't format/print unhashable exceptions

2016-12-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There is no issue28603-listset.patch.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue28955] Not matched behavior of numeric comparison with the documentation

2016-12-13 Thread R. David Murray

R. David Murray added the comment:

Sure, we like to make the docs more precise when it doesn't interfere with the 
presentation.  Perhaps something like:  "Additionally, ordering comparisions 
involving not-a-number values will always return False."

I wonder if we should also mention here that this follows the IEEE standard.

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-12-13 Thread Mantas Zimnickas

Changes by Mantas Zimnickas :


--
nosy: +Mantas Zimnickas

___
Python tracker 

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



[issue28950] regrtest: -j0 fails the check -j is not allowed together with -T/-l

2016-12-13 Thread kumaar.nd

kumaar.nd added the comment:

hi,
I reviewed the changes of patch set-2.
In the test_regrtest.py, instead of adding new condition
229:self.checkError([opt, '0', '-T'], "don't go together")
230:self.checkError([opt, '0', '-l'], "don't go together")
isnt it easier to just tweak and replace the existing 
227:self.checkError([opt, '2', '-T'], "don't go together")
228:self.checkError([opt, '2', '-l'], "don't go together")
with teh above changes?

If the suggestion sound naive, this is my first developer review and am new to 
python too.

--
nosy: +kumaar.nd

___
Python tracker 

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



[issue24954] No way to generate or parse timezone as produced by datetime.isoformat()

2016-12-13 Thread Mantas Zimnickas

Changes by Mantas Zimnickas :


--
nosy: +sirex

___
Python tracker 

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



[issue28933] AC: Accept None as a Py_ssize_t default value

2016-12-13 Thread Larry Hastings

Larry Hastings added the comment:

Since this is the first time anybody has needed it, I suggest the latter.

--

___
Python tracker 

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



[issue14597] Cannot unload dll in ctypes until script exits

2016-12-13 Thread Mateusz Loskot

Changes by Mateusz Loskot :


--
nosy: +mloskot

___
Python tracker 

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



[issue28959] Add a macro for dict size

2016-12-13 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

In additional to C API functions PyTuple_Size() and PyList_Size() there are 
fast macros PyTuple_GET_SIZE() and PyList_GET_SIZE() for getting the size of a 
tuple or a list. But for dicts there is just PyDict_Size(). It is not just 
slower than a macro, but can return an error (actually this never happens in 
CPython core and extensions).

Proposed patch adds new private macro _PyDict_GET_SIZE() and makes the code 
using it instead of PyDict_Size(). I don't expect significant performance gain 
except perhaps few checks that a dict is empty. The main advantage to me is 
that not checking the result for error no longer looks as potential bug.

--
components: Interpreter Core
files: _PyDict_GET_SIZE.patch
keywords: patch
messages: 283099
nosy: haypo, inada.naoki, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Add a macro for dict size
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file45874/_PyDict_GET_SIZE.patch

___
Python tracker 

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



[issue28933] AC: Accept None as a Py_ssize_t default value

2016-12-13 Thread Julien Palard

Changes by Julien Palard :


--
status: open -> closed

___
Python tracker 

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



[issue28754] Argument Clinic for bisect.bisect_left

2016-12-13 Thread Julien Palard

Julien Palard added the comment:

As the pattern of this converter is not widely used, I'll let it in the code of 
_bisect for the moment, see: http://bugs.python.org/issue28933.

--

___
Python tracker 

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



[issue28933] AC: Accept None as a Py_ssize_t default value

2016-12-13 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> rejected
stage:  -> resolved

___
Python tracker 

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



[issue28759] access to mkfifo, mknod and hard links is controled by SELinux MAC on Android

2016-12-13 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



[issue28960] Small typo in Thread.join docs

2016-12-13 Thread Ryan

New submission from Ryan:

There is a '--' before a ',' that doesn't make sense here: 
https://docs.python.org/3/library/threading.html#threading.Thread.join

--
assignee: docs@python
components: Documentation
files: fixdoc.patch
keywords: patch
messages: 283101
nosy: docs@python, rcorre
priority: normal
severity: normal
status: open
title: Small typo in Thread.join docs
type: enhancement
versions: Python 3.7
Added file: http://bugs.python.org/file45875/fixdoc.patch

___
Python tracker 

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



[issue28919] Simplify `_copy_func_details` in unittest.mock

2016-12-13 Thread Jiajun Huang

Jiajun Huang added the comment:

So what should I do next to make the code being merged into CPython? I am new 
to mercurial(or just wait for it?).

--

___
Python tracker 

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



[issue28845] Clean up known issues for AIX

2016-12-13 Thread David Edelsohn

David Edelsohn added the comment:

There is an AIX system in the Python buildbot farm. Why do you say no AIX to 
test?

--

___
Python tracker 

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



[issue28961] Is it a bug(method `_Call.__new__` in unittest.mock)?

2016-12-13 Thread Jiajun Huang

New submission from Jiajun Huang:

code in `_Call.__new__`:

  def __new__(cls, value=(), name=None, parent=None, two=False, 
   
  ¦   ¦   ¦   from_kall=True):  
   
  ¦   name = '' 
   
  ¦   args = () 
   
  ¦   kwargs = {}   
   
  ¦   _len = len(value) 
   
  ¦   if _len == 3: 
   
  ...

the parameter `name` had been override since the function starts. so whatever 
name is, it's been ignored. Is it a bug? or something else?

--
components: Library (Lib)
messages: 283104
nosy: Jiajun Huang
priority: normal
severity: normal
status: open
title: Is it a bug(method `_Call.__new__` in unittest.mock)?
type: enhancement
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



[issue26071] bdist_wininst created binaries fail to start and find 32bit Pythons

2016-12-13 Thread Steve Dower

Steve Dower added the comment:

Looks like I acknowledged the error in the patch and then didn't fix it when I 
applied it.

The change needed here is what Mark describes above, plus recompiling the 
executable stubs. Or alternatively, I can probably just edit out the bytes in 
the existing stub for 3.6.0 and fix it properly for 3.6.1.

Ned - thoughts? This regressed from 3.4 and has not worked properly for both 
architectures (simultaneously) since 3.5.

--
keywords: +3.4regression
nosy: +larry, ned.deily
priority: normal -> release blocker
resolution: fixed -> 
status: closed -> open
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



[issue28680] bdist_wininst generated 64-bit executable looks for 3.5-32

2016-12-13 Thread Steve Dower

Steve Dower added the comment:

Thanks. 3.5.3 is definite, I've pinged the release manage on the original bug 
to see about 3.6.0, but definitely 3.6.1.

Considering we've gone through all of 3.5 and 3.6 with very few people noticing 
(and as far as I'm aware, completely able to fix it themselves), it may not 
make the initial 3.6 release.

--

___
Python tracker 

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



[issue28680] bdist_wininst generated 64-bit executable looks for 3.5-32

2016-12-13 Thread Steve Dower

Changes by Steve Dower :


--
assignee:  -> steve.dower
keywords: +3.4regression
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



[issue28948] Facing issue while running Python 3.6.0rc1 windows x86-64 web based installer

2016-12-13 Thread Steve Dower

Steve Dower added the comment:

What about the file, ucrtbase.dll? Do you have another file by that name 
somewhere?

--

___
Python tracker 

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



[issue28923] Nonexisting encoding specified in Tix.py

2016-12-13 Thread Ivan Pozdeev

Ivan Pozdeev added the comment:

I'm more puzzled how noone has noticed this until now if it's supposed to 
produce an error upon compilation. (Well, it doesn't. I couldn't quite figure 
out how the encoding declaration is parsed, but it's clear the line _isn't_ 
matched as a regex like the docs say.)

--

___
Python tracker 

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



[issue28919] Simplify `_copy_func_details` in unittest.mock

2016-12-13 Thread Berker Peksag

Berker Peksag added the comment:

I will commit your patch today if Michael doesn't beat me to it.

--

___
Python tracker 

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



[issue28949] Stdlib modules disappear from file system

2016-12-13 Thread Jason R. Coombs

Jason R. Coombs added the comment:

Downgrading Dropbox did not help. This morning I woke up to `importlib.abc` 
missing.

--

___
Python tracker 

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



[issue28190] Cross-build _curses failed if host ncurses headers and target ncurses headers have different layouts

2016-12-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8c78d844d6f0 by Xavier de Gaye in branch '3.6':
Issue #28190: Cross compiling the _curses module does not use anymore
https://hg.python.org/cpython/rev/8c78d844d6f0

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

--
nosy: +python-dev

___
Python tracker 

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



[issue28190] Cross-build _curses failed if host ncurses headers and target ncurses headers have different layouts

2016-12-13 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
assignee: xdegaye -> 

___
Python tracker 

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



[issue28949] Stdlib modules disappear from file system

2016-12-13 Thread Jason R. Coombs

Jason R. Coombs added the comment:

I'm getting good at reinstalling Python, though. Now I'm invoking it with this 
single command-line:

sudo installer -verboseR -pkg ~/Downloads/python-3.6.0rc1-macosx10.6.pkg 
-target /

--

___
Python tracker 

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



[issue26865] Meta-issue: support of the android platform

2016-12-13 Thread Xavier de Gaye

Xavier de Gaye added the comment:

Removing from the dependencies some issues that have become out of scope.

--
dependencies:  -Cross-build _curses failed if host ncurses headers and target 
ncurses headers have different layouts, add function to os module for getting 
path to default shell

___
Python tracker 

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



[issue26071] bdist_wininst created binaries fail to start and find 32bit Pythons

2016-12-13 Thread Ned Deily

Ned Deily added the comment:

Since we are two days from the final release, the fix requires rebuilding and 
replacing a binary file in the source repo, and you state (in related 
Issue28680): "Considering we've gone through all of 3.5 and 3.6 with very few 
people noticing (and as far as I'm aware, completely able to fix it 
themselves), it may not make the initial 3.6 release.", I would prefer to hold 
this for 3.6.1.

--
priority: release blocker -> deferred blocker
stage: resolved -> patch review

___
Python tracker 

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



[issue28949] Stdlib modules disappear from file system

2016-12-13 Thread Ned Deily

Ned Deily added the comment:

Have you verified that the problem no longer occurs if the virtualenvs are not 
in a Dropbox directory?  (And these are virtualenvs, not venvs?)  In any case, 
at this point it seems pretty clear that we're not dealing with a problem with 
Python 3.6.0 nor with the python.org installer, no?

--

___
Python tracker 

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



[issue26110] Speedup method calls 1.2x

2016-12-13 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



[issue16255] subrocess.Popen needs /bin/sh but Android only has /system/bin/sh

2016-12-13 Thread Xavier de Gaye

Xavier de Gaye added the comment:

For some reason the following notifications have not all been received (yet):
remote: added 1 changesets with 2 changes to 2 files
remote: buildbot: change(s) sent successfully
remote: sent email to roundup at rep...@bugs.python.org
remote: notified python-check...@python.org of incoming changeset 
96a9992d1003

But the buildbots have processed the build request.
Closing the issue.

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

___
Python tracker 

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



[issue16255] subrocess.Popen needs /bin/sh but Android only has /system/bin/sh

2016-12-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 96a9992d1003 by Xavier de Gaye in branch 'default':
Issue #16255: subrocess.Popen uses /system/bin/sh on Android as the shell,
https://hg.python.org/cpython/rev/96a9992d1003

--
nosy: +python-dev

___
Python tracker 

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



[issue28962] Crash when throwing an exception with a malicious __hash__ override

2016-12-13 Thread Jelle Zijlstra

New submission from Jelle Zijlstra:

$ cat baderror.py 
class BadError(Exception):
def __init__(self):
self.i = 0

def __hash__(self):
self.i += 1
return self.i


e = BadError()
raise e from e
$ ./python.exe -V
Python 3.5.2+
$ ./python.exe baderror.py 
Segmentation fault: 11

I have reproduced this with Python 3.3, 3.4, 3.5, and 3.6; I assume it's been 
present throughout the 3 series.

This is because print_exception_recursive in pythonrun.c keeps following the 
__cause__ chain, and here the exception is its own __cause__. It uses a set to 
ensure that it breaks cycles, but that doesn't help here because of the 
exception's incorrect __hash__ method.

--
components: Interpreter Core
files: baderror.py
messages: 283118
nosy: Jelle Zijlstra
priority: normal
severity: normal
status: open
title: Crash when throwing an exception with a malicious __hash__ override
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file45876/baderror.py

___
Python tracker 

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



[issue28949] Stdlib modules disappear from file system

2016-12-13 Thread Jason R. Coombs

Jason R. Coombs added the comment:

This morning, I noticed my Mercurial install isn't working either - failing 
with this error message:

$ hg pull
abort: couldn't find mercurial libraries in 
[/usr/local/Cellar/mercurial/4.0.1/lib/python2.7/site-packages 
/usr/local/Cellar/mercurial/4.0.1/bin 
/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python27.zip
 
/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7
 
/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin
 
/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac
 
/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages
 
/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk
 
/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old
 
/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload
 /Users/jaraco/Library/Python/2.7/lib/python/site-packages /usr
 /local/lib/python2.7/site-packages /Library/Python/2.7/site-packages]
(check your install and PYTHONPATH)

That happens even though I was still able to "import mercurial" in my Python 
environment. I uninstalled and reinstalled the Mercurial (using Homebrew) and 
it failed to reinstall with the same error, suggesting strongly that it was the 
Python environment that was corrupted. I then uninstalled and reinstalled the 
Homebrew Python 2.7, and the problem was solved. I think this points to another 
manifestation of something deleting files that were symlinked by directories in 
the virtualenv.

--

___
Python tracker 

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



[issue28949] Stdlib modules disappear from file system

2016-12-13 Thread Jason R. Coombs

Changes by Jason R. Coombs :


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



[issue28961] unittest.mock._Call ignores `name` parameter

2016-12-13 Thread Emanuel Barry

Emanuel Barry added the comment:

That indeed looks like a bug. Well spotted :)

That code has been there since unittest.mock was added back in March 2012. If I 
were to guess, I'd say that it should be `if name is None: name = ''`. Care to 
submit a patch?

--
nosy: +ebarry, michael.foord
stage:  -> needs patch
title: Is it a bug(method `_Call.__new__` in unittest.mock)? -> 
unittest.mock._Call ignores `name` parameter
type: enhancement -> behavior
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



[issue28949] Stdlib modules disappear from file system

2016-12-13 Thread Jason R. Coombs

Jason R. Coombs added the comment:

> virtualenvs and not venvs? 

Correct.

> In any case, at this point it seems pretty clear that we're not dealing with 
> a problem with Python 3.6.0 nor with the python.org installer, no?

Also correct.

If you don't mind, I'd like to continue to document and log this issue here. 
I've removed Python 3.6 as implicated and I'll remove you as nosy.

--

___
Python tracker 

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



[issue28949] Stdlib modules disappear from file system

2016-12-13 Thread Jason R. Coombs

Changes by Jason R. Coombs :


--
nosy:  -ned.deily

___
Python tracker 

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



[issue28949] Stdlib modules disappear from file system

2016-12-13 Thread Ned Deily

Ned Deily added the comment:

Thanks.  I'm still interested in the outcome but my immediate concern was 
whether this was a showstopper problem for 3.6.0.  Good luck!

--
nosy: +ned.deily

___
Python tracker 

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



[issue28959] Add a macro for dict size

2016-12-13 Thread Raymond Hettinger

Raymond Hettinger added the comment:

It looks like the struct of a dict is already arranged in a way that it could 
switch to PyObject_VAR_HEAD which would let you use Py_SIZE everywhere.

--
nosy: +rhettinger

___
Python tracker 

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



[issue25458] ftplib: command response shift - mismatch

2016-12-13 Thread Ivan Pozdeev

Ivan Pozdeev added the comment:

One more concern about the fix (so that you don't assume I didn't think of this 
;) ) - handling of errors signified by the end-of-transfer response.

Handling a response in a close handler prevents us from actually checking its 
code:
* destructors like a close handler cannot raise exceptions because that would 
disrupt the resource release process
* and they're routinely called from `finally', so an exception would mask the 
current one if there's any (it's impossible to check within a finally block if 
it was was called as a result of an exception - 
http://stackoverflow.com/questions/1611561/can-i-get-the-exception-from-the-finally-block-in-python).

Now,
* The errors where the transfer never starts are detected by `ntransfercmd' 
either when opening the socket (425) or checking the first response (55x)
  * an exception when opening the socket would result in the response not being 
read.
* The errors when the transfer ends prematurely
  * are either handled by the socket (connection reset/timeout)
  * or can be detected by checking data length against the real one if it's 
available <- these are not currently handled
* if it results from the user closing the socket prematurely (426), it 
_should_ be ignored
* otherwise, we can wrap recv(), too, and check the response if the 
underlying fn returns ''
* If the error is local (an exception is raised in other code), the server's 
response doesn't matter

Looks like fixing this part warrants a separate ticket, though it does affect 
which option to take at this step - it speaks in favor of wrapping the data 
socket.

I'll ask at python-dev for some feedback before I go any way.

--

___
Python tracker 

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



[issue26071] bdist_wininst created binaries fail to start and find 32bit Pythons

2016-12-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c3da1ee47e6b by Steve Dower in branch '3.5':
Issue #26071: Fixes preprocessor definition and rebuilds 
wininst-14.0[-amd64].exe
https://hg.python.org/cpython/rev/c3da1ee47e6b

New changeset 0528a6743018 by Steve Dower in branch '3.6':
Issue #26071: Fixes preprocessor definition and rebuilds 
wininst-14.0[-amd64].exe
https://hg.python.org/cpython/rev/0528a6743018

New changeset 4e9d899fcb65 by Steve Dower in branch 'default':
Issue #26071: Fixes preprocessor definition and rebuilds 
wininst-14.0[-amd64].exe
https://hg.python.org/cpython/rev/4e9d899fcb65

--

___
Python tracker 

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



[issue26546] Provide translated french translation on docs.python.org

2016-12-13 Thread Julien Palard

Julien Palard added the comment:

For the record, I opened a WIP pull request here: 
https://github.com/python/docsbuild-scripts/pull/8

Feedback is welcome.

--

___
Python tracker 

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



[issue26071] bdist_wininst created binaries fail to start and find 32bit Pythons

2016-12-13 Thread Steve Dower

Steve Dower added the comment:

Fixed for 3.5.3, 3.6.1 and default.

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

___
Python tracker 

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



[issue28680] bdist_wininst generated 64-bit executable looks for 3.5-32

2016-12-13 Thread Steve Dower

Steve Dower added the comment:

Fixed for 3.5.3, 3.6.1 and default against the original issue26071

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> bdist_wininst created binaries fail to start and find 32bit 
Pythons

___
Python tracker 

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



[issue28941] Update the link to Source Code in Python Docs from hg to github

2016-12-13 Thread Brett Cannon

Brett Cannon added the comment:

No, I'm the one who misunderstood; I read the title of the issue too quickly 
after reading the doc source link issue and my brain didn't pick up on the 
"source code" part of the title. Sorry about that.

--

___
Python tracker 

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



[issue25711] Rewrite zipimport from scratch

2016-12-13 Thread Brett Cannon

Brett Cannon added the comment:

Just FYI, if this lands I will probably try to build off of it to make a 
pathlib-like zip module to eventually replace zipfile. So if there's any API 
design decisions that need to be made, it would be great if we try to keep the 
zip-specific bits separate and generic enough to work with in other future 
libraries.

--

___
Python tracker 

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



[issue28959] Add a macro for dict size

2016-12-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Following patch also switches the struct of a dict to PyObject_VAR_HEAD.

Should we use Py_SIZE or _PyDict_GET_SIZE? It is easier to replace 
_PyDict_GET_SIZE with Py_SIZE than restore dict-specific name from some of 
Py_SIZE-s.

--
Added file: http://bugs.python.org/file45877/_PyDict_GET_SIZE-2.patch

___
Python tracker 

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



[issue28923] Nonexisting encoding specified in Tix.py

2016-12-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I reread
https://docs.python.org/27/reference/lexical_analysis.html#encoding-declarations
A first or second line must be a comment matching "coding[=:]\s*([-\w.]+)" 
(which IDLE uses) and the captured name "must be recognized by Python".

I also did some experiments.  Apparently, "iso-latin-1-unix" is recognized by 
Python.  On Windows, from an IDLE editor,
  # coding: iso-latin-1-unix
runs, while 
  # coding: xiso-latin-1-unix
raises, during the compile(..., 'file', 'exec') call:
  SyntaxError: unknown encoding: xiso-latin-1-unix

Since codecs.lookup() returns the same error for both lines:
  LookupError: unknown encoding: iso-latin-1-unix
compile() must be doing something other than simply calling codecs.lookup.  I 
suspect it somehow recognizes 'iso', 'latin-1', and 'unix' as valid chunks of 
an ecoding name.  (The last might even be an obsolete legacy item.)  Whatever 
it is, it is not obviously available to tools written in Python.

Note that 'recognized as a legitimate encoding name' and 'available on a 
particular installation' are different concepts. I believe codecs.lookup 
implements the latter.

--

___
Python tracker 

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



[issue28923] Nonexisting encoding specified in Tix.py

2016-12-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Serhiy, if you agree with the proposed removal, but want me to do it, I will.

--

___
Python tracker 

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



[issue28960] Small typo in Thread.join docs

2016-12-13 Thread Martin Panter

Changes by Martin Panter :


--
stage:  -> commit review
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



[issue28963] Use-after-free in _asynciomodule.c

2016-12-13 Thread Ned Williamson

New submission from Ned Williamson:

There are two cases of use-after-free in the new Modules/_asynciomodule.c in 
the release candidate for Python 3.6, but I'm filing these together because 
it's the same underlying issue.

In both cases in this file where the unsafe `PyList_GET_ITEM` is called, 
`_asyncio_Future_remove_done_callback` and `future_schedule_callbacks`, there 
is a function called on the fetched item that allows the user to mutate the 
callbacks list (`PyObject_RichCompareBool` and `_PyObject_CallMethodId`), which 
then leads to OOB access on subsequent iterations.

For example, this script can trigger the vulnerability for 
`remove_done_callback`:
```
import asyncio

fut = asyncio.Future()
fut.add_done_callback(str)

for _ in range(63):
fut.add_done_callback(id)

class evil:
def __eq__(self, other):
fut.remove_done_callback(id)
return False

fut.remove_done_callback(evil())
```

On an ASAN build we can see that there is indeed a UAF occurring:
```
=
==19239==ERROR: AddressSanitizer: heap-buffer-overflow on address 
0x6030e7f0 at pc 0x000106fe6704 bp 0x7fff5cda09c0 sp 0x7fff5cda09b8
READ of size 8 at 0x6030e7f0 thread T0
#0 0x106fe6703 in _asyncio_Future_remove_done_callback _asynciomodule.c:526
#1 0x102f5af35 in _PyCFunction_FastCallDict methodobject.c:192
#2 0x1030e9044 in call_function ceval.c:4788
#3 0x1030da2f0 in _PyEval_EvalFrameDefault ceval.c:3275
#4 0x1030eb09b in _PyEval_EvalCodeWithName ceval.c:718
#5 0x1030ced53 in PyEval_EvalCode ceval.c:4140
#6 0x10317da47 in PyRun_FileExFlags pythonrun.c:980
#7 0x10317c110 in PyRun_SimpleFileExFlags pythonrun.c:396
#8 0x1031c76b8 in Py_Main main.c:320
#9 0x102e5ed40 in main python.c:69
#10 0x7fffc9bd8254 in start (libdyld.dylib+0x5254)

0x6030e7f0 is located 0 bytes to the right of 32-byte region 
[0x6030e7d0,0x6030e7f0)
allocated by thread T0 here:
#0 0x1039d5f87 in wrap_realloc (libclang_rt.asan_osx_dynamic.dylib+0x4af87)
#1 0x102efb089 in list_ass_slice listobject.c:63
#2 0x106fe6605 in _asyncio_Future_remove_done_callback _asynciomodule.c:541
#3 0x102f5af35 in _PyCFunction_FastCallDict methodobject.c:192
#4 0x1030e9044 in call_function ceval.c:4788
#5 0x1030da2f0 in _PyEval_EvalFrameDefault ceval.c:3275
#6 0x1030ed94a in _PyFunction_FastCallDict ceval.c:718
#7 0x102e81308 in _PyObject_FastCallDict abstract.c:2295
#8 0x102e816b1 in _PyObject_Call_Prepend abstract.c:2358
#9 0x102e81286 in _PyObject_FastCallDict abstract.c:2316
#10 0x102fa125a in slot_tp_richcompare typeobject.c:6287
#11 0x102f61f66 in PyObject_RichCompare object.c:671
#12 0x102f62421 in PyObject_RichCompareBool object.c:741
#13 0x106fe6544 in _asyncio_Future_remove_done_callback _asynciomodule.c:528
#14 0x102f5af35 in _PyCFunction_FastCallDict methodobject.c:192
#15 0x1030e9044 in call_function ceval.c:4788
#16 0x1030da2f0 in _PyEval_EvalFrameDefault ceval.c:3275
#17 0x1030eb09b in _PyEval_EvalCodeWithName ceval.c:718
#18 0x1030ced53 in PyEval_EvalCode ceval.c:4140
#19 0x10317da47 in PyRun_FileExFlags pythonrun.c:980
#20 0x10317c110 in PyRun_SimpleFileExFlags pythonrun.c:396
#21 0x1031c76b8 in Py_Main main.c:320
#22 0x102e5ed40 in main python.c:69
#23 0x7fffc9bd8254 in start (libdyld.dylib+0x5254)

SUMMARY: AddressSanitizer: heap-buffer-overflow _asynciomodule.c:526 in 
_asyncio_Future_remove_done_callback
Shadow bytes around the buggy address:
  0x1c061ca0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c061cb0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c061cc0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c061cd0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c061ce0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x1c061cf0: fa fa fa fa fa fa fa fa fa fa 00 00 00 00[fa]fa
  0x1c061d00: 00 00 00 fa fa fa 00 00 00 fa fa fa 00 00 00 02
  0x1c061d10: fa fa fd fd fd fd fa fa fd fd fd fd fa fa fd fd
  0x1c061d20: fd fd fa fa fd fd fd fd fa fa fd fd fd fd fa fa
  0x1c061d30: fd fd fd fd fa fa fd fd fd fd fa fa fd fd fd fd
  0x1c061d40: fa fa fd fd fd fd fa fa 00 00 00 00 fa fa 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:   00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:   fa
  Heap right redzone:  fb
  Freed heap region:   fd
  Stack left redzone:  f1
  Stack mid redzone:   f2
  Stack right redzone: f3
  Stack partial redzone:   f4
  Stack after return:  f5
  Stack use after scope:   f8
  Global redzone:  f9
  Global init order:   f6
  Poisoned by user:f7
  Container overflow:  fc
  Array cookie:ac
  Intra object redzone:bb
  ASan internal:   fe
  Left alloca redzone: ca
  Right alloca redzone:cb
==1

[issue28923] Nonexisting encoding specified in Tix.py

2016-12-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, CPython tokenizer recognizes encoding starting with "iso-latin-1-" as 
"iso-8859-1" (see get_normal_name() in Parser/tokenizer.c:228).

I agreed that coding cookie or all line can be removed from Tix.py. Please do 
that.

--
assignee:  -> terry.reedy

___
Python tracker 

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



[issue28963] Use-after-free in _asynciomodule.c

2016-12-13 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +inada.naoki

___
Python tracker 

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



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

2016-12-13 Thread Xavier de Gaye

Xavier de Gaye added the comment:

test_pathlib must also be fixed for this same problem.
New patch.

--
Added file: http://bugs.python.org/file45878/bind_unix_socket_2.patch

___
Python tracker 

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



[issue28876] bool of large range raises OverflowError

2016-12-13 Thread Mark Dickinson

Mark Dickinson added the comment:

Patch LGTM. You could safely drop the initialisers beyond `nb_bool` in the 
`range_as_number` struct (per C99 6.7.8p21), but it's fine as it is.

--

___
Python tracker 

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



[issue28963] Use-after-free in _asynciomodule.c

2016-12-13 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +giampaolo.rodola, gvanrossum, haypo, yselivanov

___
Python tracker 

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



[issue11007] stack tracebacks should give the relevant class name

2016-12-13 Thread Camilla Montonen

Camilla Montonen added the comment:

Reproduced original issue in 3.5.1.

--
nosy: +Winterflower
versions: +Python 3.5 -Python 3.3

___
Python tracker 

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



[issue16058] ConfigParser no longer deepcopy compatible in 2.7

2016-12-13 Thread Camilla Montonen

Changes by Camilla Montonen :


--
nosy: +Winterflower

___
Python tracker 

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



[issue28962] Crash when throwing an exception with a malicious __hash__ override

2016-12-13 Thread Josh Rosenberg

Josh Rosenberg added the comment:

Is this something that needs to be defended against? My understanding is that 
it's pretty easy to segfault CPython in a number of ways if you can execute 
100% arbitrary code. The only way to cause this problem is if you can define 
malicious exceptions and cause one to be raised from itself, neither of which 
occurs in reasonable code.

--
nosy: +josh.r

___
Python tracker 

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



[issue17430] missed peephole optimization

2016-12-13 Thread Camilla Montonen

Changes by Camilla Montonen :


--
nosy: +Winterflower

___
Python tracker 

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



[issue28944] A lack of line 6

2016-12-13 Thread Josh Rosenberg

Changes by Josh Rosenberg :


--
nosy:  -josh.r

___
Python tracker 

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



[issue11007] stack tracebacks should give the relevant class name

2016-12-13 Thread Zachary Ware

Zachary Ware added the comment:

__qualname__ has become a thing since this issue was opened, it may make 
implementation of this feature significantly easier.

--
nosy: +zach.ware
versions: +Python 3.7 -Python 3.5

___
Python tracker 

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



[issue17430] missed peephole optimization

2016-12-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

FYI this optimization is already implemented in 3.5+.

>>> def fo():
...   if a:
... if b:
...  if c:
...print()
... 
>>> import dis
>>> dis.dis(fo)
  2   0 LOAD_GLOBAL  0 (a)
  2 POP_JUMP_IF_FALSE   18

  3   4 LOAD_GLOBAL  1 (b)
  6 POP_JUMP_IF_FALSE   18

  4   8 LOAD_GLOBAL  2 (c)
 10 POP_JUMP_IF_FALSE   18

  5  12 LOAD_GLOBAL  3 (print)
 14 CALL_FUNCTION0
 16 POP_TOP
>>   18 LOAD_CONST   0 (None)
 20 RETURN_VALUE

--
nosy: +serhiy.storchaka
resolution:  -> out of date
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



[issue28962] Crash when throwing an exception with a malicious __hash__ override

2016-12-13 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies: +CPython hangs on error __context__ set to the error itself

___
Python tracker 

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



[issue16058] ConfigParser no longer deepcopy compatible in 2.7

2016-12-13 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies: +Regex objects became uncopyable in 2.5

___
Python tracker 

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



[issue28964] AST literal_eval exceptions provide no information about line number

2016-12-13 Thread Steve Merritt

New submission from Steve Merritt:

Without line numbers, debugging syntax errors in large documents is a tedious 
and painful process.

--
components: Library (Lib)
files: mywork.patch
keywords: patch
messages: 283142
nosy: stevemerritt
priority: normal
severity: normal
status: open
title: AST literal_eval exceptions provide no information about line number
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file45879/mywork.patch

___
Python tracker 

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



[issue26876] Extend MSVCCompiler class to respect environment variables

2016-12-13 Thread Rohit Jamuar

Changes by Rohit Jamuar :


Removed file: http://bugs.python.org/file42725/distutils_patch_master.patch

___
Python tracker 

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



[issue26876] Extend MSVCCompiler class to respect environment variables

2016-12-13 Thread Rohit Jamuar

Changes by Rohit Jamuar :


Added file: http://bugs.python.org/file45880/distutils_patch_master.patch

___
Python tracker 

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



[issue28963] Use-after-free in _asynciomodule.c

2016-12-13 Thread Yury Selivanov

Yury Selivanov added the comment:

Oh, this is a release blocker. I'll take a look later today.

--

___
Python tracker 

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



[issue26876] Extend MSVCCompiler class to respect environment variables

2016-12-13 Thread Rohit Jamuar

Changes by Rohit Jamuar :


Removed file: http://bugs.python.org/file45880/distutils_patch_master.patch

___
Python tracker 

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



[issue26876] Extend MSVCCompiler class to respect environment variables

2016-12-13 Thread Rohit Jamuar

Changes by Rohit Jamuar :


Added file: http://bugs.python.org/file45881/distutils_patch_master.patch

___
Python tracker 

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



[issue13290] get vars for object with __slots__

2016-12-13 Thread Steven D'Aprano

Steven D'Aprano added the comment:

I independently raised this on Python-Ideas and the initial responses are that 
vars() should support objects with slots too.

https://mail.python.org/pipermail/python-ideas/2016-December/043965.html

--
nosy: +steven.daprano
versions: +Python 3.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



[issue28963] Use-after-free in _asynciomodule.c

2016-12-13 Thread Yury Selivanov

Yury Selivanov added the comment:

I think the bug is only in _asyncio_Future_remove_done_callback, since 
future_schedule_callbacks makes a slice first, which cannot be mutated.

I'm attaching a patch.  Inada, would you be able to take a look?

--
keywords: +patch
nosy: +ned.deily
priority: normal -> release blocker
Added file: http://bugs.python.org/file45882/Issue28963.patch

___
Python tracker 

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



[issue28963] Use-after-free in _asynciomodule.c

2016-12-13 Thread Ned Williamson

Ned Williamson added the comment:

yselivanov, ah I think you're right. I misread that function after I noticed 
the issue in the first one.

--

___
Python tracker 

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



[issue26110] Speedup method calls 1.2x

2016-12-13 Thread Yury Selivanov

Yury Selivanov added the comment:

Inada-san, when I tested the patch last time, I think there was a regression 
somewhere, related to the descriptor protocol.  Have you fixed that one?

--

___
Python tracker 

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



[issue26110] Speedup method calls 1.2x

2016-12-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 64afd5cab40a by Yury Selivanov in branch 'default':
Issue #26110: Add LOAD_METHOD/CALL_METHOD opcodes.
https://hg.python.org/cpython/rev/64afd5cab40a

--
nosy: +python-dev

___
Python tracker 

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



[issue26110] Speedup method calls 1.2x

2016-12-13 Thread Yury Selivanov

Yury Selivanov added the comment:

> Inada-san, when I tested the patch last time, I think there was a regression 
> somewhere, related to the descriptor protocol.  Have you fixed that one?

Seems to be either fixed, or maybe those bugs were related to my opcode cache 
patch.  Anyways, I decided to commit the patch to 3.7, otherwise it might miss 
the commit window as it did for 3.6.  Let's fix any regressions right in the 
repo now.

> My current idea is adding new `tp_fastcall` slot which has same signature
to _PyFunction_FastCallDict or _PyCFunction_FastCallDict.

I like this idea!

Thanks Inada-san for pushing this patch through, and thanks to Serhiy for 
reviewing it.

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



[issue28965] Multiprocessing spawn/forkserver fails to pass Queues

2016-12-13 Thread Sean Murphy

New submission from Sean Murphy:

Python fails to pass a Queue when calling Process with 
multiprocessing.set_start_method set to "spawn" or "forkserver".

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3.5/multiprocessing/spawn.py", line 106, in spawn_main
exitcode = _main(fd)
  File "/usr/lib/python3.5/multiprocessing/spawn.py", line 116, in _main
self = pickle.load(from_parent)
  File "/usr/lib/python3.5/multiprocessing/synchronize.py", line 111, in 
__setstate__
self._semlock = _multiprocessing.SemLock._rebuild(*state)
FileNotFoundError: [Errno 2] No such file or directory


Here is a minimized example:
```
#!/usr/bin/env python3

import multiprocessing

def check_child(q):
print("Queue", q)


if __name__ == '__main__':
multiprocessing.set_start_method('spawn')
# multiprocessing.set_start_method('fork')
# multiprocessing.set_start_method('forkserver')

q = multiprocessing.Queue(-1)
print("q", q)

proc = multiprocessing.Process(target=check_child, args=(q,))
proc.start()
```

Also, this fails when the Queue is implicitly passed to the child.
```
class Blerg():
def __init__(self):
self.q = multiprocessing.Queue(-1)

def print_queue(self):
print("Queue", self.q)


if __name__ == '__main__':
multiprocessing.set_start_method('spawn')

blerg = Blerg()

blerg.print_queue()

proc = multiprocessing.Process(target=blerg.print_queue)
proc.start()
```

$ python3 --version
Python 3.5.2

Windows (which defaults to "spawn" style multiprocessing) does not seem to have 
this issue (at least in 2.7.12).

--
components: Library (Lib)
messages: 283150
nosy: Sean Murphy
priority: normal
severity: normal
status: open
title: Multiprocessing spawn/forkserver fails to pass Queues
type: crash
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



[issue28091] Document PEP 525

2016-12-13 Thread Yury Selivanov

Yury Selivanov added the comment:

> I believe that I addressed all the comments in the previous review (although 
> its always possible I missed something), and have a new patch with the 
> improvements and fixes.

Thanks Eric!  I've left a few more comments in the review.  Almost there!

> I also noticed that in asyncio, loop.shutdown_asyncgens() is a 
> coroutinemethod and fixed the markup to reflect that as I previously labeled 
> it a method. The example I added here is as suggested, but it differs from 
> the example in PEP525 in that shutdown_asyncgens() is run in a finally 
> clause, which makes sense to me.

Right, I'll fix the PEP. Thanks!

--

___
Python tracker 

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



  1   2   >