[issue28115] Use argparse for the zipfile module

2016-09-13 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Options and arguments for zipfile CLI are manually parsed for now. Since CLI 
becomes more complex, it is worth to convert zipfile to use argparse.

--
components: Demos and Tools
keywords: easy
messages: 276191
nosy: SilentGhost, serhiy.storchaka, sjt
priority: normal
severity: normal
stage: needs patch
status: open
title: Use argparse for the zipfile module
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



[issue28116] Error in what's new - PEP 515

2016-09-13 Thread Pierre Ducroquet

New submission from Pierre Ducroquet:

The what's new section about PEP 515 says :
«With PEP 515, though, you can use underscores to separate digits as desired to 
make numeric literals easier to read: 1_000_000_000_000_000. Underscores can be 
used with other numeric literals beyond integers, e.g. 0x_FF_FF_FF_FF.»

As far as I know, 0x is 2 ** 32 - 1, an integer.
I think the author meant «beyond decimals»

--
assignee: docs@python
components: Documentation
messages: 276192
nosy: Pierre Ducroquet, docs@python
priority: normal
severity: normal
status: open
title: Error in what's new - PEP 515
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



[issue17188] Document 'from None' in raise statement doc.

2016-09-13 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy:  -petri.lehtinen

___
Python tracker 

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



[issue28117] warning: dereferencing type-punned pointer will break strict-aliasing rules

2016-09-13 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

In file included from /home/serhiy/py/cpython/Modules/_sha3/sha3module.c:113:0:
/home/serhiy/py/cpython/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c: In 
function ‘_PySHA3_KeccakP1600_SetBytesInLaneToZero’:
/home/serhiy/py/cpython/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c:97:5: 
warning: dereferencing type-punned pointer will break strict-aliasing rules 
[-Wstrict-aliasing]
 low = *((UINT32*)(laneAsBytes+0));
 ^
In file included from /home/serhiy/py/cpython/Modules/_sha3/sha3module.c:113:0:
/home/serhiy/py/cpython/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c: In 
function ‘_PySHA3_KeccakP1600_AddBytesInLane’:
/home/serhiy/py/cpython/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c:152:5: 
warning: dereferencing type-punned pointer will break strict-aliasing rules 
[-Wstrict-aliasing]
 low = *((UINT32*)(laneAsBytes+0));
 ^
/home/serhiy/py/cpython/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c: In 
function ‘_PySHA3_KeccakP1600_ExtractBytesInLane’:
/home/serhiy/py/cpython/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c:296:5: 
warning: dereferencing type-punned pointer will break strict-aliasing rules 
[-Wstrict-aliasing]
 *((UINT32*)(laneAsBytes+0)) = low;
 ^
/home/serhiy/py/cpython/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c: In 
function ‘_PySHA3_KeccakP1600_ExtractAndAddBytesInLane’:
/home/serhiy/py/cpython/Modules/_sha3/kcp/KeccakP-1600-inplace32BI.c:369:5: 
warning: dereferencing type-punned pointer will break strict-aliasing rules 
[-Wstrict-aliasing]
 *((UINT32*)(laneAsBytes+0)) = low;
 ^

--
components: Extension Modules
messages: 276193
nosy: christian.heimes, mark.dickinson, serhiy.storchaka
priority: normal
severity: normal
status: open
title: warning: dereferencing type-punned pointer will break strict-aliasing 
rules
type: compile error
versions: 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



[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2016-09-13 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy:  -petri.lehtinen

___
Python tracker 

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



[issue28117] warning: dereferencing type-punned pointer will break strict-aliasing rules

2016-09-13 Thread Christian Heimes

Changes by Christian Heimes :


--
dependencies: +Add SHA-3 and SHAKE (Keccak) support
stage:  -> needs patch

___
Python tracker 

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



[issue28114] Crash in unicodeobject.c find_maxchar_surrogates on python-3.6.0b1 for Windows

2016-09-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

end-begin = 0x004550fc90512200-0x00454c49464f5250 = 5168087289776

Seems find_maxchar_surrogates() is called with wrong arguments.

--
nosy: +serhiy.storchaka
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



[issue28118] type-limits warning in PyMem_New() _ssl_locks_count

2016-09-13 Thread Christian Heimes

New submission from Christian Heimes:

Since last week I'm getting a compiler warning in _ssl.c. The compiler warning 
is related to the type of _ssl_locks_count. It's an unsigned. When I cast it to 
an int like PyMem_New(PyThread_type_lock, (int)_ssl_locks_count), the warning 
goes away.

gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -g -Og -Wall 
-Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter 
-Wno-missing-field-initializers -I./Include -I. -IInclude -I/usr/local/include 
-I/home/heimes/dev/python/3.6/Include -I/home/heimes/dev/python/3.6 -c 
/home/heimes/dev/python/3.6/Modules/_ssl.c -o 
build/temp.linux-x86_64-3.6-pydebug/home/heimes/dev/python/3.6/Modules/_ssl.o
In file included from ./Include/Python.h:66:0,
 from /home/heimes/dev/python/3.6/Modules/_ssl.c:19:
/home/heimes/dev/python/3.6/Modules/_ssl.c: In function ‘_setup_ssl_threads’:
./Include/pymem.h:136:18: warning: comparison is always false due to limited 
range of data type [-Wtype-limits]
   ( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
  ^
/home/heimes/dev/python/3.6/Modules/_ssl.c:5076:22: note: in expansion of macro 
‘PyMem_New’
 _ssl_locks = PyMem_New(PyThread_type_lock, _ssl_locks_count);
  ^

Also see #17884

--
components: Extension Modules
messages: 276195
nosy: christian.heimes, haypo
priority: normal
severity: normal
stage: needs patch
status: open
type: compile error
versions: 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



[issue28118] type-limits warning in PyMem_New() _ssl_locks_count

2016-09-13 Thread STINNER Victor

STINNER Victor added the comment:

It's related to new enabled GCC warnings: see issue #23545 where the warning 
was already reported.

The code is fine. It's just hard to compute the limits of a data type in a C 
macro :-/

--

___
Python tracker 

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



[issue28118] type-limits warning in PyMem_New() _ssl_locks_count

2016-09-13 Thread SilentGhost

SilentGhost added the comment:

It seems to be also related to #23545 (Martin saw a similar warning about a 
month ago).

--
nosy: +SilentGhost, martin.panter, serhiy.storchaka

___
Python tracker 

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



[issue28119] Explicit null dereferenced in formatter_unicode.c

2016-09-13 Thread Christian Heimes

New submission from Christian Heimes:

Coverity is warning about four cases of potential NULL forwarding in which 
subsequent code does not expect a NULL value.

30. no_write_call: Although get_locale_info does overwrite locale.decimal_point 
on some paths, it also contains at least one feasible path which does not 
overwrite it.

1140/* Calculate how much memory we'll need. */
CID 1372743: Explicit null dereferenced (FORWARD_NULL) [select issue]
CID 1372744: Explicit null dereferenced (FORWARD_NULL) [select issue]
CID 1372745 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)21. 
var_deref_model: Passing &locale to calc_number_widths, which dereferences null 
locale.grouping. [show details]
1141n_total = calc_number_widths(&spec, 0, sign_char, unicode_tmp, index,
1142 index + n_digits, n_remainder, has_decimal,
1143 &locale, format, &maxchar);


1322/* Calculate how much memory we'll need. */
CID 1372742 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)32. 
var_deref_model: Passing &locale to calc_number_widths, which dereferences null 
locale.decimal_point. [show details]
1323n_re_total = calc_number_widths(&re_spec, 0, re_sign_char, 
re_unicode_tmp,
1324i_re, i_re + n_re_digits, 
n_re_remainder,
1325re_has_decimal, &locale, &tmp_format,
1326&maxchar);

--
components: Interpreter Core
messages: 276198
nosy: christian.heimes
priority: normal
severity: normal
stage: test needed
status: open
title: Explicit null dereferenced in formatter_unicode.c
type: behavior
versions: 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



[issue28118] type-limits warning in PyMem_New() _ssl_locks_count

2016-09-13 Thread Christian Heimes

Christian Heimes added the comment:

I'm going to add a workaround.  _ssl_locks_count is an unsigned int because 
CRYPTO_num_locks() returns an unsigned int. We can safely use a signed int 
here. OpenSSL needs about 20, 30 locks or so.

--

___
Python tracker 

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



[issue28111] geometric_mean can raise OverflowError when checking for inf

2016-09-13 Thread Mark Dickinson

Mark Dickinson added the comment:

For reference, here's the full traceback. Issue #27975 isn't relevant here - 
the problem is an out-of-range integer being passed to the math.pow operation.

taniyama:cpython-git mdickinson$ ./python.exe
Python 3.7.0a0 (default, Sep 13 2016, 08:36:28) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import statistics
>>> statistics.geometric_mean(0.7 for _ in range(5000))
Traceback (most recent call last):
  File "/Users/mdickinson/Python/cpython-git/Lib/statistics.py", line 343, in 
float_nroot
isinfinity = math.isinf(x)
OverflowError: int too large to convert to float

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/mdickinson/Python/cpython-git/Lib/statistics.py", line 578, in 
geometric_mean
s = 2**p * _nth_root(2**q, n)
  File "/Users/mdickinson/Python/cpython-git/Lib/statistics.py", line 330, in 
nth_root
return _nroot_NS.float_nroot(x, n)
  File "/Users/mdickinson/Python/cpython-git/Lib/statistics.py", line 345, in 
float_nroot
return _nroot_NS.bignum_nroot(x, n)
  File "/Users/mdickinson/Python/cpython-git/Lib/statistics.py", line 472, in 
bignum_nroot
b = 2**q * _nroot_NS.nroot(2**r, n)
  File "/Users/mdickinson/Python/cpython-git/Lib/statistics.py", line 365, in 
nroot
r1 = math.pow(x, 1.0/n)
OverflowError: int too large to convert to float

--

___
Python tracker 

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



[issue28040] compact dict : SystemError: returned NULL without setting an error.

2016-09-13 Thread Xiang Zhang

Xiang Zhang added the comment:

> assert list(b.__dict__.keys()) == ['b', 'a'])  # AssertionError!

No, there is no error. Once an pending slot is encountered it is combined. But 
inserting pending slots is prohibited and it's far from ideal. 

We need to know if the pending slot is the last entry or not. But it seems we 
can't achieve it using the current implementation. Sad. :(

In short, I give up. Sorry for the noise.

--

___
Python tracker 

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



[issue28040] compact dict : SystemError: returned NULL without setting an error.

2016-09-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 579141d6e353 by Victor Stinner in branch 'default':
Issue #28040: Cleanup find_empty_slot()
https://hg.python.org/cpython/rev/579141d6e353

--

___
Python tracker 

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



[issue27889] ctypes interfers with signal handling

2016-09-13 Thread Andre Merzky

Andre Merzky added the comment:

FWIW, a workaround seems to be a nested try/except clause:

try:
  try:
do_lots_of_work()
  except RuntimeError as e:
print 'signal handling worked'
except RuntimeError:
  print 'signal handling delayed'

I did a stress test over 100k runs, and got no unexpected behavior that way.  I 
am not sure if the underlying race condition is just hidden, or if the inner 
except clause triggers the signal handling code internally -- either way, while 
cumbersome to use, it seems to work.

I'd still appreciate feedback on a cleaner solution.

Thanks, Andre.

--

___
Python tracker 

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



[issue28120] The Blaze test suite segfaults with 4a5b61b0d090

2016-09-13 Thread STINNER Victor

New submission from STINNER Victor:

In the issue #4a5b61b0d090, Stefan Krah wrote: "The Blaze test suite segfaults 
with 4a5b61b0d090". I may be related to compact dict and the issue #28040.

Stefan: Can you please explain what is Blaze? Explain how to reproduce the 
issue? Try to get the Python traceback?

Did you try a debug build? If you use a release build, please set the env var 
PYTHONMALLOC=debug.

"""
Blaze is pushing Python's dynamic capabilities to absolute limits,
so perhaps this is specific to a few applications only.

For Blaze *itself* there is no difference whether this is fixed now
or in the next beta.  So releasing 3.6.0b1  now and setting this back
to blocker afterwards sounds good to me.
"""

and

"""
It could still be a stack overflow, but on the surface it does
not look like one. It's definitely related to the aforementioned
revision:

==3442== Invalid read of size 8
==3442==at 0x49DBD8: _PyDict_Pop (dictobject.c:1743)
==3442==by 0x4A0BE2: dict_pop (dictobject.c:2732)
==3442==by 0x4AA5F8: _PyCFunction_FastCallDict (methodobject.c:229)
==3442==by 0x4AA70B: _PyCFunction_FastCallKeywords (methodobject.c:267)
==3442==by 0x55FE63: call_function (ceval.c:4794)
==3442==by 0x55AA82: _PyEval_EvalFrameDefault (ceval.c:3267)
==3442==by 0x54D9CC: PyEval_EvalFrameEx (ceval.c:718)
==3442==by 0x560123: _PyFunction_FastCall (ceval.c:4876)
==3442==by 0x56023B: fast_function (ceval.c:4906)
==3442==by 0x55FF91: call_function (ceval.c:4815)
==3442==by 0x55AA82: _PyEval_EvalFrameDefault (ceval.c:3267)
==3442==by 0x54D9CC: PyEval_EvalFrameEx (ceval.c:718)
==3442==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==3442== 
==3442== 
==3442== Process terminating with default action of signal 11 (SIGSEGV)
==3442==  Access not within mapped region at address 0x0
==3442==at 0x49DBD8: _PyDict_Pop (dictobject.c:1743)
==3442==by 0x4A0BE2: dict_pop (dictobject.c:2732)
==3442==by 0x4AA5F8: _PyCFunction_FastCallDict (methodobject.c:229)
==3442==by 0x4AA70B: _PyCFunction_FastCallKeywords (methodobject.c:267)
==3442==by 0x55FE63: call_function (ceval.c:4794)
==3442==by 0x55AA82: _PyEval_EvalFrameDefault (ceval.c:3267)
==3442==by 0x54D9CC: PyEval_EvalFrameEx (ceval.c:718)
==3442==by 0x560123: _PyFunction_FastCall (ceval.c:4876)
==3442==by 0x56023B: fast_function (ceval.c:4906)
==3442==by 0x55FF91: call_function (ceval.c:4815)
==3442==by 0x55AA82: _PyEval_EvalFrameDefault (ceval.c:3267)
==3442==by 0x54D9CC: PyEval_EvalFrameEx (ceval.c:718)
"""

--
messages: 276204
nosy: haypo, methane, skrah
priority: normal
severity: normal
status: open
title: The Blaze test suite segfaults with 4a5b61b0d090
type: crash
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



[issue28077] Fix find_empty_slot in dictobject

2016-09-13 Thread Xiang Zhang

Changes by Xiang Zhang :


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



[issue28077] Fix find_empty_slot in dictobject

2016-09-13 Thread Berker Peksag

Berker Peksag added the comment:

Victor committed the patch in msg276042 in 579141d6e353.

--
nosy: +berker.peksag

___
Python tracker 

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



[issue28040] compact dict : SystemError: returned NULL without setting an error.

2016-09-13 Thread STINNER Victor

STINNER Victor added the comment:

Stefan Krah: "It could still be a stack overflow, but on the surface it does 
not look like one. It's definitely related to the aforementioned
revision: (...)"

The initial bug reported in this issue is now fixed. Even if the Blaze issue is 
related, I would really prefer to discuss it in a different issue, so I created 
#28120: "The Blaze test suite segfaults with 4a5b61b0d090".

@Xiang: I simplified find_empty_slot() to remove code to support split table. 
Again, if you want to support deletion in split table, please open a new issue.

I now close this issue. Thanks for the report Matthias! Thanks for the quick 
fix and the unit test Naoki!

--

___
Python tracker 

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



[issue28040] compact dict : SystemError: returned NULL without setting an error.

2016-09-13 Thread STINNER Victor

Changes by STINNER Victor :


--
status: open -> closed

___
Python tracker 

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



[issue27322] test_compile_path fails when python has been installed

2016-09-13 Thread STINNER Victor

STINNER Victor added the comment:

test_compileall depends on sys.path? It doesn't seem reliable to me.

I suggest to create a temporary directory and replace sys.path to only have one 
item: this directory.

I don't know which files are expected to be there, but we can probably copy .py 
to this temporary directory.

What do you think?

--

___
Python tracker 

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



[issue20825] containment test for "ip_network in ip_network"

2016-09-13 Thread Michel Albert

Michel Albert added the comment:

Are there any updates on this? Not sure if it's too late again to get it 
applied for the next Python (3.6) release?

--

___
Python tracker 

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



[issue28077] Fix find_empty_slot in dictobject

2016-09-13 Thread STINNER Victor

STINNER Victor added the comment:

> Victor committed the patch in msg276042 in 579141d6e353.

Well, my change is a little bit different than find_empty_slot.patch. I removed 
the return value and I kept "ep = &ep0[mp->ma_keys->dk_nentries];".

--

___
Python tracker 

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



[issue28117] warning: dereferencing type-punned pointer will break strict-aliasing rules

2016-09-13 Thread Christian Heimes

Christian Heimes added the comment:

The compile warning occurs on 32bit builds only: 
http://buildbot.python.org/all/builders/x86%20Gentoo%20Non-Debug%20with%20X%203.x

--

___
Python tracker 

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



[issue28121] If module starts with comment or empty line then frame.f_code.co_firstlineno is inconsistent with inspect.findsource

2016-09-13 Thread Aivar Annamaa

New submission from Aivar Annamaa:

Following program shows that frame.f_code.co_firstlineno ignores first line if 
it is a comment (or empty line), but inspect.getsource(frame.f_code) returns 
also the first line:

# first line
import inspect
frame = inspect.currentframe()
print(frame.f_code.co_firstlineno)
print(inspect.findsource(frame.f_code))

--
messages: 276211
nosy: Aivar.Annamaa
priority: normal
severity: normal
status: open
title: If module starts with comment or empty line then 
frame.f_code.co_firstlineno is inconsistent with inspect.findsource

___
Python tracker 

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



[issue28121] If module starts with comment or empty line then frame.f_code.co_firstlineno is inconsistent with inspect.findsource

2016-09-13 Thread Aivar Annamaa

Changes by Aivar Annamaa :


--
components: +Interpreter Core
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



[issue28118] type-limits warning in PyMem_New() _ssl_locks_count

2016-09-13 Thread Martin Panter

Martin Panter added the comment:

As Serhiy suggested in the other bug, one workaround is just to disable the 
warning with -Wno-type-limits. It would depend if the benefits of the warning 
outweigh the annoyance of coming up with a more complicated workaround for this 
specific case.

--

___
Python tracker 

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



[issue28118] type-limits warning in PyMem_New() _ssl_locks_count

2016-09-13 Thread Christian Heimes

Christian Heimes added the comment:

The code is going to go away with OpenSSL 1.1.0.

--

___
Python tracker 

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



[issue28122] email.header.decode_header can not decode string with quotation

2016-09-13 Thread sijian liang

Changes by sijian liang :


--
components: email
files: demo.py
nosy: barry, r.david.murray, sijian liang
priority: normal
severity: normal
status: open
title: email.header.decode_header can not decode string with quotation
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file44624/demo.py

___
Python tracker 

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



[issue28122] email.header.decode_header can not decode string with quotation

2016-09-13 Thread sijian liang

New submission from sijian liang:

#!/usr/bin/python
#-*- coding:utf-8 -*-
import email
# from email.parser import Parser
def decode_email_header(header, sep=''):
l = []
for s, c in header:
if c:
l.append(s.decode(c))
else:
l.append(s)
return sep.join(l)
s = email.Header.decode_header('"=?gb18030?B?bWFpbGZvcnRlc3R0?=" 
<2070776...@qq.com>')
print decode_email_header(s)
s = email.Header.decode_header('=?gb18030?B?bWFpbGZvcnRlc3R0?= 
<2070776...@qq.com>')
print decode_email_header(s)


# see output:
#"=?gb18030?B?bWFpbGZvcnRlc3R0?=" <2070776...@qq.com>
#mailfortestt<2070776...@qq.com>

--

___
Python tracker 

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



[issue28114] Crash in unicodeobject.c find_maxchar_surrogates on python-3.6.0b1 for Windows

2016-09-13 Thread STINNER Victor

STINNER Victor added the comment:

> Trying to build numpy-1.11.2rc1 wheels for Python 3.6.0b1 on Windows 10 with 
> `python.exe setup.py bdist_wheel`, python36.dll (32 and 64 bit) segfaults in 
> the `find_maxchar_surrogates` function.

I ran "python setup.py bdist_wheel" on numpy-1.11.2rc1 on Linux: no issue.

I compiled Python 3.6 (the default branch in fact, so the future 3.7) in debug 
mode/64 bit with SSL, but the setup.py command failed with:

   Don't know how to compile Fortran code on platform 'nt'

I don't want to spend too much time to try to reproduce the issue.

Can you please try to get the Python traceback? Try:

   python -X faulthandler setup.py bdist_wheel

It seems like the crash occurs in parse_envlist(), function to parse 
environment variables in os.spawnve(). Can you try to dump the env parameter of 
os.spawnve()?

For example, you can put the following lines at the beginning of setup.py:

---
import os
orig_spawnve = os.spawnve

def log_spawnve(*args):
print("spawnve: %r" % (args,))
return orig_spawnve(*args)

os.spawnve = log_spawnve
---

My test:
---
>>> import os, sys; args=[sys.executable, "-c", "pass"]; os.spawnve(os.P_WAIT, 
>>> args[0], args, None)
spawnve: (0, '/home/haypo/prog/python/default/python', 
['/home/haypo/prog/python/default/python', '-c', 'pass'], None)
127
---

--

___
Python tracker 

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



[issue23102] distutils: isinstance checks fail with setuptools-monkeypatched Extension/Distribution

2016-09-13 Thread Jens Timmerman

Jens Timmerman added the comment:

small setup.py file to reproduce this problem if people still had trouble 
reproducing (this works with the attached 
d002-distutils-type-checks-can-fail-issue-23102.patch)

```
#!/usr/bin/env python
''' Installation script that breaks '''

from distutils.command import install
from distutils.core import setup

class installer(install.install):
def run(self):
import setuptools
install.install.run(self)


setup(name='test',
  cmdclass = dict(install=installer)
 )

```
run with: 
python setup.py install --user
result:
```
running install
running build
running install_egg_info
Traceback (most recent call last):
  File "mysetup.py", line 14, in 
cmdclass = dict(install=installer)
  File "/usr/lib64/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
  File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
  File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
  File "mysetup.py", line 10, in run
install.install.run(self)
  File "/usr/lib64/python2.7/distutils/command/install.py", line 575, in run
self.run_command(cmd_name)
  File "/usr/lib64/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
  File "/usr/lib64/python2.7/distutils/dist.py", line 970, in run_command
cmd_obj = self.get_command_obj(command)
  File "/usr/lib64/python2.7/distutils/dist.py", line 846, in get_command_obj
cmd_obj = self.command_obj[command] = klass(self)
  File "/usr/lib64/python2.7/distutils/cmd.py", line 59, in __init__
raise TypeError, "dist must be a Distribution instance"
TypeError: dist must be a Distribution instance
```
expected result:
```
running install
running build
running install_egg_info
Writing /home/jens/.local/lib/python2.7/site-packages/test-0.0.0-py2.7.egg-info
```

--

___
Python tracker 

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



[issue22458] Add fractions benchmark

2016-09-13 Thread STINNER Victor

STINNER Victor added the comment:

The issue is not closed, but moved to 
https://github.com/python/performance/pull/10

Please continue the discussion there. I'm now slowly trying to move benchmark 
issues to GitHub.

--
resolution:  -> third party
status: open -> closed

___
Python tracker 

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



[issue26284] Fix telco benchmark

2016-09-13 Thread STINNER Victor

STINNER Victor added the comment:

Sorry, I'm not sure if you want to make any change to bm_telco.py of the 
performance. If yes, please open an issue at 
https://github.com/python/performance

> So LGTM.

Hum, it looks like you are happy, so I now close this issue :-) I'm slowly 
trying to move discussions related to benchmarking to the performance module on 
GitHub.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue26436] Add the regex-dna benchmark

2016-09-13 Thread STINNER Victor

STINNER Victor added the comment:

Serhiy: Can you please open a pull request on the new performance module? 
https://github.com/python/performance

--
nosy: +haypo

___
Python tracker 

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



[issue28118] type-limits warning in PyMem_New() _ssl_locks_count

2016-09-13 Thread Martin Panter

Martin Panter added the comment:

Perhaps another way to defeat the warning is to make PyMem_New() an inline 
function? I haven’t tried, but this way would make all the data types involved 
more explicit.

--

___
Python tracker 

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



[issue28118] type-limits warning in PyMem_New() _ssl_locks_count

2016-09-13 Thread STINNER Victor

STINNER Victor added the comment:

Martin: "Perhaps another way to defeat the warning is to make PyMem_New() an 
inline function?"

See the issue #28092 for compilation issues of inline functions. We should 
decide if inline functions are ok or not.

--

___
Python tracker 

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



[issue28040] compact dict : SystemError: returned NULL without setting an error.

2016-09-13 Thread Stefan Krah

Stefan Krah added the comment:

I don't understand how the original issue is fixed if 1e7b636b6009
exhibits the SystemError and the very next revision 4a5b61b0d090
(the fix) segfaults.  And the test suite works with the previous
dict.

Sure, it can be a third party issue, but this constellation
*does* seem pretty strange.

Happy to discuss it in another issue though.

--

___
Python tracker 

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



[issue28040] compact dict : SystemError: returned NULL without setting an error.

2016-09-13 Thread STINNER Victor

STINNER Victor added the comment:

Stefan Krah: "I don't understand how the original issue is fixed if 1e7b636b6009
exhibits the SystemError"

"SystemError: returned NULL without setting an error" is a generic error, 
basically it says that a C function has bug :-) It's hard to know exactly which 
C function has the issue.


"and the very next revision 4a5b61b0d090 (the fix) segfaults"

A segfault is not a SystemError: it's a new bug.


"Sure, it can be a third party issue, but this constellation *does* seem pretty 
strange."

In case of doubt, I prefer to open a new issue. Please let's continue in the 
issue #28120 (see my questions there!).

--

___
Python tracker 

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



[issue28119] Explicit null dereferenced in formatter_unicode.c

2016-09-13 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +haypo, serhiy.storchaka

___
Python tracker 

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



[issue28120] The Blaze test suite segfaults with 4a5b61b0d090

2016-09-13 Thread Stefan Krah

Stefan Krah added the comment:

Sorry Victor, I have been reporting memory related issues for a long
time here. ;)

I'm already using Valgrind, why would I set PYTHONMALLOC=debug?

--

___
Python tracker 

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



[issue26383] benchmarks (perf.py): number of decimal places in csv output

2016-09-13 Thread STINNER Victor

STINNER Victor added the comment:

Thanks for the bug report. The issue has been fixed in performance:
https://github.com/python/performance/commit/2b63335248645ce7392c8cf835ef799d41beeeba

--
nosy: +haypo
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue28120] The Blaze test suite segfaults with 4a5b61b0d090

2016-09-13 Thread STINNER Victor

STINNER Victor added the comment:

> I'm already using Valgrind, why would I set PYTHONMALLOC=debug?

Valgrind doesn't understand Python frames. PYTHONMALLOC=debug can show you more 
information from Python internals, especially when using the tracemalloc module:
https://docs.python.org/dev/whatsnew/3.6.html#pythonmalloc-environment-variable

At this point, I'm not convinced that the issue comes from Python itself. It 
would help if at least you can explain how to reproduce the issue. What is 
Blaze? Where can I find it?

--

___
Python tracker 

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



[issue28121] If module starts with comment or empty line then frame.f_code.co_firstlineno is inconsistent with inspect.findsource

2016-09-13 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +yselivanov

___
Python tracker 

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



[issue15369] pybench and test.pystone poorly documented

2016-09-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 08a0b75904c6 by Victor Stinner in branch 'default':
Remove pybench microbenchmark
https://hg.python.org/cpython/rev/08a0b75904c6

--
nosy: +python-dev

___
Python tracker 

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



[issue28120] The Blaze test suite segfaults with 4a5b61b0d090

2016-09-13 Thread Stefan Krah

Stefan Krah added the comment:

Victor, I'm beginning to resent your tone.

--

___
Python tracker 

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



[issue15369] pybench and test.pystone poorly documented

2016-09-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e03c1b6830fd by Victor Stinner in branch 'default':
Remove pystone microbenchmark
https://hg.python.org/cpython/rev/e03c1b6830fd

--

___
Python tracker 

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



[issue28123] _PyDict_GetItem_KnownHash ignores DKIX_ERROR return

2016-09-13 Thread Xiang Zhang

New submission from Xiang Zhang:

_PyDict_GetItem_KnownHash should handle dk_lookup return value the same as 
PyDict_GetItem.

BTW, it seems PyDict_GetItem can call _PyDict_GetItem_KnownHash to remove 
duplicate code, if you like, maybe another issue?

diff -r 6acd2b575a3c Objects/dictobject.c
--- a/Objects/dictobject.c  Tue Sep 13 07:56:45 2016 +0300
+++ b/Objects/dictobject.c  Tue Sep 13 17:46:08 2016 +0800
@@ -1370,12 +1370,12 @@
 ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value_addr, NULL);
 /* ignore errors */
 PyErr_Restore(err_type, err_value, err_tb);
-if (ix == DKIX_EMPTY)
+if (ix < 0)
 return NULL;
 }
 else {
 ix = (mp->ma_keys->dk_lookup)(mp, key, hash, &value_addr, NULL);
-if (ix == DKIX_EMPTY) {
+if (ix < 0) {
 PyErr_Clear();
 return NULL;

--
components: Interpreter Core
messages: 276230
nosy: haypo, methane, xiang.zhang
priority: normal
severity: normal
status: open
title: _PyDict_GetItem_KnownHash ignores DKIX_ERROR return
type: behavior
versions: 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



[issue15369] pybench and test.pystone poorly documented

2016-09-13 Thread STINNER Victor

STINNER Victor added the comment:

We now have a good and stable benchmark suite: 
https://github.com/python/performance

I removed pystone and pybench from Python 3.7. Please use performance instead 
of old and not reliable microbenchmarks like pybench or pystone.

--
nosy: +haypo
resolution:  -> fixed
status: open -> closed
versions: +Python 3.7 -Python 3.3

___
Python tracker 

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



[issue28123] _PyDict_GetItem_KnownHash ignores DKIX_ERROR return

2016-09-13 Thread STINNER Victor

STINNER Victor added the comment:

Please create a patch file and attach it to the issue, so we can review it more 
easily.

--

___
Python tracker 

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



[issue28123] _PyDict_GetItem_KnownHash ignores DKIX_ERROR return

2016-09-13 Thread Xiang Zhang

Xiang Zhang added the comment:

Hmm, I thought this is trivial so I didn't. Now upload the file patch ;).

--
keywords: +patch
Added file: http://bugs.python.org/file44625/issue28123.patch

___
Python tracker 

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



[issue28114] Crash in unicodeobject.c find_maxchar_surrogates on python-3.6.0b1 for Windows

2016-09-13 Thread Eryk Sun

Eryk Sun added the comment:

parse_envlist is calling PyUnicode_FromFormat with the format "%U=%U", but 
passing it bytes:

|Debug Error!

Program: C:\Program Files\Python36\python_d.exe

abort() has been called

(Press Retry to debug the application)
(1e8.374): Break instruction exception - code 8003 (first chance)
ucrtbased!issue_debug_notification+0x45:
7ffc`aa1f1985 cc  int 3
1:002> k 0n12
Child-SP  RetAddr   Call Site
0030`a5fe9bb0 7ffc`aa1f1b23 ucrtbased!issue_debug_notification+0x45
0030`a5fe9c00 7ffc`aa212d7d 
ucrtbased!__acrt_report_runtime_error+0x13
0030`a5fe9c60 7ffc`aa2184cf ucrtbased!abort+0x1d
0030`a5fe9ca0 7ffc`aa2164c8 
ucrtbased!common_assert_to_stderr+0xbf
0030`a5fe9d00 7ffc`aa218e7f ucrtbased!common_assert+0x68
0030`a5fe9d40 `60e59045 ucrtbased!_wassert+0x2f
0030`a5fe9d70 `60eb9f71 
python36_d!_PyUnicode_CheckConsistency+0x45
0030`a5fe9e00 `60e4cd07 python36_d!unicode_fromformat_arg+0xc81
0030`a5fe9fa0 `60e4cc31 python36_d!PyUnicode_FromFormatV+0xa7
0030`a5fea040 `60c69853 python36_d!PyUnicode_FromFormat+0x31
0030`a5fea080 `60c68286 python36_d!parse_envlist+0x1c3
0030`a5fea180 `60c5d4ee python36_d!os_spawnve_impl+0x1d6

1:002> .frame 6
06 0030`a5fe9d70 `60eb9f71 
python36_d!_PyUnicode_CheckConsistency+0x45
1:002> ?? op->ob_type->tp_name
char * 0x`60fe1248
 "bytes"

parse_envlist used to call PyUnicode_FSConverter on key and val; get the 
underlying buffers via PyBytes_AsString; allocate a new buffer and copy key and 
val into "%s=%s". Now it instead calls PyUnicode_FromFormat for "%U=%U" and 
then fsconvert_strdup, which has been modified to call 
PyUnicode_AsWideCharString on Windows and otherwise PyUnicode_FSConverter. 

For Windows it could use PyUnicode_FSDecoder on key and val in combination with 
PyUnicode_FromFormat and the format string "%U=%U". For Unix it could use 
PyUnicode_FSConverter for key and val in combination with PyBytes_FromFormat 
and the format string "%s=%s".

--
nosy: +eryksun

___
Python tracker 

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



[issue28114] Crash in unicodeobject.c find_maxchar_surrogates on python-3.6.0b1 for Windows

2016-09-13 Thread STINNER Victor

STINNER Victor added the comment:

> parse_envlist is calling PyUnicode_FromFormat with the format "%U=%U", but 
> passing it bytes:

Ah, it's a regression introduced by the issue #27781 with the change 
e20c7d8a8187: parse_envlist() was modified to first call 
PyUnicode_FromFormat("%U=%U") and then convert.

--

___
Python tracker 

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



[issue28122] email.header.decode_header can not decode string with quotation

2016-09-13 Thread era

era added the comment:

The double quotes around the "human readable" part of the email address are not 
allowed.  Python is handling this correctly.

--
nosy: +era

___
Python tracker 

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



[issue28120] The Blaze test suite segfaults with 4a5b61b0d090

2016-09-13 Thread Stefan Krah

Changes by Stefan Krah :


--
nosy:  -skrah

___
Python tracker 

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



[issue28124] Rework SSL module documentation

2016-09-13 Thread Christian Heimes

New submission from Christian Heimes:

The documentation of the SSL module needs a rework. It's confusing and hard to 
understand even for experienced developers. The documentation should start with 
basic use cases and easy-to-reuse best practices.

* The module starts with move ssl.wrap_socket() but it's no longer best 
practice. The section should be moved down and favor of a quick introduction of 
SSLContext.

* ssl.create_default_context() is the best way to create a SSLContext. Mention 
that purpose flags and that Purpose.SERVER_AUTH is the correct setting on the 
client side. It means: "Create a context to authenticate the certs of a TLS 
server." (correct also for ftp, imap, ldap, smtp and so on).

* The protocol table is confusing and does not mention the meaning of 
PROTOCOL_SSLv23 (aka PROTOCOL_TLS). It's auto-negotiation of the highest TLS 
protocol version and takes OP_NO_* SSLContext.options into account. 
PROTOCOL_TLS_CLIENT and PROTOCOL_TLS_SERVER are the recommended options 
nowadays.

* Don't confront users with CERT_OPTIONAL in the first section. It's a super 
special mode for client cert authentication on the server side. On the client 
side, CERT_REQUIRED is the right mode with CERT_NONE as workaround. On the 
server side CERT_NONE (default) is usually the right setting.

* check_hostname is a client-side option that should be enabled all the time.

* Explain that users can load the public key of a  self-signed certificate like 
a CA cert to have cert validation even for self-signed certs.

--
assignee: docs@python
components: Documentation
messages: 276238
nosy: christian.heimes, docs@python
priority: high
severity: normal
stage: needs patch
status: open
title: Rework SSL module documentation
type: enhancement
versions: 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



[issue28123] _PyDict_GetItem_KnownHash ignores DKIX_ERROR return

2016-09-13 Thread STINNER Victor

STINNER Victor added the comment:

I understand the the code doesn't handle correctly lookup failures. Such 
failure is easy to trigger in pure Python using a custom __eq__() method for 
example. Can you please write an unit test for it?

--

___
Python tracker 

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



[issue28109] What's new item for PEP 526 -- Variable annotations

2016-09-13 Thread Ivan Levkivskyi

Changes by Ivan Levkivskyi :


Added file: http://bugs.python.org/file44626/whats-new-pep-526-v3a.diff

___
Python tracker 

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



[issue28123] _PyDict_GetItem_KnownHash ignores DKIX_ERROR return

2016-09-13 Thread Xiang Zhang

Xiang Zhang added the comment:

_PyDict_GetItem_KnownHash is not invoked by any other dict methods. So to 
achieve it in pure Python level, we have to rely on others modules and objects 
such as OrderedDict, lru_cache. Is it a good idea to rely on those?

--

___
Python tracker 

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



[issue28120] The Blaze test suite segfaults with 4a5b61b0d090

2016-09-13 Thread STINNER Victor

STINNER Victor added the comment:

See also the issue #28123: "_PyDict_GetItem_KnownHash ignores DKIX_ERROR 
return".

--

___
Python tracker 

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



[issue28114] Crash in unicodeobject.c find_maxchar_surrogates on python-3.6.0b1 for Windows

2016-09-13 Thread Eryk Sun

Eryk Sun added the comment:

Here's a snippet to reproduce this bug:

import os, sys
environb = {os.fsencode(k):os.fsencode(v) for k,v in os.environ.items()}
os.spawnve(os.P_WAIT, sys.executable, ('python', '--version'), environb)

(Now that Windows Python provisionally supports bytes via utf-8:surrogatepass, 
maybe it should also have an os.environb mapping.)

--

___
Python tracker 

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



[issue28123] _PyDict_GetItem_KnownHash ignores DKIX_ERROR return

2016-09-13 Thread STINNER Victor

STINNER Victor added the comment:

> _PyDict_GetItem_KnownHash is not invoked by any other dict methods.

Oh, I missed that. In this case, I suggest you to expose the function at Python 
level using the _testcapi module. And then use 
_testcapi._PyDict_GetItem_KnownHash() in test_dict.

It would be nice to have unit tests on _PyDict_GetItem_KnownHash(), this 
function starts to become important in Python.

--

___
Python tracker 

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



[issue28123] _PyDict_GetItem_KnownHash ignores DKIX_ERROR return

2016-09-13 Thread Xiang Zhang

Xiang Zhang added the comment:

How about let PyDict_GetItem call it? Just like the relationship of delitem and 
delitem_knownhash. You can see they share most codes. If we do that, it seems 
we can easily write a test(or there has already been a test) for it.

--

___
Python tracker 

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



[issue28046] Remove the concept of platform-specific directories

2016-09-13 Thread Matthias Klose

Matthias Klose added the comment:

I don't like the _PYTHON_SYSCONFIGDATA_NAME hack.  This should be based on the 
target, not on a name for just a particular file.  Following up on that in 
#28125.

--

___
Python tracker 

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



[issue28125] identify cross builds by a more generic environment setting.

2016-09-13 Thread Matthias Klose

New submission from Matthias Klose:

I don't like the _PYTHON_SYSCONFIGDATA_NAME hack introduced in #28046.  This 
should be based on the target, not on a name for just a particular file.  Plus 
the abi flags should not be set by hand, you'll get in trouble at least for 
naming extensions, or building extensions for the wrong abi flags. This was an 
explicit decision when I first started adding the cross-build changes.

So proposing instead to base a cross build on a _PYTHON_MULTIARCH environment 
variable and deriving the sysconfigdata name on that.

Working on a patch for that.

--
assignee: doko
components: Cross-Build
messages: 276244
nosy: Alex.Willmer, doko
priority: normal
severity: normal
status: open
title: identify cross builds by a more generic environment setting.
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



[issue28123] _PyDict_GetItem_KnownHash ignores DKIX_ERROR return

2016-09-13 Thread STINNER Victor

STINNER Victor added the comment:

Xiang Zhang added the comment:
> How about let PyDict_GetItem call it?

PyDict_GetItem() is like the most important function in term of
performance for Python. If you want to touch it, you must benchmark
it.

I would prefer to keep it as it is.

> Just like the relationship of delitem and delitem_knownhash.

delitem is less important in term of performance, so I decided to
accept Naoki's change to merge duplicated code.

--

___
Python tracker 

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



[issue28125] identify cross builds by a more generic environment setting.

2016-09-13 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo, zach.ware

___
Python tracker 

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



[issue28118] type-limits warning in PyMem_New() _ssl_locks_count

2016-09-13 Thread Martin Panter

Martin Panter added the comment:

I was thinking of “static inline” for PyMem_New(). I understand the Centos and 
OS X Tiger problem is only related “extern inline” vs plain “inline”, and 
“static inline” should not be affected.

--

___
Python tracker 

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



[issue28120] The Blaze test suite segfaults with 4a5b61b0d090

2016-09-13 Thread Christian Heimes

Christian Heimes added the comment:

The blaze test suite fails in pytest.

$ sudo dnf builddep python-numpy python-h5py
$ virtualenv -p ../bin/python3.6 venvblaze
$ cd venvblaze
$ bin/pip install install blaze pyyaml requests dask pytest h5py
bin/pytest -v lib/python3.6/site-packages/blaze/tests/test_sql.py 
=== test 
session starts 

platform linux -- Python 3.6.0b1+, pytest-3.0.2, py-1.4.31, pluggy-0.3.1 -- 
/home/heimes/dev/python/python3.6/blaze/bin/python3.6
cachedir: .cache
rootdir: /home/heimes/dev/python/python3.6/blaze, inifile: 
collected 16 items 

lib/python3.6/site-packages/blaze/tests/test_sql.py::test_column Aborted (core 
dumped)

#0  0x7711f6f5 in raise () from /lib64/libc.so.6
#1  0x771212fa in abort () from /lib64/libc.so.6
#2  0x77117f97 in __assert_fail_base () from /lib64/libc.so.6
#3  0x77118042 in __assert_fail () from /lib64/libc.so.6
#4  0x0048f12c in _PyDict_Pop (mp=mp@entry=0x7fffbc6bba30, 
key=0x7fffe07ab270, deflt=0x885ec0 <_Py_NoneStruct>) at 
Objects/dictobject.c:1743
#5  0x0048f274 in dict_pop (mp=0x7fffbc6bba30, args=) at 
Objects/dictobject.c:2736
#6  0x0049767d in _PyCFunction_FastCallDict 
(func_obj=func_obj@entry=0x7fffbc616850, args=args@entry=0x1c73600, 
nargs=nargs@entry=2, 
kwargs=kwargs@entry=0x0) at Objects/methodobject.c:234
#7  0x004978d4 in _PyCFunction_FastCallKeywords 
(func=func@entry=0x7fffbc616850, stack=stack@entry=0x1c73600, 
nargs=nargs@entry=2, 
kwnames=kwnames@entry=0x0) at Objects/methodobject.c:295
#8  0x00528c5e in call_function 
(pp_stack=pp_stack@entry=0x7fff1678, oparg=oparg@entry=2, 
kwnames=kwnames@entry=0x0) at Python/ceval.c:4763
#9  0x005321d4 in _PyEval_EvalFrameDefault (f=0x1c73448, 
throwflag=) at Python/ceval.c:3250
#10 0x00527d6b in PyEval_EvalFrameEx (f=f@entry=0x1c73448, 
throwflag=throwflag@entry=0) at Python/ceval.c:718
#11 0x00527e3b in _PyFunction_FastCall (co=, 
args=0x7fffbc6245e0, nargs=nargs@entry=2, globals=)
at Python/ceval.c:4845
#12 0x00528a8b in fast_function (func=func@entry=0x7fffe06e69b0, 
stack=, nargs=nargs@entry=2, kwnames=kwnames@entry=0x0)
at Python/ceval.c:4880
#13 0x00528d19 in call_function 
(pp_stack=pp_stack@entry=0x7fff1828, oparg=oparg@entry=1, 
kwnames=kwnames@entry=0x0) at Python/ceval.c:4784
#14 0x005321d4 in _PyEval_EvalFrameDefault (f=0x7fffbc624438, 
throwflag=) at Python/ceval.c:3250
#15 0x00527d6b in PyEval_EvalFrameEx (f=f@entry=0x7fffbc624438, 
throwflag=throwflag@entry=0) at Python/ceval.c:718
#16 0x00527e3b in _PyFunction_FastCall (co=co@entry=0x7fffe061df40, 
args=0x7fff19d0, args@entry=0x7fff19c0, nargs=nargs@entry=2, 
globals=globals@entry=0x7fffe06a4f58) at Python/ceval.c:4845
#17 0x00533f46 in _PyFunction_FastCallDict 
(func=func@entry=0x7fffe05f7f70, args=args@entry=0x7fff19c0, 
nargs=nargs@entry=2, 
kwargs=kwargs@entry=0x0) at Python/ceval.c:4947
#18 0x00446837 in _PyObject_FastCallDict 
(func=func@entry=0x7fffe05f7f70, args=args@entry=0x7fff19c0, nargs=2, 
kwargs=kwargs@entry=0x0)
at Objects/abstract.c:2297
#19 0x004479da in PyObject_CallFunctionObjArgs 
(callable=0x7fffe05f7f70) at Objects/abstract.c:2811
#20 0x005b2888 in property_descr_set (self=, 
obj=, value=) at Objects/descrobject.c:1419
#21 0x0049bf42 in _PyObject_GenericSetAttrWithDict (obj=0x7fffbc695058, 
name=0x702bcba0, value=0x885ec0 <_Py_NoneStruct>, dict=dict@entry=0x0)
at Objects/object.c:1152
#22 0x0049c174 in PyObject_GenericSetAttr (obj=, 
name=, value=) at Objects/object.c:1194
#23 0x0049b823 in PyObject_SetAttr (v=v@entry=0x7fffbc695058, 
name=, name@entry=0x702bcba0, 
value=value@entry=0x885ec0 <_Py_NoneStruct>) at Objects/object.c:932
#24 0x0052e4eb in _PyEval_EvalFrameDefault (f=0x1c73218, 
throwflag=) at Python/ceval.c:2248
#25 0x00527d6b in PyEval_EvalFrameEx (f=f@entry=0x1c73218, 
throwflag=throwflag@entry=0) at Python/ceval.c:718
#26 0x0052884a in _PyEval_EvalCodeWithName (_co=0x7fffe061dd00, 
globals=, locals=locals@entry=0x0, args=, 
argcount=3, kwnames=0x0, kwargs=0x1c8a460, kwcount=0, kwstep=1, 
defs=0x7fffe06213c8, defcount=3, kwdefs=0x0, closure=0x0, name=0x77f7e430, 
qualname=0x7fffe061ab08) at Python/ceval.c:4094
#27 0x005289ba in fast_function (func=func@entry=0x7fffe05f7d48, 
stack=, nargs=nargs@entry=3, kwnames=kwnames@entry=0x0)
at Python/ceval.c:4904
#28 0x00528d19 in call_function 
(pp_stack=pp_stack@entry=0x7fff1e38, oparg=oparg@entry=2, 
kwnames=kwnames@entry=0x0) at Python/ceval.c:4784
---Type  to continue, or q  to quit---
#29 0x005321d4 in _PyEval_EvalFrameDefault (f=0x1c8a288, 
throwflag=) at Python/ceval.c:3250
#30 0x00527d6b

[issue28120] The Blaze test suite segfaults with 4a5b61b0d090

2016-09-13 Thread Christian Heimes

Christian Heimes added the comment:

$ PYTHONFAULTHANDLER=1 bin/pytest -v 
lib/python3.6/site-packages/blaze/tests/test_sql.py
=== test 
session starts 

platform linux -- Python 3.6.0b1+, pytest-3.0.2, py-1.4.31, pluggy-0.3.1 -- 
/home/heimes/dev/python/python3.6/blaze/bin/python3.6
cachedir: .cache
rootdir: /home/heimes/dev/python/python3.6/blaze, inifile: 
collected 16 items 

lib/python3.6/site-packages/blaze/tests/test_sql.py::test_column Aborted (core 
dumped)
[heimes@hamiller blaze]$ PYTHONFAULTHANDLER=1 bin/pytest -s -v 
lib/python3.6/site-packages/blaze/tests/test_sql.py 
=== test 
session starts 

platform linux -- Python 3.6.0b1+, pytest-3.0.2, py-1.4.31, pluggy-0.3.1 -- 
/home/heimes/dev/python/python3.6/blaze/bin/python3.6
cachedir: .cache
rootdir: /home/heimes/dev/python/python3.6/blaze, inifile: 
collecting 0 
items/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/flask/exthook.py:71:
 ExtDeprecationWarning: Importing flask.ext.cors is deprecated, use flask_cors 
instead.
  .format(x=modname), ExtDeprecationWarning
collected 16 items 

lib/python3.6/site-packages/blaze/tests/test_sql.py::test_column python3.6: 
Objects/dictobject.c:1743: _PyDict_Pop: Assertion `ix >= 0' failed.
Fatal Python error: Aborted

Thread 0x7f9671ffb700 (most recent call first):
  File "/home/heimes/dev/python/python3.6/lib/python3.6/threading.py", line 295 
in wait
  File "/home/heimes/dev/python/python3.6/lib/python3.6/queue.py", line 164 in 
get
  File 
"/home/heimes/dev/python/python3.6/lib/python3.6/multiprocessing/pool.py", line 
429 in _handle_results
  File "/home/heimes/dev/python/python3.6/lib/python3.6/threading.py", line 864 
in run
  File "/home/heimes/dev/python/python3.6/lib/python3.6/threading.py", line 916 
in _bootstrap_inner
  File "/home/heimes/dev/python/python3.6/lib/python3.6/threading.py", line 884 
in _bootstrap

Thread 0x7f96727fc700 (most recent call first):
  File "/home/heimes/dev/python/python3.6/lib/python3.6/threading.py", line 295 
in wait
  File "/home/heimes/dev/python/python3.6/lib/python3.6/queue.py", line 164 in 
get
  File 
"/home/heimes/dev/python/python3.6/lib/python3.6/multiprocessing/pool.py", line 
376 in _handle_tasks
  File "/home/heimes/dev/python/python3.6/lib/python3.6/threading.py", line 864 
in run
  File "/home/heimes/dev/python/python3.6/lib/python3.6/threading.py", line 916 
in _bootstrap_inner
  File "/home/heimes/dev/python/python3.6/lib/python3.6/threading.py", line 884 
in _bootstrap

Thread 0x7f9672ffd700 (most recent call first):
  File 
"/home/heimes/dev/python/python3.6/lib/python3.6/multiprocessing/pool.py", line 
367 in _handle_workers
  File "/home/heimes/dev/python/python3.6/lib/python3.6/threading.py", line 864 
in run
  File "/home/heimes/dev/python/python3.6/lib/python3.6/threading.py", line 916 
in _bootstrap_inner
  File "/home/heimes/dev/python/python3.6/lib/python3.6/threading.py", line 884 
in _bootstrap

Thread 0x7f96737fe700 (most recent call first):
  File "/home/heimes/dev/python/python3.6/lib/python3.6/threading.py", line 295 
in wait
  File "/home/heimes/dev/python/python3.6/lib/python3.6/queue.py", line 164 in 
get
  File 
"/home/heimes/dev/python/python3.6/lib/python3.6/multiprocessing/pool.py", line 
108 in worker
  File "/home/heimes/dev/python/python3.6/lib/python3.6/threading.py", line 864 
in run
  File "/home/heimes/dev/python/python3.6/lib/python3.6/threading.py", line 916 
in _bootstrap_inner
  File "/home/heimes/dev/python/python3.6/lib/python3.6/threading.py", line 884 
in _bootstrap

Thread 0x7f9673fff700 (most recent call first):
  File "/home/heimes/dev/python/python3.6/lib/python3.6/threading.py", line 295 
in wait
  File "/home/heimes/dev/python/python3.6/lib/python3.6/queue.py", line 164 in 
get
  File 
"/home/heimes/dev/python/python3.6/lib/python3.6/multiprocessing/pool.py", line 
108 in worker
  File "/home/heimes/dev/python/python3.6/lib/python3.6/threading.py", line 864 
in run
  File "/home/heimes/dev/python/python3.6/lib/python3.6/threading.py", line 916 
in _bootstrap_inner
  File "/home/heimes/dev/python/python3.6/lib/python3.6/threading.py", line 884 
in _bootstrap

Thread 0x7f9688fb9700 (most recent call first):
  File "/home/heimes/dev/python/python3.6/lib/python3.6/threading.py", line 295 
in wait
  File "/home/heimes/dev/python/python3.6/lib/python3.6/queue.py", line 164 in 
get
  File 
"/home/heimes/dev/python/python3.6/lib/python3.6/multiprocessing/pool.py", line 
108 in worker
  File "/home/heimes/dev/python/python3.6/lib/python3.6/threading.py", line 864 
in run
  File "/home/heimes/dev/python/python3.6/lib/python3.6/threading.py", line 916 
in _bootstrap_inner
  File "/home/heimes/

[issue28120] The Blaze test suite segfaults with 4a5b61b0d090

2016-09-13 Thread Christian Heimes

Christian Heimes added the comment:

It's a bug in sqlalchemy. The test suite of sqlalchemy is crashing, too.

$ PYTHONFAULTHANDLER=1 ../bin/pytest -v -s
=== test 
session starts 

platform linux -- Python 3.6.0b1+, pytest-3.0.2, py-1.4.31, pluggy-0.3.1 -- 
/home/heimes/dev/python/python3.6/blaze/bin/python3.6
cachedir: .cache
rootdir: /home/heimes/dev/python/python3.6/blaze/sqlalchemy, inifile: setup.cfg
collected 7883 items 

test/aaa_profiling/test_compiler.py::CompileTest_sqlite_pysqlite::test_insert 
SKIPPED
test/aaa_profiling/test_compiler.py::CompileTest_sqlite_pysqlite::test_select 
SKIPPED
test/aaa_profiling/test_compiler.py::CompileTest_sqlite_pysqlite::test_select_labels
 python3.6: Objects/dictobject.c:1743: _PyDict_Pop: Assertion `ix >= 0' failed.
Fatal Python error: Aborted

Current thread 0x7f5606ac8700 (most recent call first):
  File 
"/home/heimes/dev/python/python3.6/blaze/sqlalchemy/test/../lib/sqlalchemy/util/langhelpers.py",
 line 796 in expire_instance
  File 
"/home/heimes/dev/python/python3.6/blaze/sqlalchemy/test/../lib/sqlalchemy/sql/selectable.py",
 line 666 in _reset_exported
  File 
"/home/heimes/dev/python/python3.6/blaze/sqlalchemy/test/../lib/sqlalchemy/sql/selectable.py",
 line 1918 in _generate
  File 
"/home/heimes/dev/python/python3.6/blaze/sqlalchemy/test/../lib/sqlalchemy/sql/base.py",
 line 44 in _generative
  File "", line 2 in apply_labels
  File 
"/home/heimes/dev/python/python3.6/blaze/sqlalchemy/test/aaa_profiling/test_compiler.py",
 line 72 in test_select_labels
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/python.py",
 line 149 in pytest_pyfunc_call
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py",
 line 596 in execute
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py",
 line 264 in __init__
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py",
 line 247 in _wrapped_call
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py",
 line 595 in execute
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py",
 line 333 in 
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py",
 line 338 in _hookexec
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py",
 line 724 in __call__
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/python.py",
 line 1552 in runtest
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/runner.py",
 line 104 in pytest_runtest_call
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py",
 line 596 in execute
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py",
 line 264 in __init__
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py",
 line 247 in _wrapped_call
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py",
 line 595 in execute
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py",
 line 333 in 
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py",
 line 338 in _hookexec
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py",
 line 724 in __call__
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/runner.py",
 line 151 in 
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/runner.py",
 line 163 in __init__
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/runner.py",
 line 151 in call_runtest_hook
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/runner.py",
 line 133 in call_and_report
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/runner.py",
 line 79 in runtestprotocol
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/runner.py",
 line 66 in pytest_runtest_protocol
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py",
 line 596 in execute
  File 
"/home/heimes/dev/python/python3.6/blaze/lib/python3.6/site-packages/_pytest/vendored_packages/pluggy.py",
 line 264 in __init__
  File 
"/home/heimes/dev/

[issue28120] The Blaze test suite segfaults with 4a5b61b0d090

2016-09-13 Thread Stefan Krah

Stefan Krah added the comment:

It fails in pytest and has a segfault.  The pytest issue should probably
be separate issue (it could also be a blaze issue).


This is a minimal reproducer for the segfault:

=
from blaze.expr import symbol
from blaze.interactive import data
from blaze.compute import compute

t = symbol('t', 'var * {amount: int64, id: int64, name: string}')

sql = data('sqlite:///:memory:::accounts', dshape=t.dshape)

expr = t.distinct().nrows
x = expr._subs({t: sql})
result = compute(x)
=


Blaze itself is pure Python, a third part issue could be in sqlite
or sqlalchemy (but I think that is also mostly pure Python).

--
nosy: +skrah

___
Python tracker 

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



[issue23404] 'make touch' does not work with git clones of the source repository

2016-09-13 Thread Martin Panter

Martin Panter added the comment:

Okay so my “make -t” trick has various flaws. You still have to know the 
filenames to specify, it requires Makefile to be generated by configure in the 
source tree, and it creates empty files if you use it in a separate build 
directory.

Another idea: instead of the “make touch” recipe, we add a simple shell script. 
Call it say “touch-bootstrap.sh”. Like what “make touch” already does in Python 
2, but without embedding it as a makefile rule.

Or add a flag variable so you can do a build without running any of the 
regeneration rules or worrying about timestamps: make BOOT="#".

--
Added file: http://bugs.python.org/file44627/boot-flag.patch

___
Python tracker 

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



[issue28120] SQLAlchemy's expire_instance() causes _PyDict_Pop: Assertion `ix >= 0' failed.

2016-09-13 Thread Christian Heimes

Changes by Christian Heimes :


--
title: The Blaze test suite segfaults with 4a5b61b0d090 -> SQLAlchemy's 
expire_instance() causes _PyDict_Pop: Assertion `ix >= 0' failed.

___
Python tracker 

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



[issue28120] SQLAlchemy's expire_instance() causes _PyDict_Pop: Assertion `ix >= 0' failed.

2016-09-13 Thread Christian Heimes

Christian Heimes added the comment:

The issue is not related to Blaze. It is caused by a SQLAlchemy method. 
expire_instance() calls pop(name, None) on instance __dict__.

--

___
Python tracker 

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



[issue28120] SQLAlchemy's expire_instance() causes _PyDict_Pop: Assertion `ix >= 0' failed.

2016-09-13 Thread Stefan Krah

Stefan Krah added the comment:

Thanks, Christian!

--

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-13 Thread Matthias Klose

Matthias Klose added the comment:

updated patch that always used memcpy for the little endian case.

--
Added file: http://bugs.python.org/file44628/pyhash.diff

___
Python tracker 

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



[issue16288] TextTestResult uses TestCase.__str__() which isn't customisable (vs id() or shortDescription())

2016-09-13 Thread Chris Jerdonek

Chris Jerdonek added the comment:

An idea occurred to me on this recently. Instead of changing TextTestResult to 
call test.id() everywhere instead of str(test), what about making 
TextTestResult DRY by having it call a new method called something like 
self.getName(test)?

With this approach, customizing the test name would simply be a matter of 
subclassing TextTestResult and overriding TextTestResult.getName() (which 
unittest makes easy). This is much easier than trying to modify the test cases 
themselves (which unittest doesn't make easy). It's also more natural as the 
responsibility for formatting should lie with the test result classes rather 
than with the test case classes themselves (e.g. as discussed in #22431).

--

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-13 Thread Matthias Klose

Changes by Matthias Klose :


Removed file: http://bugs.python.org/file44515/pyhash.diff

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-13 Thread Matthias Klose

Changes by Matthias Klose :


Removed file: http://bugs.python.org/file44628/pyhash.diff

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-13 Thread Matthias Klose

Changes by Matthias Klose :


Added file: http://bugs.python.org/file44629/pyhash.diff

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-13 Thread Christian Heimes

Christian Heimes added the comment:

I'm a bit worried that the patch might slow down the general case of SipHash24. 
When I was working on SipHash24 I made sure that the general case in 
PyBytes_Object and PyUnicode_Object are fast and always aligned. Do all 
compilers optimize that case? For MSVC we still have a specialized Py_MEMCPY() 
variant in pyports.h.

I can see three more ways to fix the issue:

1) Have two loops, one for the aligned case with memcpy() and one for the 
unaligned case w/o memcpy()
2) Add a special variant of _le64toh() for PY_LITTLE_ENDIAN on ARM and use the 
current variant on X86_64.
3) Make it illegal to call _Py_HashBytes() with non-aligned pointer and require 
the caller to provide an aligned buffer. It's easy for datetime but requires an 
extra buffer memoryview. Memoryview already uses a buffer for all but 
single-strided C contiguous views. We can easily add another case for 
non-aligned buffers.

--
stage:  -> needs patch
type:  -> crash

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-13 Thread Stefan Krah

Stefan Krah added the comment:

FWIW, MSVC optimizes memcpy:

  http://bugs.python.org/issue15993


The pgo issue has been fixed according to Steve Dower.

--
nosy: +skrah

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-13 Thread Matthias Klose

Matthias Klose added the comment:

a variant of the patch that keeps the parameter types of _le64toh.

--
Added file: http://bugs.python.org/file44630/pyhash2.diff

___
Python tracker 

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



[issue15819] Unable to build Python out-of-tree when source tree is readonly.

2016-09-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9cabcb4411ac by Martin Panter in branch '2.7':
Issue #15819: Drop dead code; -IInclude already added unconditionally
https://hg.python.org/cpython/rev/9cabcb4411ac

--

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-13 Thread Matthias Klose

Matthias Klose added the comment:

I can check, if the memcpy is optimized away.  As an alternative, we could use 
__builtin_memcpy. That is available for clang as well (would have to check icc).

--

___
Python tracker 

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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-13 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-13 Thread Christian Heimes

New submission from Christian Heimes:

Py_MEMCPY() has a special case for small blocks on Windows to work around an 
ancient performance issue in MSVC. Can we safely assume that recent MSVC 
properly optimize memcpy()? See #28055

/* Py_MEMCPY can be used instead of memcpy in cases where the copied blocks
 * are often very short.  While most platforms have highly optimized code for
 * large transfers, the setup costs for memcpy are often quite high.  MEMCPY
 * solves this by doing short copies "in line".
 */

#if defined(_MSC_VER)
#define Py_MEMCPY(target, source, length) do {  \
size_t i_, n_ = (length);   \
char *t_ = (void*) (target);\
const char *s_ = (void*) (source);  \
if (n_ >= 16)   \
memcpy(t_, s_, n_); \
else\
for (i_ = 0; i_ < n_; i_++) \
t_[i_] = s_[i_];\
} while (0)
#else
#define Py_MEMCPY memcpy
#endif

--
components: Windows
messages: 276262
nosy: christian.heimes, haypo, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Py_MEMCPY: Use memcpy on Windows?
type: performance
versions: 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



[issue28055] pyhash's siphash24 assumes alignment of the data pointer

2016-09-13 Thread Christian Heimes

Christian Heimes added the comment:

I created #28126 for MSVC.

--

___
Python tracker 

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



[issue28120] SQLAlchemy's expire_instance() causes _PyDict_Pop: Assertion `ix >= 0' failed.

2016-09-13 Thread STINNER Victor

STINNER Victor added the comment:

I added debug traces to _PyDict_Pop(). It looks like the assertion failed after 
dictresize() converts a splitted table into a combined table. After the resize, 
the key '_columns_plus_names' cannot be found anymore, whereas it was found 
before.

The string thing about the key '_columns_plus_names' is that I cannot see it in 
the output of repr(dict).

The length of the dictionary is 7, but it looks like it contains 8 items... 
Something is wrong, no?


Note: I'm not sure that my debug traces are correct, especially the number of 
entries may be larger. I don't understand yet exactly the internal structure of 
dictionaries.


@@ delete memoized
{'_auto_correlate': True, 
 '_from_obj': OrderedSet([]), '_raw_columns': [Table('t1', MetaData(bind=None), 
Column('c1', Integer(), table=, primary_key=True, nullable=False), 
Column('c2', String(length=30), table=), schema=None)],
 '_whereclause': ,
 '_having': None,
 'use_labels': False,
 '_bind': None}
_PyDict_Pop(): ix=7, resize!

before resize:
dk_size=16 keys->dk_nentries=8 
keys->dk_usable=2 || usable=10>

index[0]=-1
index[1]=4
index[2]=-1
index[3]=-1
index[4]=0
index[5]=3
index[6]=-1
index[7]=7  <- it looks like the entry #7 is referenced, no?
index[8]=1
index[9]=2
index[10]=-1
index[11]=-1
index[12]=-1
index[13]=-1
index[14]=5
index[15]=6

entry[0]: key='_auto_correlate', hash=-4930419206435490684
entry[1]: key='_from_obj', hash=-717737569259548376
entry[2]: key='_raw_columns', hash=6382956110151689156
entry[3]: key='_whereclause', hash=-7105285138948878507
entry[4]: key='_having', hash=-8328824464742262616
entry[5]: key='use_labels', hash=8687253172181039710
entry[6]: key='_bind', hash=-5556925267210855474
entry[7]: key='_columns_plus_names', hash=-7771762227888271625
entry[8]: key='NULL', hash=0
entry[9]: key='NULL', hash=0

object  : {'_auto_correlate': True, '_from_obj': OrderedSet([]), 
'_raw_columns': [Table('t1', MetaData(bind=None), Column('c1', Integer(), 
table=, primary_key=True, nullable=False), Column('c2', String(length=30), 
table=), schema=None)], '_whereclause': 
, '_having': 
None, 'use_labels': False, '_bind': None}
type: dict

***

after resize:

dk_size=32 keys->dk_nentries=7 
keys->dk_usable=14 || usable=21>

index[0]=-1
index[1]=-1
index[2]=-1
index[3]=-1
index[4]=0
index[5]=-1
index[6]=-1
index[7]=-1
index[8]=1
index[9]=-1
index[10]=-1
index[11]=-1
index[12]=-1
index[13]=-1
index[14]=6
index[15]=-1
index[16]=-1
index[17]=4
index[18]=-1
index[19]=-1
index[20]=-1
index[21]=3
index[22]=-1
index[23]=-1
index[24]=-1
index[25]=2
index[26]=-1
index[27]=-1
index[28]=-1
index[29]=-1
index[30]=5
index[31]=-1   <-- no more entry #7 ???

entry[0]: key='_auto_correlate', value=True, hash=-4930419206435490684
entry[1]: key='_from_obj', value=OrderedSet([]), hash=-717737569259548376
entry[2]: key='_raw_columns', value=[Table('t1', MetaData(bind=None), 
Column('c1', Integer(), table=, primary_key=True, nullable=False), 
Column('c2', String(length=30), table=), schema=None)], 
hash=6382956110151689156
entry[3]: key='_whereclause', value=, hash=-7105285138948878507
entry[4]: key='_having', value=None, hash=-8328824464742262616
entry[5]: key='use_labels', value=False, hash=8687253172181039710
entry[6]: key='_bind', value=None, hash=-5556925267210855474
entry[7]: key='NULL', value='NULL', hash=0
entry[8]: key='NULL', value='NULL', hash=0
entry[9]: key='NULL', value='NULL', hash=0
entry[10]: key='NULL', value='NULL', hash=0
entry[11]: key='NULL', value='NULL', hash=0
entry[12]: key='NULL', value='NULL', hash=0
entry[13]: key='NULL', value='NULL', hash=0
entry[14]: key='NULL', value='NULL', hash=0
entry[15]: key='NULL', value='NULL', hash=0
entry[16]: key='NULL', value='NULL', hash=0
entry[17]: key='NULL', value='NULL', hash=0
entry[18]: key='NULL', value='NULL', hash=0
entry[19]: key='NULL', value='NULL', hash=0
entry[20]: key='NULL', value='NULL', hash=0

object  : {'_auto_correlate': True, '_from_obj': OrderedSet([]), 
'_raw_columns': [Table('t1', MetaData(bind=None), Column('c1', Integer(), 
table=, primary_key=True, nullable=False), Column('c2', String(length=30), 
table=), schema=None)], '_whereclause': 
, '_having': 
None, 'use_labels': False, '_bind': None}
type: dict
refcount: 3


python: Objects/dictobject.c:1810: _PyDict_Pop: Assertion `ix >= 0' failed.

Program received signal SIGABRT, Aborted.
0x7711f6f5 in raise () from /lib64/libc.so.6
Missing separate debuginfos, use: dnf debuginfo-install 
bzip2-libs-1.0.6-20.fc24.x86_64 keyutils-libs-1.5.9-8.fc24.x86_64 
krb5-libs-1.14.3-8.fc24.x86_64 libcom_err-1.42.13-4.fc24.x86_64 
libselinux-2.5-9.fc24.x86_64 openssl-libs-1.0.2h-3.fc24.x86_64 
pcre-8.39-3.fc24.x86_64 sqlite-libs-3.13.0-1.fc24.x86_64 
xz-libs-5.2.2-2.fc24.x86_64 zlib-1.2.8-10.fc24.x86_64
(gdb) up
#1  0x771212fa in abort () from /lib64/libc.so.6
(gdb) 
#2  0x77117f97 in __assert_fail_base () from /lib64/libc.so.6
(gdb) 
#3  0x77118042 in __assert_

[issue28125] identify cross builds by a more generic environment setting.

2016-09-13 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
nosy: +xdegaye

___
Python tracker 

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



[issue28120] Bug in _PyDict_Pop() on a splitted table

2016-09-13 Thread STINNER Victor

Changes by STINNER Victor :


--
title: SQLAlchemy's expire_instance() causes _PyDict_Pop: Assertion `ix >= 0' 
failed. -> Bug in _PyDict_Pop() on a splitted table

___
Python tracker 

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



[issue15819] Unable to build Python out-of-tree when source tree is readonly.

2016-09-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 36550e4f9b4c by Martin Panter in branch '3.5':
Issue #15819: Remove old unconditional -IInclude option
https://hg.python.org/cpython/rev/36550e4f9b4c

New changeset a90daae58323 by Martin Panter in branch '3.6':
Issue #15819: Merge include search from 3.5 into 3.6
https://hg.python.org/cpython/rev/a90daae58323

New changeset 2ac00ff072b8 by Martin Panter in branch 'default':
Issue #15819: Merge include search from 3.6
https://hg.python.org/cpython/rev/2ac00ff072b8

--

___
Python tracker 

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



[issue28120] Bug in _PyDict_Pop() on a splitted table

2016-09-13 Thread STINNER Victor

STINNER Victor added the comment:

To reproduce the issue:

* compile Python 3.6 in debug mode
* download https://pypi.python.org/pypi/SQLAlchemy/1.1.0b3
* Then type:
---
./python -m venv venvsqla
cd venvsqla
source bin/activate
python -m pip install pytest 

tar -xf ../SQLAlchemy-1.1.0b3.tar.gz 
cd SQLAlchemy-1.1.0b3/
python setup.py install 
python -X faulthandler -m pytest test/aaa_profiling/test_compiler.py -v -s
---

I get:
---
 test session starts 

platform linux -- Python 3.7.0a0, pytest-3.0.2, py-1.4.31, pluggy-0.3.1 -- 
/home/haypo/prog/python/default/venvsqla/bin/python
cachedir: .cache
rootdir: /home/haypo/prog/python/default/venvsqla/SQLAlchemy-1.1.0b3, inifile: 
setup.cfg
collecting 0 itemspython: Objects/dictobject.c:1739: _PyDict_Pop: Assertion `ix 
>= 0' failed.
Fatal Python error: Aborted

Current thread 0x7f6d909da700 (most recent call first):
  File 
"/home/haypo/prog/python/default/venvsqla/SQLAlchemy-1.1.0b3/test/../lib/sqlalchemy/util/langhelpers.py",
 line 796 in expire_instance
  File 
"/home/haypo/prog/python/default/venvsqla/SQLAlchemy-1.1.0b3/test/../lib/sqlalchemy/sql/selectable.py",
 line 666 in _reset_exported
  File 
"/home/haypo/prog/python/default/venvsqla/SQLAlchemy-1.1.0b3/test/../lib/sqlalchemy/sql/selectable.py",
 line 1908 in _generate
  File 
"/home/haypo/prog/python/default/venvsqla/SQLAlchemy-1.1.0b3/test/../lib/sqlalchemy/sql/base.py",
 line 44 in _generative
  File "", line 2 in apply_labels
  File 
"/home/haypo/prog/python/default/venvsqla/SQLAlchemy-1.1.0b3/test/aaa_profiling/test_compiler.py",
 line 12 in 
  File 
"/home/haypo/prog/python/default/venvsqla/lib/python3.7/site-packages/_pytest/assertion/rewrite.py",
 line 207 in load_module
  File "", line 616 in _load_backward_compatible
  File "", line 646 in _load_unlocked
  File "", line 950 in _find_and_load_unlocked
  File "", line 961 in _find_and_load
  File 
"/home/haypo/prog/python/default/venvsqla/lib/python3.7/site-packages/py/_path/local.py",
 line 650 in pyimport
  File 
"/home/haypo/prog/python/default/venvsqla/lib/python3.7/site-packages/_pytest/python.py",
 line 411 in _importtestmodule
...
---

--

___
Python tracker 

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



[issue16189] ld_so_aix not found

2016-09-13 Thread Martin Panter

Martin Panter added the comment:

Closing this assuming that revision ca1ddd365f5f (committed to 3.5 and 3.6+ 
branches) fixed it.

--
nosy: +martin.panter
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> AIX shared library extension modules installation broken

___
Python tracker 

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



[issue28120] Bug in _PyDict_Pop() on a splitted table

2016-09-13 Thread Xiang Zhang

Xiang Zhang added the comment:

No need, you can reproduce it by this:

>>> class C:
... pass
... 
>>> a, b = C(), C()
>>> a.a, a.b = 1, 2
>>> b.a = 1
>>> b.__dict__.pop('b')
python: Objects/dictobject.c:1739: _PyDict_Pop: Assertion `ix >= 0' failed.
Aborted (core dumped)

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue28120] Bug in _PyDict_Pop() on a splitted table

2016-09-13 Thread Xiang Zhang

Xiang Zhang added the comment:

I submit a patch that can solve this. Actually I find it before but forget 
about it

--
keywords: +patch
Added file: http://bugs.python.org/file44631/issue28120.patch

___
Python tracker 

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



[issue28120] Bug in _PyDict_Pop() on a splitted table

2016-09-13 Thread Christian Heimes

Christian Heimes added the comment:

Good work! This example is a bit easier to understand:

class Cls:
pass

a = Cls()
a.x = 1
a.y = 2

b = Cls()
b.x = 1
print(hasattr(b, 'y'))
print(b.__dict__.pop('y', None))


$ ./python d.py 
False
python: Objects/dictobject.c:1743: _PyDict_Pop: Assertion `ix >= 0' failed.
Aborted (core dumped)

--

___
Python tracker 

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



[issue28126] Py_MEMCPY: Use memcpy on Windows?

2016-09-13 Thread Steve Dower

Steve Dower added the comment:

Yes, memcpy (or preferably memcpy_s, which includes the size of the 
destination) are basically intrinsics that will inline short copies and call 
out to a range of implementations depending on alignment/overlap/etc.

--

___
Python tracker 

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



  1   2   3   >