[issue31866] clean out some more AtheOS code

2017-10-25 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset 4eaf7f949069882e385f2297c9e70031caf9144c by Benjamin Peterson in 
branch 'master':
fixes bpo-31866: remove code pertaining to AtheOS support (#4115)
https://github.com/python/cpython/commit/4eaf7f949069882e385f2297c9e70031caf9144c


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



[issue28503] [Patch] '_crypt' module: fix implicit declaration of crypt(), use crypt_r() where available

2017-10-25 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

This sgtm. Can you send a PR?

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue31866] clean out some more AtheOS code

2017-10-25 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Well, the configure.ac thing is some code that fails if you're running atheos.

--

___
Python tracker 

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



[issue31857] Make the behavior of USE_STACKCHECK deterministic

2017-10-25 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset 1896793520a49a6f97ae360c0b288967e56b005e by Benjamin Peterson 
(pdox) in branch 'master':
bpo-31857: Make the behavior of USE_STACKCHECK deterministic (#4098)
https://github.com/python/cpython/commit/1896793520a49a6f97ae360c0b288967e56b005e


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue31857] Make the behavior of USE_STACKCHECK deterministic

2017-10-25 Thread Benjamin Peterson

Change by Benjamin Peterson :


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



[issue31871] Support for file descriptor params in os.path

2017-10-25 Thread Mateusz Kurek

New submission from Mateusz Kurek :

Since Python 3.3, some os module functions, like os.stat 
(https://docs.python.org/3/library/os.html#os.stat), support passing file 
descriptor instead of a path. os.path functions, on the other hand (like 
os.path.exists - https://docs.python.org/3/library/os.path.html#os.path.exists 
- or os.path.samefile - 
https://docs.python.org/3/library/os.path.html#os.path.samefile) mention using 
os.stat underneath, but according to documentation, does not support passing 
file descriptor instead of a path (at least it's not mentioned in the docs that 
this feature is supported). Is this intentional (os.path functions should not 
take file descriptor params) or this feature is officialy supported, but it's 
ommited in the docs?

--
assignee: docs@python
components: Documentation
messages: 305023
nosy: Mateusz Kurek, docs@python
priority: normal
severity: normal
status: open
title: Support for file descriptor params in os.path
type: enhancement
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue20486] msilib: can't close opened database

2017-10-25 Thread Berker Peksag

Berker Peksag  added the comment:

xoviat, would you like to send your patch as a pull request on GitHub? It would 
be nice to add a simple test that the new Close() works correctly. I can do 
that if you don't have time, thank you!

Steve, can we apply this to bugfix branches?

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



[issue31870] add timeout parameter for get_server_certificate in ssl.py

2017-10-25 Thread Vex Woo

New submission from Vex Woo :

The original get_server_certificate in ssl.py does not support socket timeout,

def get_server_certificate(addr, ssl_version=PROTOCOL_TLS, ca_certs=None):
"""Retrieve the certificate from the server at the specified address,
and return it as a PEM-encoded string.
If 'ca_certs' is specified, validate the server cert against it.
If 'ssl_version' is specified, use it in the connection attempt."""

host, port = addr
if ca_certs is not None:
cert_reqs = CERT_REQUIRED
else:
cert_reqs = CERT_NONE
context = _create_stdlib_context(ssl_version,
 cert_reqs=cert_reqs,
 cafile=ca_certs)
with  create_connection(addr) as sock:
with context.wrap_socket(sock) as sslsock:
dercert = sslsock.getpeercert(True)
return DER_cert_to_PEM_cert(dercert)

If a timeout parameter, a sample demo can be here:

>>> import ssl
>>> ssl.get_server_certificate(("www.qq.com", 443), timeout=6)
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.7/ssl.py", line 1017, in get_server_certificate
with closing(create_connection(addr, timeout)) as sock:
  File "/usr/lib/python2.7/socket.py", line 575, in create_connection
raise err
socket.error: [Errno 101] Network is unreachable

--
components: Library (Lib)
files: ssl.py
messages: 305021
nosy: Nixawk
priority: normal
pull_requests: 4092
severity: normal
status: open
title: add timeout parameter for get_server_certificate in ssl.py
type: enhancement
Added file: https://bugs.python.org/file47238/ssl.py

___
Python tracker 

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



[issue31863] Inconsistent returncode/exitcode for terminated child processes on Windows

2017-10-25 Thread Eryk Sun

Change by Eryk Sun :


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



[issue31863] Inconsistent returncode/exitcode for terminated child processes on Windows

2017-10-25 Thread Eryk Sun

Eryk Sun  added the comment:

Setting the exit code to the negative of a C signal value isn't generally 
meaningful in Windows. It seems multiprocessing doesn't have a significant use 
for this, other than getting a formatted exit code in the repr via its 
_exitcode_to_name dict. For example:

p = multiprocessing.Process(target=time.sleep, args=(30,))
p.start()
p.terminate()

>>> p


This may mislead people into thinking incorrectly that Windows implements POSIX 
signals. Python uses the C runtime's emulation of the basic set of required 
signals. SIGSEGV, SIGFPE, and SIGILL are based on exceptions. SIGINT and 
SIGBREAK are based on console control events. SIGABRT and SIGTERM are for use 
with C `raise`. Additionally it implements os.kill via TerminateProcess and 
GenerateConsoleCntrlEvent. (The latter takes process group IDs, so it should 
have been used to implement os.killpg instead. Its use in os.kill is wrong and 
confusing.)

The normal exit code for a forced shutdown is 1, which you can confirm via Task 
Manager or `taskkill /F`. subprocess is correct here. I think multiprocessing 
should follow suit.

--
nosy: +eryksun

___
Python tracker 

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



[issue21720] "TypeError: Item in ``from list'' not a string" message

2017-10-25 Thread Nick Coghlan

Nick Coghlan  added the comment:

Serhiy's PR avoids the cryptic BytesWarning on Py3 while minimising the 
overhead of the new typecheck, so I've closed Berker's PR in favour of that one 
(which now has approved reviews from both Brett and I, so Serhiy will merge it 
when he's ready to do so).

Thanks for both patches!

--

___
Python tracker 

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



[issue24920] shutil.get_terminal_size throws AttributeError

2017-10-25 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

If one starts IDLE from a command-line console (python -m idlelib) or Python 
console (import idlelib.idle), sys.__stdout__ is the TextIOWraper for that 
console and .fileno() returns 1.  .get_terminal_size() will then return the 
console size.  The exception occurs when IDLE is  started from an icon.

Implementing David's suggestion for shutil will be easy: insert just before the 
fileno call
if not sys.__stdout__: raise ValueError()
This is what os.get_terminal_size() raises on IDLE.  Comments in the code in 
posixpath.c make it clear that this is intended guis and the low_level os 
function.

This came up today on Stackoverflow when someone tried to use 
matplotlib.pyplot, which calls os.get_terminal_size, on IDLE.
https://stackoverflow.com/questions/46921087/pyplot-with-idle
(Patching shutil will not help for the os call.)

--
nosy: +terry.reedy
stage:  -> test needed
type: crash -> behavior
versions: +Python 3.7 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-25 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:


New changeset 32318930da70ff03320ec50813b843e7db6fbc2e by Alexander Belopolsky 
(Mario Corchero) in branch 'master':
Closes bpo-31800: Support for colon when parsing time offsets (#4015)
https://github.com/python/cpython/commit/32318930da70ff03320ec50813b843e7db6fbc2e


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



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

2017-10-25 Thread Guido van Rossum

Guido van Rossum  added the comment:

SGTM.

--

___
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()

2017-10-25 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

I am going to merge PR 4015 submitted for issue 31800.  That issue asks to make 
%z strptime format accept offsets with : separators.  Given that a similar 
feature has been added to glibc several years ago, I don't see much need for 
bikeshedding.  This issue will remain open and will focus on strftime.

--
dependencies: +datetime.strptime: Support for parsing offsets with a colon

___
Python tracker 

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



[issue29933] asyncio: set_write_buffer_limits() doc doesn't specify unit of the parameters

2017-10-25 Thread Berker Peksag

Berker Peksag  added the comment:

PR 2262 has been merged and backported to bugfix branches so I think this issue 
can be closed now.

--
nosy: +berker.peksag
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue30811] A venv created and activated from within a virtualenv uses the outer virtualenv's site-packages rather than its own.

2017-10-25 Thread Berker Peksag

Change by Berker Peksag :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue31702] Allow to specify the number of rounds for SHA-* hashing in crypt

2017-10-25 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

I'd stick with ValueError in that case as well.  if someone dislikes the
valueerrors because they _want_ to use an invalid one, they can file a bug
and we'll reconsider only if they have a meaningful use case.

On Wed, Oct 25, 2017 at 9:36 AM Serhiy Storchaka 
wrote:

>
> Serhiy Storchaka  added the comment:
>
> What to do with values outside of the valid range (2**4 to 2**31 for
> Blowfish, 1000 to 9 for SHA*). Raise ValueError, OverflowError, or
> bound it, or just generate an invalid salt and allow crypt() to handle it?
>
> --
> nosy: +haypo, pitrou
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue31852] Crashes with lines of the form "async \"

2017-10-25 Thread Pablo Galindo Salgado

Change by Pablo Galindo Salgado :


--
keywords: +patch
pull_requests: +4091
stage:  -> patch review

___
Python tracker 

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



[issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5

2017-10-25 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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



[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2017-10-25 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

> I'm not sure that it's a good idea to provide a "aligned malloc" fallback if 
> such fallback would be inefficient. For example, we would have to 
> overallocate the memory block not only for the requested alignement, but also 
> allocates extra sizeof(size_t) bytes, *in each* aligned memmory block, to 
> store the size of the alignment itself, to recover the original pointer... to 
> finally be able to call free().

You can re-use the same bytes for padding and to store the offset. The main 
tricky thing is that for an alignment of N bytes you need to overallocate N 
bytes instead of (N-1). (In the worst case, malloc returns you a pointer that's 
already N-byte aligned, and then you have to advance it by a full N bytes so 
that you have some space before the pointer to store the offset.)

Also you want to do a little N = max(N, sizeof(whatever int type you use)) at 
the beginning to make sure it's always big enough, but this is trivial (and 
really even a uint16_t is plenty big to store all reasonable alignments). And 
make sure that N is a power-of-two, which guarantees that whatever value malloc 
returns will be shifted by at least malloc's regular alignment, which is 
guaranteed to be large enough to store a standard int type (on reasonable 
systems).

--

___
Python tracker 

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



[issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5

2017-10-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 7c622be4f2e86c1999baba4f64671a5987d43d73 by Serhiy Storchaka in 
branch '2.7':
bpo-30855: Fix winfo_id related Tkinter test on Windows. (#4121)
https://github.com/python/cpython/commit/7c622be4f2e86c1999baba4f64671a5987d43d73


--

___
Python tracker 

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



[issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5

2017-10-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

In Python 2 hex() adds the 'L' suffix for longs.

--
stage: patch review -> resolved

___
Python tracker 

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



[issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5

2017-10-25 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +4090
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



[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2017-10-25 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Android has both memalign() [1] and posix_memalign() [2] and does not have 
aligned_alloc(), posix_memalign() is a wrapper around memalign() [3].

[1] 
https://android.googlesource.com/platform/bionic/+/master/libc/include/malloc.h#38
[2] 
https://android.googlesource.com/platform/bionic/+/master/libc/include/stdlib.h#80
[3] https://android.googlesource.com/platform/bionic/+/85aad90%5E%21/

--

___
Python tracker 

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



[issue17942] IDLE Debugger: Improve GUI

2017-10-25 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

IDLE now uses ttk unconditionally by requiring tk 8.5.  The patch can therefore 
be simplified accordingly.

--

___
Python tracker 

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



[issue15335] IDLE - debugger steps into print and over rpc.py code

2017-10-25 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

The debugger also steps into importlib, if one steps 'into' an import 
statement.  Most of the time, this is a nuisance.  If one is importing from 
one's own module, stepping over 'import mymod' is not a satisfactory way to 
avoid this.  Perhaps we should add '(X) Step past IDLE internals' and '(X) Step 
past Python internals', both on by default.  'python internals' would be 
builtin features that happen be implemented, at least in CPython, in python 
rather than the internal language. Other ideas: a drop down skip list with 
items checked.  Or a general policy of skipping Lib/* with a list of exceptions.

--

___
Python tracker 

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



[issue21720] "TypeError: Item in ``from list'' not a string" message

2017-10-25 Thread Tal Einat

Tal Einat  added the comment:

I understand that there is a workaround. I'm just thinking about the many 
existing large codebases where re-writing thousands of imports because of this 
is unlikely to be done, yet having somewhat longer process launch times would 
be surprising and unwanted.

Anyways I do think it's a very small price to pay for better error messages, 
and there's a good chance nobody will actually feel the difference, so let's 
definitely move forward with this.

--

___
Python tracker 

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



[issue21720] "TypeError: Item in ``from list'' not a string" message

2017-10-25 Thread Brett Cannon

Brett Cannon  added the comment:

As Nick said, if the overhead of an import statement is that critical, then you 
should NOT use the `from ... import ...` form at all and just stick with 
`import ...` and if necessary, bind local names to objects off of the final 
module or a local name for the overall module.

--

___
Python tracker 

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



[issue31803] time.clock() should emit a DeprecationWarning

2017-10-25 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

I would like to add my voice to MAL's objections.  I was not aware of 
time.clock() depreciation before Victor brought this issue to my attention.  
time.clock() is a very well-known API eponymous to a venerable UNIX system 
call.  Its limitations and platform dependencies are very well-known as well.  
For someone new to python, seeing time.clock() would probably not require a 
trip to the library reference, but seeing time.perf_counter() is likely to 
cause a WTF reaction even from an experienced python developer.

--

___
Python tracker 

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



[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2017-10-25 Thread Stefan Krah

Stefan Krah  added the comment:

> In Python 3.7, should we also add the "aligned alloc" requirement?

Linux, BSD, OSX, MSVC should be covered. According to Stackoverflow
MinGW has an internal function.

Android, I don't know. Xavier?

--
nosy: +xdegaye

___
Python tracker 

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



[issue31702] Allow to specify the number of rounds for SHA-* hashing in crypt

2017-10-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

What to do with values outside of the valid range (2**4 to 2**31 for Blowfish, 
1000 to 9 for SHA*). Raise ValueError, OverflowError, or bound it, or 
just generate an invalid salt and allow crypt() to handle it?

--
nosy: +haypo, pitrou

___
Python tracker 

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



[issue28564] shutil.rmtree is inefficient due to listdir() instead of scandir()

2017-10-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Following Antoine's suggestion the patch now makes shutil.rmtree() using 
os.scandir() on all platforms.

I doubt about one thing. This patch changes os.listdir passed to the onerror 
handler to os.scandir. This can break a user code that checks if the first 
argument in onerror is os.listdir. If keep this change, it should be documented 
in the "Porting to 3.7" section. Alternatively, we can continue passing 
os.listdir if os.scandir() failed despites the fact that os.listdir no longer 
used.

--
nosy: +pitrou

___
Python tracker 

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



[issue28564] shutil.rmtree is inefficient due to listdir() instead of scandir()

2017-10-25 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I think we should change to os.scandir.  No need to accumulate compatibility 
baggage like that.

--

___
Python tracker 

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



[issue31803] time.clock() should emit a DeprecationWarning

2017-10-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This is the current behavior. Do you suggest to undeprecate time.clock() after 
4 releases of deprecation?

--

___
Python tracker 

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



[issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block

2017-10-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

In this case it would be safe to not erase bytes at all.

PR 4119 is too complex for a bugfix (especially if backport it to 3.5 and 3.4). 
It can introduce other regressions. The performance hit is not the only issue. 
Allocating a temporary buffer can change the structure of "holes" in memory. As 
result some memory related bugs can be reproducible only in release mode.

Maybe it is enough to erase only few bytes at the start and end of the freed 
area. The copy can be saved in local variables, without involving the heap. 
This solution still will be enough complex, and I think it can be applied only 
to 3.7. But the bug should be fixed in all affected versions.

--

___
Python tracker 

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



[issue31803] time.clock() should emit a DeprecationWarning

2017-10-25 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

On 25.10.2017 01:31, STINNER Victor wrote:
> 
> Marc-Andre: "Yes, to avoid yet another Python 2/3 difference. It should be 
> replaced with the appropriate variant on Windows and non-Windows platforms. 
> From Serhiy's response that's time.process_time() on non-Windows platforms 
> and time.perf_counter() on Windows."
> 
> I don't understand why you mean by "replaced with". Do you mean modify the 
> implementation of the time.clock()?

What I meant is that time.clock() is replaced with the higher
accuracy timers corresponding to the current time.clock()
implementation on the various platforms in order to retain
backwards compatibility.

In other words:

if sys.platform == 'win32':
time.clock = time.perf_counter
else:
time.clock = time.process_time

I know that time.clock() behaves differently on different platforms,
but this fact has been known for a long time and is being used by
Python code out there for timing purposes.

--

___
Python tracker 

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



[issue31869] commentary on ssl.PROTOCOL_TLS

2017-10-25 Thread J Sloot

New submission from J Sloot :

on https://docs.python.org/2/library/ssl.html#ssl.PROTOCOL_TLS
for ssl.PROTOCOL_TLS

When the commentary from ssl.PRTOCOL_TLS moved from PROTOCOL_SSLv23 to 
PROTOCOL_TLS the note {Despite the name, this option can select "TLS" protocols 
as well as "SSL"} didn't change.

Suggested new wording {Despite the name, this option can select "SSL" protocols 
as well as "TLS"}

--
assignee: docs@python
components: Documentation
messages: 304996
nosy: J Sloot, docs@python
priority: normal
severity: normal
status: open
title: commentary on ssl.PROTOCOL_TLS
versions: Python 2.7

___
Python tracker 

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



[issue31852] Crashes with lines of the form "async \"

2017-10-25 Thread STINNER Victor

STINNER Victor  added the comment:

> Does it make sense to backport ac317700ce7439e38a8b420218d9a5035bba92ed to 
> 3.6?

No, async was not a keyword in Python 3.6 on purpose. Making it a keyword can 
break a lot of code.

I confirm that Python 3.6 still crashs with a very high number of "async " 
prefixes: try attached async_parser_crash.py.

Extract of the gdb traceback on a crash:

(...)
#665 0x00454867 in tok_get (tok=0x7f8b98c0, 
p_start=0x7f8b9cb8, p_end=0x7f8b9cb0) at Parser/tokenizer.c:1571
#666 0x00454867 in tok_get (tok=0x7f8b9d40, 
p_start=0x7f8ba138, p_end=0x7f8ba130) at Parser/tokenizer.c:1571
#667 0x00454867 in tok_get (tok=0x7f8ba1c0, 
p_start=0x7f8ba5b8, p_end=0x7f8ba5b0) at Parser/tokenizer.c:1571
#668 0x00454867 in tok_get (tok=0x7f8ba640, 
p_start=0x7f8baa38, p_end=0x7f8baa30) at Parser/tokenizer.c:1571
#669 0x00454867 in tok_get (tok=0x7f8baac0, 
p_start=0x7f8baeb8, p_end=0x7f8baeb0) at Parser/tokenizer.c:1571
#670 0x00454867 in tok_get (tok=0x7f8baf40, 
p_start=0x7f8bb338, p_end=0x7f8bb330) at Parser/tokenizer.c:1571
#671 0x00454867 in tok_get (tok=0x7f8bb3c0, 
p_start=0x7f8bb7b8, p_end=0x7f8bb7b0) at Parser/tokenizer.c:1571
(...)

It looks like a stack overflow.

The tokenizer may fail earlier on "async async ".

--
nosy: +haypo
Added file: https://bugs.python.org/file47237/async_parser_crash.py

___
Python tracker 

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



[issue31852] Crashes with lines of the form "async \"

2017-10-25 Thread STINNER Victor

Change by STINNER Victor :


--
nosy: +yselivanov

___
Python tracker 

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



[issue25083] Python can sometimes create incorrect .pyc files

2017-10-25 Thread STINNER Victor

Change 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



[issue25083] Python can sometimes create incorrect .pyc files

2017-10-25 Thread Petr Viktorin

Petr Viktorin  added the comment:

tzickel, could you sign the CLA? It will formally allow PSF to distribute your 
patch with Python. (You retain the copyright.) See the dev guide for 
instructions: https://docs.python.org/devguide/pullrequest.html#cla

I can't do that for you, but if you want, I can do the rest (open a pull 
request and convince some core developer to merge it) after you sign the CLA.

--

___
Python tracker 

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



[issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block

2017-10-25 Thread STINNER Victor

STINNER Victor  added the comment:

> The current code in not correct on all platforms.

My PR 4119 only changes the behaviour on OpenBSD, but I'm not sure about that. 
Maybe it's simpler to apply this fix on all platforms, as I asked on the PR 
itself?

--

___
Python tracker 

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



[issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block

2017-10-25 Thread STINNER Victor

STINNER Victor  added the comment:

> PR 3844 restores the behavior of 2.7 and 3.3. I propose to merge it first, 
> and develop other enhancements later.

Please don't. This PR reintroduced a bug that I fixed in bpo-18408:

commit c4266360fc70745d49b09f2c29cda91c1a007525
Author: Victor Stinner 
Date:   Tue Jul 9 00:44:43 2013 +0200

Issue #18408: Fix _PyMem_DebugRealloc()

Don't mark old extra memory dead before calling realloc(). realloc() can 
fail
and realloc() must not touch the original buffer on failure.

So mark old extra memory dead only on success if the new buffer did not move
(has the same address).

--

___
Python tracker 

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



[issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block

2017-10-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The current code in not correct on all platforms. We don't know how many of 
random bugs, hangs and crashes on other platforms are caused by this bug. I'm 
not surprised that it was caught on OpenBSD since the robustness and security 
of software is the goal of OpenBSD.

PR 3844 restores the behavior of 2.7 and 3.3. I propose to merge it first, and 
develop other enhancements later.

--

___
Python tracker 

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



[issue31664] Add support of new crypt methods

2017-10-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Tests on s390x SLES 3.x are passed.

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



[issue18835] Add aligned memory variants to the suite of PyMem functions/macros

2017-10-25 Thread STINNER Victor

STINNER Victor  added the comment:

Currently, the main question on my PR 4089 was raised by Antoine Pitrou:
"Do people have to provide aligned_alloc and aligned_free? Or can they leave 
those pointers NULL and get a default implementation?"

My reply: "Currently, you must provide all allocator functions, included 
aligned_alloc and aligned_free. Technically, we can implement a fallback, but 
I'm not sure that I want to do that :-)"

I'm not sure about that. I can imagine platforms which provide a special 
malloc/free and that's all: no calloc, posix_memalign or _aligned_malloc(). But 
is Python suppose to fills the holes? For example, implement calloc() as 
malloc()+memset()? Or is the user of the PyMem_SetAllocator() API responsible 
to reimplement them?

In Python 3.5, we added the requirement of a working calloc().

In Python 3.7, should we also add the "aligned alloc" requirement?

In case of doubt, I prefer not to guess, and leave the decision to the caller 
of the API: require all functions to be implemented.

I'm not sure that it's a good idea to provide a "aligned malloc" fallback if 
such fallback would be inefficient. For example, we would have to overallocate 
the memory block not only for the requested alignement, but also allocates 
extra sizeof(size_t) bytes, *in each* aligned memmory block, to store the size 
of the alignment itself, to recover the original pointer... to finally be able 
to call free().

An aligned memory block would look like: [A SSS DDD...DDD] where A 
are bytes lost for alignment, SSS bytes storing the alignment size (size of 
"A" in this example), and "DDD...DDD" would be the actual data.

--

___
Python tracker 

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



[issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block

2017-10-25 Thread STINNER Victor

STINNER Victor  added the comment:

"I tried to build CPython on 64-bit OpenBSD. It was built successfully, but 
tests crash."

It's the first time that anyone complains about _PyMem_DebugRawRealloc(). The 
behaviour seems to be very specific to OpenBSD.

Even if the current code is "weird", it works very well and is effecient.

I proposed attached PR 4119 which makes _PyMem_DebugRawRealloc() behaves 
correctly: erase bytes *before* calling realloc(), but keeps a copy if 
realloc() fails. My PR only changes the behaviour on OpenBSD. It keeps the 
current behaviour (erase bytes *after* realloc, if realloc succeeded) on other 
platforms for performance reasons.

--

___
Python tracker 

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



[issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block

2017-10-25 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4089

___
Python tracker 

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



[issue31626] Writing in freed memory in _PyMem_DebugRawRealloc() after shrinking a memory block

2017-10-25 Thread STINNER Victor

STINNER Victor  added the comment:

> Using nested _PyMem_DebugRawRealloc() looks suspicions to me. This may be a 
> bug.

PyObject_Malloc() calls PyMem_RawMalloc() for allocations larger than 512 bytes.

When debug hooks are enabled, PyObject_Malloc() and PyMem_RawMalloc() both call 
_PyMem_DebugRawRealloc(). The behaviour that you saw is expected.

It was simpler to reuse _PyMem_DebugRawRealloc() PyObject and PyMem_Raw 
allocator families, rather than duplicating the code.

--

___
Python tracker 

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



[issue21720] "TypeError: Item in ``from list'' not a string" message

2017-10-25 Thread Tal Einat

Tal Einat  added the comment:

I can't say I agree that the performance here is practically insignificant. 
This will affect the startup time of Python process, and adding even 10% to 
that in some cases is significant.

In some of the larger codebases I've worked on, even simple scripts would 
import large portions of the system, and there would be thousands of such 
imports done in the process. There are "basic" utilities in the stdlib which 
are imported very often in different modules, so the performance of the import 
statement is not necessarily insignificant compared to that of actually loading 
the modules.

That being said I'm all for getting this in and implementing an optimization of 
the slower path in time for 3.7.

--
nosy: +taleinat

___
Python tracker 

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



[issue31664] Add support of new crypt methods

2017-10-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 0f261583bae7e60e410709ed96398dd1b14c5454 by Serhiy Storchaka in 
branch 'master':
bpo-31664: Fix test_crypt for the openwall implementation of crypt. (#4116)
https://github.com/python/cpython/commit/0f261583bae7e60e410709ed96398dd1b14c5454


--

___
Python tracker 

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



[issue21720] "TypeError: Item in ``from list'' not a string" message

2017-10-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

There are other differences between Python 2.7 and Python 3. PR 4118 restores 
the Python 2.7 logic. It adds type checking, but its overhead is smaller.

$ ./python -m timeit 'from encodings import aliases'
50 loops, best of 5: 542 nsec per loop

Actually in some cases (with '*') the new code is even slightly faster.

I don't know whether these differences were intentional, but all tests are 
passed.

The type of items in __all__ also is checked.

--

___
Python tracker 

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



[issue21720] "TypeError: Item in ``from list'' not a string" message

2017-10-25 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +4088

___
Python tracker 

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



[issue31835] _PyFunction_FastCallDict and _PyFunction_FastCallKeywords: fast path not used

2017-10-25 Thread STINNER Victor

Change by STINNER Victor :


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



[issue31835] _PyFunction_FastCallDict and _PyFunction_FastCallKeywords: fast path not used

2017-10-25 Thread STINNER Victor

STINNER Victor  added the comment:

Thank you Anselm Kruis for spotting this nice optimization opportunity! Sadly, 
as I wrote, I don't want to backport the optimization to the stable Python 3.6 
branch.

--

___
Python tracker 

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



[issue31835] _PyFunction_FastCallDict and _PyFunction_FastCallKeywords: fast path not used

2017-10-25 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 086c3ae5f0995a62092b9080f32dd118c2923453 by Victor Stinner in 
branch 'master':
bpo-31835: Optimize also FASTCALL using __future__ (#4087)
https://github.com/python/cpython/commit/086c3ae5f0995a62092b9080f32dd118c2923453


--

___
Python tracker 

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



[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2017-10-25 Thread Tal Einat

Tal Einat  added the comment:

See PR 4117 on GitHub with the itertools AC conversion.

--

___
Python tracker 

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



[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2017-10-25 Thread Tal Einat

Change by Tal Einat :


--
pull_requests: +4087
stage: needs patch -> patch review

___
Python tracker 

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



[issue31868] Null pointer dereference in ndb.ndbm get when used with a default value.

2017-10-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Could you please create a pull request on GitHub Tomasz?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31867] Duplicated keys in MIME type_map with different values

2017-10-25 Thread Henk-Jaap Wagenaar

Henk-Jaap Wagenaar  added the comment:

So for excel, 'application/excel' is not listed at 
http://www.iana.org/assignments/media-types as suggested by the comment at:
https://github.com/python/cpython/blob/master/Lib/mimetypes.py#L397
whereas 'applicaton/vnd.ms-excel' is listed. See also
https://stackoverflow.com/questions/974079/setting-mime-type-for-excel-document.

For cdf, Wolframalpha is using application/cdf it seems (without it being 
registered) whereas NetCDF suggests application/x-netcdf so that seems 
reasonable (and is the current value).

For context, these duplicates were introduced here:
https://github.com/python/cpython/commit/a3689fe78675c89d5979c0c5acdb1c173cc75ed6
and noted first here:
https://github.com/python/cpython/commit/107771a228ee73b4683242cb696e3024f93b74d5

--
nosy: +Henk-Jaap Wagenaar
title: Duplicated keys, but with different values in dictionary literals -> 
Duplicated keys in MIME type_map with different values

___
Python tracker 

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



[issue31664] Add support of new crypt methods

2017-10-25 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +4086
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



[issue31809] ssl module unnecessarily pins the client curve when using ECDH

2017-10-25 Thread Andy

Andy  added the comment:

Thanks for adding the test!

If the official stance is that only the latest OpenSSL is supported then this 
is definitely WAI. Sounds like a good policy...

I'll close this issue.

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

___
Python tracker 

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



[issue31868] Null pointer dereference in ndb.ndbm get when used with a default value.

2017-10-25 Thread Tomasz Miąsko

New submission from Tomasz Miąsko :

Using ndb.ndbm get when key is missing and default value has to be returned
results in invocation of Py_INCREF on null pointer. Test case to reproduce the 
issue:

```
import dbm.ndbm

with dbm.ndbm.open('db', 'n') as db:
print(db.get('missing-key'))
```

--
files: 0001-Fix-null-pointer-dereference-in-dbm.ndbm-get.patch
keywords: patch
messages: 304977
nosy: tmiasko
priority: normal
severity: normal
status: open
title: Null pointer dereference in ndb.ndbm get when used with a default value.
type: crash
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8
Added file: 
https://bugs.python.org/file47236/0001-Fix-null-pointer-dereference-in-dbm.ndbm-get.patch

___
Python tracker 

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



[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2017-10-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Yes, it is. Actually the #include should be before lists of methods and static 
PyTypeObject initializers. I think it is better to move all method lists and 
type initializers to the bottom of the file.

--

___
Python tracker 

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



[issue31852] Crashes with lines of the form "async \"

2017-10-25 Thread Pablo Galindo Salgado

Pablo Galindo Salgado  added the comment:

This issue is fixed in the master branch (version 3.7.0 alpha 2). The issue was 
fixed in this PR:

https://github.com/python/cpython/pull/1669

The cause is that async was not a proper keyword and the parser segfaults when 
checking for the new token and parsing the newline. In particular, this happens 
here:

translate_newlines at Parser/tokenizer.c:713
713 buf = PyMem_MALLOC(needed_length);

This is the stack trace:

#0  _PyObject_Alloc (ctx=, elsize=10, nelem=1, use_calloc=0) at 
Objects/obmalloc.c:806
#1  _PyObject_Malloc (ctx=, nbytes=10) at Objects/obmalloc.c:985
#2  0x00453020 in translate_newlines (tok=0x9187b0, exec_input=0, 
s=0x77fa40e0 "async \\\n") at Parser/tokenizer.c:713
#3  tok_nextc (tok=tok@entry=0x9187b0) at Parser/tokenizer.c:943
#4  0x00454948 in tok_get (tok=tok@entry=0x9187b0, 
p_start=p_start@entry=0x7fffdc40, p_end=p_end@entry=0x7fffdc50)
at Parser/tokenizer.c:1382
#5  0x00455749 in PyTokenizer_Get (tok=tok@entry=0x9187b0, 
p_start=p_start@entry=0x7fffdc40, p_end=p_end@entry=0x7fffdc50)
at Parser/tokenizer.c:1902
#6  0x0045158d in parsetok (tok=0x9187b0, g=, start=256, 
err_ret=err_ret@entry=0x7fffdce0,
flags=flags@entry=0x7fffdcd0) at Parser/parsetok.c:208
#7  0x00452280 in PyParser_ParseFileObject (fp=, 
filename=filename@entry=0x77f1b848, enc=,
g=, start=, ps1=, 
ps2=0x77e63648 "... ", err_ret=err_ret@entry=0x7fffdce0,
flags=flags@entry=0x7fffdcd0) at Parser/parsetok.c:134
#8  0x00433949 in PyParser_ASTFromFileObject (fp=, 
filename=0x77f1b848, enc=,
start=, ps1=, ps2=, 
flags=0x7fffde90, errcode=0x7fffdd80, arena=0x77fe2168)
at Python/pythonrun.c:1166
#9  0x00433b5b in PyRun_InteractiveOneObject 
(fp=fp@entry=0x774b2640 <_IO_2_1_stdin_>, 
filename=filename@entry=0x77f1b848,
flags=flags@entry=0x7fffde90) at Python/pythonrun.c:218
#10 0x00433eae in PyRun_InteractiveLoopFlags 
(fp=fp@entry=0x774b2640 <_IO_2_1_stdin_>,
filename_str=filename_str@entry=0x5dd7a4 "", 
flags=flags@entry=0x7fffde90) at Python/pythonrun.c:115
#11 0x00433fbc in PyRun_AnyFileExFlags (fp=0x774b2640 
<_IO_2_1_stdin_>, filename=0x5dd7a4 "", closeit=0,
flags=0x7fffde90) at Python/pythonrun.c:77
#12 0x004476fa in run_file (p_cf=0x7fffde90, filename=, fp=0x774b2640 <_IO_2_1_stdin_>) at Modules/main.c:341
#13 Py_Main (argc=argc@entry=1, argv=argv@entry=0x910010) at Modules/main.c:895
#14 0x0041e17a in main (argc=1, argv=) at 
./Programs/python.c:102

After applying commit ac317700ce7439e38a8b420218d9a5035bba92ed the issue is 
fixed.

Does it make sense to backport ac317700ce7439e38a8b420218d9a5035bba92ed to 3.6?

--
nosy: +pablogsal

___
Python tracker 

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



[issue31867] Duplicated keys, but with different values in dictionary literals

2017-10-25 Thread Mark Shannon

Mark Shannon  added the comment:

I hadn't noticed the comments on the lines above saying "Duplicates :(", so I'm 
obviously not the first to notice.

--

___
Python tracker 

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



[issue31867] Duplicated keys, but with different values in dictionary literals

2017-10-25 Thread Mark Shannon

New submission from Mark Shannon :

Here
https://github.com/python/cpython/blob/master/Lib/mimetypes.py#L416
and here
https://github.com/python/cpython/blob/master/Lib/mimetypes.py#L526

I have no idea which is the correct value for either, but the code is 
misleading at best.

--
components: Library (Lib)
messages: 304973
nosy: Mark.Shannon
priority: normal
severity: normal
status: open
title: Duplicated keys, but with different values in dictionary literals
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



[issue20180] Derby #11: Convert 50 sites to Argument Clinic across 9 files

2017-10-25 Thread Tal Einat

Tal Einat  added the comment:

As far as I can tell, with the creation of a separate clinic/itertools.c.h, the 
typedefs etc. need to be moved to the top of the file so that the #include can 
come after the typedefs and before the rest of the code which references clinic 
output. Is this indeed the way to go?

--

___
Python tracker 

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



[issue21720] "TypeError: Item in ``from list'' not a string" message

2017-10-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The from import already is much slower than simple import:

$ ./python -m timeit 'from encodings import aliases'
50 loops, best of 5: 475 nsec per loop
$ ./python -m timeit 'import encodings.aliases as aliases'
100 loops, best of 5: 289 nsec per loop

The latter executes only C code if the module already is imported, but the 
former executes Python code. It may be worth to add the C acceleration for this 
case too.

PR 4113 makes it yet slower:
 
$ ./python -m timeit 'from encodings import aliases'
50 loops, best of 5: 793 nsec per loop

--

___
Python tracker 

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



[issue24564] shutil.copytree fails when copying NFS to NFS

2017-10-25 Thread Albert Zeyer

Albert Zeyer  added the comment:

I'm also affected by this, with Python 3.6. My home directory is on a 
ZFS-backed NFS share.
See here for details:
https://github.com/Linuxbrew/homebrew-core/issues/4799

Basically:
Copying setuptools.egg-info to 
/u/zeyer/.linuxbrew/lib/python3.6/site-packages/setuptools-36.5.0-py3.6.egg-info
error: [Errno 5] Input/output error: 
'/u/zeyer/.linuxbrew/lib/python3.6/site-packages/setuptools-36.5.0-py3.6.egg-info/zip-safe'

Note that also by other tools, such as `mv` and `cp`, I get errors about 
setting `system.nfs4_acl`. But they just seem to ignore that and go on. I think 
this is the right thing to do here. You can print a warning about that, but 
then just go on. Maybe esp. just for `system.nfs4_acl`.

--
nosy: +Albert.Zeyer
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



[issue21720] "TypeError: Item in ``from list'' not a string" message

2017-10-25 Thread Nick Coghlan

Nick Coghlan  added the comment:

I'm fine with the approach in the latest version of the PR - it does make "from 
x import y" slightly slower due to the extra error checking, but folks should 
be avoiding doing that in performance critical loops or functions anyway.

It would be nice if we could avoid that overhead for the import statement case, 
but we can't readily tell the difference between "__import__ called via syntax" 
and "__import__ called directly", and I don't think this is going to be 
performance critical enough to be worth introducing that complexity.

The question of how best to handle passing a consumable iterator as the from 
list would be a separate question, if we decided to do anything about it at all 
(the current implementation implicitly assumes the input is reiterable, but 
passing a non-container seems like a harder mistake to make than accidentally 
passing bytes instead of a string).

--

___
Python tracker 

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



[issue30855] [2.7] test_tk: test_use() of test_tkinter.test_widgets randomly fails with "integer value too large to represent" on with AMD64 Windows8 3.5

2017-10-25 Thread STINNER Victor

STINNER Victor  added the comment:

Too bad, the bug is not dead:

http://buildbot.python.org/all/#/builders/45/builds/14

test_use (test_tkinter.test_widgets.ToplevelTest) ... ERROR
test_visual (test_tkinter.test_widgets.ToplevelTest) ... ok
test test_tk failed -- Traceback (most recent call last):
  File 
"d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\lib-tk\test\test_tkinter\test_widgets.py",
 line 92, in test_use
widget2 = self.create(use=wid)
  File 
"d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\lib-tk\test\test_tkinter\test_widgets.py",
 line 67, in create
return tkinter.Toplevel(self.root, **kwargs)
  File 
"d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\lib-tk\Tkinter.py", 
line 2138, in __init__
BaseWidget.__init__(self, master, 'toplevel', cnf, {}, extra)
  File 
"d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\lib-tk\Tkinter.py", 
line 2095, in __init__
(widgetName, self._w) + extra + self._options(cnf))
TclError: expected integer but got "0x8e5c00d6L"
test_width (test_tkinter.test_widgets.ToplevelTest) ... ok
==
ERROR: test_use (test_tkinter.test_widgets.ToplevelTest)
--
Traceback (most recent call last):
  File 
"d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\lib-tk\test\test_tkinter\test_widgets.py",
 line 92, in test_use
widget2 = self.create(use=wid)
  File 
"d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\lib-tk\test\test_tkinter\test_widgets.py",
 line 67, in create
return tkinter.Toplevel(self.root, **kwargs)
  File 
"d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\lib-tk\Tkinter.py", 
line 2138, in __init__
BaseWidget.__init__(self, master, 'toplevel', cnf, {}, extra)
  File 
"d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\lib-tk\Tkinter.py", 
line 2095, in __init__
(widgetName, self._w) + extra + self._options(cnf))
TclError: expected integer but got "0x8e5c00d6L"

--
nosy: +terry.reedy
resolution: out of date -> 
status: closed -> open

___
Python tracker 

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



[issue21720] "TypeError: Item in ``from list'' not a string" message

2017-10-25 Thread Berker Peksag

Berker Peksag  added the comment:

> I don't think the index in error message is needed.

I'm fine with either format. It's ultimately up to Nick. Should I switch back 
to the 2.7 version?

> Import is successful because the iterator was exhausted by "'*' in fromlist".

This shouldn't be a problem in the latest version of PR 4113. While I don't 
think anyone would pass ``fromlist=iter(('aliases', b'foobar'))`` in real life, 
I can add it to the test. Let me know 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



[issue28503] [Patch] '_crypt' module: fix implicit declaration of crypt(), use crypt_r() where available

2017-10-25 Thread Ed Schouten

Ed Schouten  added the comment:

Having looked at various implementations of crypt() and crypt_r(), I can't 
think of a reason why there would be any significant difference in performance. 
On systems like FreeBSD, crypt() is just a simple wrapper around crypt_r():

https://svnweb.freebsd.org/base/head/lib/libcrypt/crypt.c?view=markup#l134

If there would be any difference in performance, it would also be 
astronomically small compared to the computation time spent by the 
cryptographic hash functions themselves.

--

___
Python tracker 

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



[issue28503] [Patch] '_crypt' module: fix implicit declaration of crypt(), use crypt_r() where available

2017-10-25 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I'm not sure performance matters.  Modern crypt() algorithms should actually be 
slow enough (using a large number of rounds) to make brute-force attacks 
impractical...

--
nosy: +pitrou
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



[issue31866] clean out some more AtheOS code

2017-10-25 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

What about configure.ac?

"On some platforms (AtheOS)" in the comment in Modules/_cryptmodule.c is 
redundant. crypt() should return NULL on error, and it often returns NULL for 
an invalid salt.

--
nosy: +serhiy.storchaka

___
Python tracker 

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