[issue31624] remove support for BSD/OS

2017-09-28 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset 288d1daadaddf6ae35cf666138ba4b5d07449657 by Benjamin Peterson in 
branch 'master':
remove support for BSD/OS (closes bpo-31624) (#3812)
https://github.com/python/cpython/commit/288d1daadaddf6ae35cf666138ba4b5d07449657


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



[issue31285] a SystemError and an assertion failure in warnings.warn_explicit()

2017-09-28 Thread Oren Milman

Oren Milman  added the comment:

Another thought - the existing code assumes that splitlines() returned a string.
So maybe we could just check that get_source() returned a string, and then call
the method str.splitlines() on it?

--

___
Python tracker 

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



[issue31620] asyncio.Queue leaks memory if the queue is empty and consumers poll it frequently

2017-09-28 Thread Surenkumar Nihalani

Change by Surenkumar Nihalani :


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

___
Python tracker 

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



[issue31603] Please add argument to override stdin/out/err in the input builtin

2017-09-28 Thread Wren Turkal

Wren Turkal  added the comment:

Added a PR to facilitate discussion on python-ideas.

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

___
Python tracker 

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



[issue31624] remove support for BSD/OS

2017-09-28 Thread Benjamin Peterson

Change by Benjamin Peterson :


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

___
Python tracker 

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



[issue31624] remove support for BSD/OS

2017-09-28 Thread Benjamin Peterson

New submission from Benjamin Peterson :

This operating system hasn't been supported by its vendor since 2004. We should 
get rid of our code for it.

--
components: Build
messages: 303296
nosy: benjamin.peterson
priority: normal
severity: normal
status: open
title: remove support for BSD/OS
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



[issue31623] Allow to build MSI installer from the official tarball

2017-09-28 Thread Ivan Pozdeev

Ivan Pozdeev  added the comment:

With this patch, I managed to make a working installer.

There's nothing in PCBuild/readme.txt about making an installer, and this is 
the only relevant tool I found in the source. If there's another, feel free to 
close the ticket, and I'll create another one to fix the readme.

--

___
Python tracker 

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



[issue31623] Allow to build MSI installer from the official tarball

2017-09-28 Thread Ivan Pozdeev

Change by Ivan Pozdeev :


--
nosy: +r.david.murray

___
Python tracker 

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



[issue31623] Allow to build MSI installer from the official tarball

2017-09-28 Thread Ivan Pozdeev

Change by Ivan Pozdeev :


--
keywords: +patch
nosy:  -r.david.murray
Added file: 
https://bugs.python.org/file47176/0001-Support-making-MSI-installer-from-tarball.patch

___
Python tracker 

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



[issue31623] Allow to build MSI installer from the official tarball

2017-09-28 Thread R. David Murray

R. David Murray  added the comment:

Assuming 3.4 is packagable using msi and hg is the only problem, I presume you 
could use an hg-git adapter to get an hg checkout to build from.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue31622] Make threading.get_ident() return an opaque type

2017-09-28 Thread R. David Murray

R. David Murray  added the comment:

Are you aware of PEP 539?  (See issue 25658 for discussion.)  I haven't 
followed that closely, but I imagine this issue is at least related.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue31623] Allow to build MSI installer from the official tarball

2017-09-28 Thread Ivan Pozdeev

New submission from Ivan Pozdeev :

Since the last version of 3.4 is only made available as a source tarball, it's 
imperative to be able to make a distributable package locally from it. 
Tools/msi/msi.py only works from an `hg' checkout.

--
components: Build
messages: 303292
nosy: Ivan.Pozdeev
priority: normal
severity: normal
status: open
title: Allow to build MSI installer from the official tarball
type: enhancement
versions: Python 3.4

___
Python tracker 

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



[issue31622] Make threading.get_ident() return an opaque type

2017-09-28 Thread pdox

New submission from pdox :

Currently, Python exposes "thread identifiers" as unsigned long values across 
multiple modules:

threading.get_ident() -> Returns an integer thread id
sys._current_frames() -> Dictionary keys are integer thread ids
signal.pthread_kill() -> Accepts an arbitrary integer thread id

In reality, OS level thread identifiers are opaque types. On a system with 
pthreads, the thread_id that Python provides is merely pthread_t casted to 
unsigned long. This works today, but is in violation of the standard, and could 
break on systems with exotic pthread_t.

There is also the ability to introduce undefined behavior, such as sending a 
signal to an invalid thread id:

>>> signal.pthread_kill(42, signal.SIGHUP)
Segmentation fault (core dumped)

Changing the thread identifiers to an opaque type (which also tracks the 
validity of the thread id, for blocking use of expired system thread ids) will 
solve these two issues.

--
components: Library (Lib)
messages: 303291
nosy: pdox
priority: normal
severity: normal
status: open
title: Make threading.get_ident() return an opaque type
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



[issue31620] asyncio.Queue leaks memory if the queue is empty and consumers poll it frequently

2017-09-28 Thread Surenkumar Nihalani

Surenkumar Nihalani  added the comment:

I am working on fixing this.

--
nosy: +snihalani

___
Python tracker 

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



[issue25351] pyvenv activate script failure with specific bash option

2017-09-28 Thread Sorin Sbarnea

Sorin Sbarnea  added the comment:

Based on my tests this worked with all shells I tested with, the syntax being a 
very old one and not some new/modern one. 

Passed: bash, zsh, dash, ksh
Platforms: MacOS, RHEL Linux

Failed with: tcsh but with the note that even the original code would fail with 
tcsh anyway. tcsh/csh are not bourne/posix compatible so there is no regression 
introduced by the the use of "${VAR:-}" syntax.

A simple way to test the syntax with enable shell is:
SHELLCMD -c 'echo "[${AAA:-}]"'

--

___
Python tracker 

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



[issue25351] pyvenv activate script failure with specific bash option

2017-09-28 Thread R. David Murray

R. David Murray  added the comment:

Note that in the equivalent issue raised against virtualenv, the concern was 
raised that some old sh-like shells might not support this syntax, but it was 
pointed out that it is part of the posix standard.  I'm not arguing for or 
against here, just noting relevant information :)

The script comment specifically says "from bash", but presumably the script can 
be and is sourced from other sh-like shells.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-09-28 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Crude import benchmark (Ubuntu):

* before:

$ time ./python -c "import uuid"

real0m0.074s
user0m0.056s
sys 0m0.012s

* after:

$ time ./python -c "import uuid"

real0m0.030s
user0m0.028s
sys 0m0.000s

* baseline:

$ time ./python -c pass

real0m0.027s
user0m0.024s
sys 0m0.000s

--

___
Python tracker 

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



[issue31158] test_pty: test_basic() fails randomly on Travis CI

2017-09-28 Thread Cornelius Diekmann

Cornelius Diekmann  added the comment:

Yes, I get the AssertionError with the latest version of PR 3802. From the high 
load avg of my system, you can see that the error occurs very rarely and that I 
need to stress my system to trigger it. With PR 3802, the error occurs way less 
frequently than without it. So we are definitely moving into the right 
direction. With PR 3808, I could not trigger any error (on my system).

Changing the conditions to "b'\n' not in s2" should work. But we actually mean 
to read a line, so this should be better reflected in the code. I prefer 
calling a readline() function directly, which is almost self-documenting code.

> Your code calls read(1) in a loop until it gets the newline character b'\n'.
> Is it better to os.read(1024) in a loop until the output string contains 
> b'\n'?
Behavior may be different if there are multiple short lines in the buffer 
(which should not be the case in the unit test, but this may be a problem if 
somebody copies the code and uses it somewhere else).
pitrou in the discussion of PR 3808 suggests the ultimate answer to the 
question: Just use an existing readline function from the library :-)
I added this to PR 3808.

Personal thought: I care about good code in the unit tests because people might 
look at this as reference how to use a module and copy from it. I want 
the tests to be deterministic, which---as long as the tests pass---implies a 
stable CI ;-)

--

___
Python tracker 

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



[issue31558] gc.freeze() - an API to mark objects as uncollectable

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:

(my previous msg303283 was for the bpo-11063, I removed it, sorry for the spam.)

--

___
Python tracker 

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



[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:

I ran two benchmarks on my Fedora 26.

* new = master (commit a106aec2ed6ba171838ca7e6ba43c4e722bbecd1)
* ref = commit 8d59aca4a953b097a9b02b0ecafef840e4ac5855

git co master
./python -m perf timeit -s 'import sys, uuid' "del sys.modules['uuid']; import 
uuid; uuid = None" --inherit=PYTHONPATH -v -o import_new.json
./python -m perf timeit -s 'import uuid; u=uuid.uuid1' "u()" 
--inherit=PYTHONPATH -v -o uuid1_new.json

git co 8d59aca4a953b097a9b02b0ecafef840e4ac5855
./python -m perf timeit -s 'import uuid; u=uuid.uuid1' "u()" 
--inherit=PYTHONPATH -v -o uuid1_ref.json
./python -m perf timeit -s 'import sys, uuid' "del sys.modules['uuid']; import 
uuid; uuid = None" --inherit=PYTHONPATH -v -o import_ref.json

Import:

haypo@selma$ ./python -m perf compare_to import_ref.json import_new.json --table
+---++-+
| Benchmark | import_ref | import_new  |
+===++=+
| timeit| 4.04 ms| 430 us: 9.39x faster (-89%) |
+---++-+

uuid.uuid1():

haypo@selma$ ./python -m perf compare_to uuid1_ref.json uuid1_new.json --table
+---+---+--+
| Benchmark | uuid1_ref | uuid1_new|
+===+===+==+
| timeit| 18.9 us   | 15.2 us: 1.24x faster (-20%) |
+---+---+--+

Everything is faster. The import time is 9.4x faster, nice!

In practice, the import time is probably even better. My benchmark uses 
repeated import, it doesn't measure the "first time" import which was more 
expensive because of the "import ctypes".

--

___
Python tracker 

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



[issue31558] gc.freeze() - an API to mark objects as uncollectable

2017-09-28 Thread STINNER Victor

Change by STINNER Victor :


--
Removed message: https://bugs.python.org/msg303283

___
Python tracker 

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



[issue31558] gc.freeze() - an API to mark objects as uncollectable

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:

I ran two benchmarks on my Fedora 26.

* new = master (commit a106aec2ed6ba171838ca7e6ba43c4e722bbecd1)
* ref = commit 8d59aca4a953b097a9b02b0ecafef840e4ac5855

git co master
./python -m perf timeit -s 'import sys, uuid' "del sys.modules['uuid']; import 
uuid; uuid = None" --inherit=PYTHONPATH -v -o import_new.json
./python -m perf timeit -s 'import uuid; u=uuid.uuid1' "u()" 
--inherit=PYTHONPATH -v -o uuid1_new.json

git co 8d59aca4a953b097a9b02b0ecafef840e4ac5855
./python -m perf timeit -s 'import uuid; u=uuid.uuid1' "u()" 
--inherit=PYTHONPATH -v -o uuid1_ref.json
./python -m perf timeit -s 'import sys, uuid' "del sys.modules['uuid']; import 
uuid; uuid = None" --inherit=PYTHONPATH -v -o import_ref.json

Import:

haypo@selma$ ./python -m perf compare_to import_ref.json import_new.json --table
+---++-+
| Benchmark | import_ref | import_new  |
+===++=+
| timeit| 4.04 ms| 430 us: 9.39x faster (-89%) |
+---++-+

uuid.uuid1():

haypo@selma$ ./python -m perf compare_to uuid1_ref.json uuid1_new.json --table
+---+---+--+
| Benchmark | uuid1_ref | uuid1_new|
+===+===+==+
| timeit| 18.9 us   | 15.2 us: 1.24x faster (-20%) |
+---+---+--+

Everything is faster. The import time is 9.4x faster, nice! In practice, the 
import time is even better since my benchmark uses repeated import, it doesn't 
measure the "first time" import which was more expensive using "import ctypes" 
previously.

--

___
Python tracker 

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



[issue31604] unittest.TestLoader().loadTestsFromTestCase(...) fails when adding test cases with the expectedFailure decorator

2017-09-28 Thread Krzysztof Warunek

Krzysztof Warunek  added the comment:

AFAIK this helper is meant to be used with test function not the TestCases.

--
nosy: +kwarunek

___
Python tracker 

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



[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-09-28 Thread Antoine Pitrou

Change by Antoine Pitrou :


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



[issue20519] Replace uuid ctypes usage with an extension module.

2017-09-28 Thread Antoine Pitrou

Antoine Pitrou  added the comment:


New changeset a106aec2ed6ba171838ca7e6ba43c4e722bbecd1 by Antoine Pitrou in 
branch 'master':
bpo-11063, bpo-20519: avoid ctypes and improve import time for uuid (#3796)
https://github.com/python/cpython/commit/a106aec2ed6ba171838ca7e6ba43c4e722bbecd1


--

___
Python tracker 

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



[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-09-28 Thread Antoine Pitrou

Antoine Pitrou  added the comment:


New changeset a106aec2ed6ba171838ca7e6ba43c4e722bbecd1 by Antoine Pitrou in 
branch 'master':
bpo-11063, bpo-20519: avoid ctypes and improve import time for uuid (#3796)
https://github.com/python/cpython/commit/a106aec2ed6ba171838ca7e6ba43c4e722bbecd1


--

___
Python tracker 

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



[issue29729] RFE: uuid.UUID(bytes=...): support bytes-like types, not only bytes

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:

Serhiy: "I have tested, this doesn't affect performance."

Oh, thank you for testing that :-)

--

___
Python tracker 

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



[issue29729] RFE: uuid.UUID(bytes=...): support bytes-like types, not only bytes

2017-09-28 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I have tested, this doesn't affect performance.

--

___
Python tracker 

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



[issue29729] RFE: uuid.UUID(bytes=...): support bytes-like types, not only bytes

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:

> The code doesn't work nice with general objects supporting the buffer 
> protocol. The length check suppose that the value has a length, and it is the 
> size in bytes. The code for bytes_le suppose that the value supports slicing 
> and concatenating results of the slicing. And all this code is made as fast 
> as possible. Additional checks and conversions will slowdown it.

I enhanced my PR to also accept memoryview and bytearray in bytes_le. I don't 
think that performance matters so much here. First we need correctness, accept 
any bytes-like objects, no?

--

___
Python tracker 

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



[issue31158] test_pty: test_basic() fails randomly on Travis CI

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:

Hum, let me clarify: my main goal is to get a stable CI. I don't really care of 
the exact implementation of one specific unit test in test_pty ;-)

--

___
Python tracker 

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



[issue31158] test_pty: test_basic() fails randomly on Travis CI

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:

Cornelius:Here is a PoC: I checked out your code and stressed my system with 
it. (...) AssertionError: ..."

Did you get this failure with my PR 3802?

Cornelius: "We have b'For my pet fish, Eric.\r\n' in the pty buffer. We read 
b'For my pet fish, Eric.\r' from the buffer into s2. Now len(s2) == 
len(expected) but a b'\n' is still unread in the buffer. This would make the 
test fail. I admit, this is a corner case, but also an argument that a clean 
test case may want to have a readline function."

Right. I can just modify my condition from "len(s2) < len(expected)" to "b'\n' 
not in s2".

Cornelius: "I also added a pull request which I cannot get to fail on my 
system. What do you think, haypo?"

Your code calls read(1) in a loop until it gets the newline character b'\n'.

Is it better to os.read(1024) in a loop until the output string contains b'\n'?

I have no strong preference.

--

___
Python tracker 

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



[issue31621] Pluralization typo in Language Reference section 7.12

2017-09-28 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

Thanks!

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



[issue31621] Pluralization typo in Language Reference section 7.12

2017-09-28 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset 641494ec3168bd556f0af226196e13ae29bddd53 by Mariatta (Miss 
Islington (bot)) in branch '3.6':
bpo-31621: Fix typo in Simple Statements documentation (GH-3809) (GH-3810)
https://github.com/python/cpython/commit/641494ec3168bd556f0af226196e13ae29bddd53


--

___
Python tracker 

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



[issue31621] Pluralization typo in Language Reference section 7.12

2017-09-28 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +3795

___
Python tracker 

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



[issue31621] Pluralization typo in Language Reference section 7.12

2017-09-28 Thread Kevin

Kevin  added the comment:

Ok, I've created a pull request, available at 
https://github.com/python/cpython/pull/3809.

--

___
Python tracker 

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



[issue31621] Pluralization typo in Language Reference section 7.12

2017-09-28 Thread Kevin

Change by Kevin :


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



[issue31614] can't list groupby generator without breaking the sub groups generators

2017-09-28 Thread Loïc Le Loarer

Loïc Le Loarer  added the comment:

Thanks a lot for the clear answer, sorry for not having read the online 
documentation, I only read the help(itertools.groupby) which has much less 
details.

And for my use case, I can use an explicit command just to compute the number 
of groups.

--

___
Python tracker 

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



[issue31621] Pluralization typo in Language Reference section 7.12

2017-09-28 Thread Kevin

Kevin  added the comment:

Yes, I intend to make a PR shortly.

--

___
Python tracker 

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



[issue31621] Pluralization typo in Language Reference section 7.12

2017-09-28 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

Thanks Kevin. Can you open a pull request with this change?

--
nosy: +Mariatta
stage:  -> needs patch

___
Python tracker 

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



[issue31616] Windows installer: Python binaries are user-writable

2017-09-28 Thread Steve Dower

Steve Dower  added the comment:

Correct, this is expected behavior.

If you want your system to be secure *and* to modify default settings, you have 
to take full responsibility for that. You can't rely on other tools to have 
secure non-default settings (they should have secure *default* settings, which 
we do).

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



[issue31621] Pluralization typo in Language Reference section 7.12

2017-09-28 Thread Kevin

New submission from Kevin :

The documentation for the `global` statement contains the line:

 > CPython implementation detail: The current implementation does not enforce 
 > some of these restriction [...]

"restriction" should be "restrictions" since there is more than one of them.

Attached is a copy of `simple_stmts.rst` with the proposed one-letter change.

--
assignee: docs@python
components: Documentation
files: simple_stmts_pluralized.rst
messages: 303266
nosy: docs@python, kms70847
priority: normal
severity: normal
status: open
title: Pluralization typo in Language Reference section 7.12
versions: Python 3.6, Python 3.7
Added file: https://bugs.python.org/file47175/simple_stmts_pluralized.rst

___
Python tracker 

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



[issue31616] Windows installer: Python binaries are user-writable

2017-09-28 Thread R. David Murray

R. David Murray  added the comment:

I'll let Steve be the one to close this, but it sounds like this isn't even a 
doc bug (ie: it is standard window's practice).

--

___
Python tracker 

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



[issue31620] asyncio.Queue leaks memory if the queue is empty and consumers poll it frequently

2017-09-28 Thread Zack Elan

New submission from Zack Elan :

Repro: Call asyncio.wait_for(some_queue.get(), some_timeout) repeatedly, with 
no items in the queue, so that the call times out each time.

Expected: No increase in memory while polling an empty queue

Actual: The queue holds on to pending "getter" futures until a item passes 
through the queue, which clears the pending tasks out.

Use case:

I have producer and consumer asyncio.Tasks, linked by an asyncio.Queue. The 
producer is idle most of the time and pushes messages very infrequently. The 
consumer task polls the queue with wait_for and a timeout so that it's able to 
record "yep, I'm still idle" when the wait_for times out.

Attached script has a minimal repro. The producer emits an item every 60 
seconds and the consumer polls every second. At the 59th second the _getters 
member of the queue is holding on to 59 pending futures. By varying the 
intervals this can leak an arbitrary amount of memory, for example producer 
emitting an item once a day vs. consumer polling once a second will leak 86,400 
futures.

>From the attached script:

2017-09-28 10:09:12,699 Queue  is idle
...
2017-09-28 10:10:09,784 Queue  is idle
2017-09-28 10:10:10,785 Queue  is idle
2017-09-28 10:10:11,699 Received 0 from 
2017-09-28 10:10:12,700 Queue  is idle
2017-09-28 10:10:13,702 Queue  is idle

Noticed this in 3.6.1, though based on no changes to 
https://github.com/python/cpython/blob/master/Lib/asyncio/queues.py between the 
3.6 branch and master I suspect it also affects 3.6.x and 3.7.

--
components: asyncio
files: test.py
messages: 303264
nosy: yselivanov, zackelan
priority: normal
severity: normal
status: open
title: asyncio.Queue leaks memory if the queue is empty and consumers poll it 
frequently
type: resource usage
versions: Python 3.6
Added file: https://bugs.python.org/file47174/test.py

___
Python tracker 

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



[issue31619] Strange error when convert hexadecimal with underscores to int

2017-09-28 Thread Mark Dickinson

Mark Dickinson  added the comment:

Looks like an overflow check that was questionable in the first place 
(depending on undefined behaviour), and is now both questionable and wrong. 
I'll see if I can find time for a fix this evening (UTC+1).

--

___
Python tracker 

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



[issue31465] Allow _PyType_Lookup() to raise exceptions

2017-09-28 Thread Antoine Pitrou

Change by Antoine Pitrou :


--
nosy:  -pitrou

___
Python tracker 

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



[issue31285] a SystemError and an assertion failure in warnings.warn_explicit()

2017-09-28 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> In 2.7, PyUnicode_Splitlines() first does:
> string = PyUnicode_FromObject(string);

And it raises an exception if the string contains non-ASCII characters.

It is better to avoid str<->unicode convertion as long as possible. And when 
do it for the output a warning, use "replace" or "backslashreplace" error 
handlers or "latin1" decoder to avoid a failure.

--

___
Python tracker 

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



[issue31158] test_pty: test_basic() fails randomly on Travis CI

2017-09-28 Thread Cornelius Diekmann

Change by Cornelius Diekmann :


--
pull_requests: +3792

___
Python tracker 

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



[issue31465] Allow _PyType_Lookup() to raise exceptions

2017-09-28 Thread Stefan Behnel

Change by Stefan Behnel :


--
nosy: +haypo

___
Python tracker 

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



[issue31158] test_pty: test_basic() fails randomly on Travis CI

2017-09-28 Thread Cornelius Diekmann

Cornelius Diekmann  added the comment:

I also added a pull request which I cannot get to fail on my system. What do 
you think, haypo?

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



[issue31285] a SystemError and an assertion failure in warnings.warn_explicit()

2017-09-28 Thread Oren Milman

Oren Milman  added the comment:

In 2.7, PyUnicode_Splitlines() first does:
string = PyUnicode_FromObject(string);

So i thought that PyUnicode_Splitlines() would be fine with receiving a string.

But now i realize that even in case i was right there, PyUnicode_Splitlines()
returns a unicode, and not a string, so there should be problems later.
I wonder how the tests still passed..

--

___
Python tracker 

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



[issue31158] test_pty: test_basic() fails randomly on Travis CI

2017-09-28 Thread Cornelius Diekmann

Cornelius Diekmann  added the comment:

Oh, one more thing, since it is unclear whether read or write is causing the 
error. I replaced
os.write(slave_fd, TEST_STRING_1)
by
pty._writen(slave_fd, TEST_STRING_1)
which makes sure all bytes are written.
After some time, when the load gets high and the machine gets noisy, I get the 
same error:

0:01:09 load avg: 6.17 [597/1] test_pty failed
test test_pty failed -- Traceback (most recent call last):
  File "XXX/cpython/Lib/test/test_pty.py", line 99, in test_basic
normalize_output(s1))
AssertionError: b'I wish to buy a fish license.\n' != b'I wish to buy a fish 
license.'

So the main problem is a nondeterministic read. But I'm only testing on Linux. 
Other systems with different kernel may behave differently. And the 
documentation allows a kernel to make both short reads and writes.

--

___
Python tracker 

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



[issue31285] a SystemError and an assertion failure in warnings.warn_explicit()

2017-09-28 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

PyUnicode_Splitlines() cannot be used here in 2.7, because the source is likely 
a 8-bit string.

Actually I'm not sure this issue is worth to be fixed in 2.7. The fix would be 
different from 3.x and more complex.

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



[issue31158] test_pty: test_basic() fails randomly on Travis CI

2017-09-28 Thread Cornelius Diekmann

Cornelius Diekmann  added the comment:

>> Does reading the string b'I wish to buy a fish license.\n' not cause a 
>> problem, too?
>
>This string TEST_STRING_1 is used for a single os.write() call, whereas 
>TEST_STRING_2 is splitted and written in two parts with two os.write() calls.
>
>I prefer minimal change, since I don't know well the pty module.

I like the idea of minimal change, too :D

Yet, I think your patch does not solve the core problem of read/write being 
nondeterministic. In theory, a pty is similar to a pipe (with termios 
processing in the middle). So any os.write to a pty fd is nondeterministic and 
may put less bytes into the pty buffer than given to the write call (see the 
return value of os.write, which test_pty.py does not check). Multiple writes 
are buffered by the kernel, until the buffer is full. So the kernel already 
accumulates the chunked writing for us. Usually, this works fine.

Similarly, a os.read may also be nondeterministic, depending on how many bytes 
are ready in the pty buffer. This may have nothing to do with the chunked 
writing of the test_pty.py module because the kernel is doing the read/write 
syscalls and handling the pty buffer.

Here is a PoC: I checked out your code and stressed my system with it. I have 2 
physical and 2 virtual cores and started 8 instances of the test to stress my 
kernel with scheduling, locking of kernel buffers (the pty buffer), and making 
read/write more nondeterministic.

./python -b -m test -j 8 test_pty -m test_basic -F

Here is what I got:
0:00:13 load avg: 3.25 [119/1] test_pty failed
test test_pty failed -- Traceback (most recent call last):
  File "XXX/cpython/Lib/test/test_pty.py", line 99, in test_basic
normalize_output(s1))
AssertionError: b'I wish to buy a fish license.\n' != b'I wish to buy a fish 
license.'

>> Is reading len(expected) bytes the correct behavior for systems where 
>> normalize_output is needed?
>
>Yeah, I looked at this function. normalize_output() can return a string 
>shorter than the input: len(normalize_output(s2)) <= len(s2).
>
>So I think that len(s2) < len(expected) is correct.

Warning, obscure corner cases ahead.
In theory, given read is completely nondeterministic and we are on one of the 
strange systems which need normalize_output, the following could happen:
We have b'For my pet fish, Eric.\r\n' in the pty buffer. We read b'For my pet 
fish, Eric.\r' from the buffer into s2. Now len(s2) == len(expected) but a 
b'\n' is still unread in the buffer. This would make the test fail. I admit, 
this is a corner case, but also an argument that a clean test case may want to 
have a readline function.

--

___
Python tracker 

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



[issue31285] a SystemError and an assertion failure in warnings.warn_explicit()

2017-09-28 Thread Oren Milman

Change by Oren Milman :


--
pull_requests: +3791

___
Python tracker 

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



[issue25098] test_uuid fails with pywin32 installed

2017-09-28 Thread Zachary Ware

Zachary Ware  added the comment:

Still fails on Python 3.6.1 with pypiwin32-220; those are the versions I have 
handy to check on.  I've not managed to report it to pywin32 or look into it 
any deeper, though.  If someone can confirm that it's definitely their bug, 
this can be closed as third-party.

--

___
Python tracker 

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



[issue25351] pyvenv activate script failure with specific bash option

2017-09-28 Thread sorin

sorin  added the comment:

This is a perfectly valid bug and I am surprised it was ignored for so long. 

I just raised a PR for addressing it, please review it.

--
keywords: +patch
nosy: +sorin
pull_requests: +3790
stage:  -> patch review
type: enhancement -> behavior
versions: +Python 3.4

___
Python tracker 

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



[issue31610] Use select.poll instead of select.select in SocketServer.BaseServer.serve_forever

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:

> I recommend to use selectors.PollSelector and fallback on 
> selectors.SelectSelector where not available (Windows) in order to use 1 
> syscall only. That's what we did already in socket.py, subprocess.py and 
> others.

It would be nice to have an API in selectors to get a "lightweight" selector, 
for selector and poll.

This API would be appropriate to check on macOS if poll() works or not: 
bpo-28087.

--

___
Python tracker 

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



[issue31616] Windows installer: Python binaries are user-writable

2017-09-28 Thread Paul Moore

Paul Moore  added the comment:

Standard Windows behaviour, in my experience, is inherited permissions.

IMO, the current behaviour is correct - we default to an OS-managed secure 
location for system wide installs, and a user-modifiable location for user 
installs. If the person doing the install chooses an alternate location, we do 
not attempt to set policy on that location, but simply inherit the defined 
permissions.

--

___
Python tracker 

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



[issue31158] test_pty: test_basic() fails randomly on Travis CI

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:

> Does reading the string b'I wish to buy a fish license.\n' not cause a 
> problem, too?

This string TEST_STRING_1 is used for a single os.write() call, whereas 
TEST_STRING_2 is splitted and written in two parts with two os.write() calls.

I prefer minimal change, since I don't know well the pty module.

> Is reading len(expected) bytes the correct behavior for systems where 
> normalize_output is needed?

Yeah, I looked at this function. normalize_output() can return a string shorter 
than the input: len(normalize_output(s2)) <= len(s2).

So I think that len(s2) < len(expected) is correct.

--

___
Python tracker 

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



[issue31610] Use select.poll instead of select.select in SocketServer.BaseServer.serve_forever

2017-09-28 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

I recommend to use selectors.PollSelector and fallback on 
selectors.SelectSelector where not available (Windows) in order to use 1 
syscall only. That's what we did already in socket.py, subprocess.py and others.

--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue29729] RFE: uuid.UUID(bytes=...): support bytes-like types, not only bytes

2017-09-28 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The code doesn't work nice with general objects supporting the buffer protocol. 
The length check suppose that the value has a length, and it is the size in 
bytes. The code for bytes_le suppose that the value supports slicing and 
concatenating results of the slicing. And all this code is made as fast as 
possible. Additional checks and conversions will slowdown it.

--

___
Python tracker 

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



[issue31158] test_pty: test_basic() fails randomly on Travis CI

2017-09-28 Thread Cornelius Diekmann

Cornelius Diekmann  added the comment:

Regarding PR 3802:
 * Does reading the string b'I wish to buy a fish license.\n' not cause a 
problem, too?
 * Is reading len(expected) bytes the correct behavior for systems where 
normalize_output is needed?


I also fixed these issues in one of my (unmerged) pull requests (bpo 
issue29070). Unfortunately, the patch I propose does way too many things at the 
same time and I don't have time currently to untangle it :( Feel free to cherry 
pick the _os_readline function:
https://github.com/python/cpython/pull/2932/files#diff-6c897ae50dce4ffa73bde779206a2059R60
Don't hesitate to put your name on it, if you take the time to review and 
cherry pick :)

Cheers!

--

___
Python tracker 

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



[issue29729] RFE: uuid.UUID(bytes=...): support bytes-like types, not only bytes

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:

Serhiy: is it safe to accept any memoryview? Or should we call explicitly 
.cast('B') on memory views to prevent bad surprises?

The asyncio module doesn't do anything special in sock_sendall(). "data" is 
passed directly to socket.send(), unchanged.

So maybe it's just fine to not do anything special.

--
nosy: +haypo

___
Python tracker 

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



[issue31610] Use select.poll instead of select.select in SocketServer.BaseServer.serve_forever

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:

> Better alternative will be to use poll or epoll even.

epoll requires mulitple system calls, whereas the selector seems to only be 
used only once in most cases, no?

Anyway, maybe selectors.DefaultSelector can be used here?

About poll(): be aware of macOS issues with poll() :-/

--
nosy: +haypo

___
Python tracker 

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



[issue29729] RFE: uuid.UUID(bytes=...): support bytes-like types, not only bytes

2017-09-28 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Ah, Victor already have created a PR!

--
components: +Library (Lib) -Extension Modules
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



[issue31609] PCbuild\clean.bat fails if the path contains whitespaces

2017-09-28 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



[issue28129] assertion failures in ctypes

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:

Ok, now the issue can be closed :-) I backported Oren Milman's fix to Python 
2.7 and 3.6 as well.

Oren Milman: thank you very much for your fix!

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



[issue28129] assertion failures in ctypes

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 8b83687bdf66d2d10afb78e46bcede399deaefde by Victor Stinner in 
branch '2.7':
bpo-28129: fix ctypes crashes (#386) (#3800)
https://github.com/python/cpython/commit/8b83687bdf66d2d10afb78e46bcede399deaefde


--

___
Python tracker 

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



[issue28129] assertion failures in ctypes

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 7d6ddb96b34b94c1cbdf95baa94492c48426404e by Victor Stinner in 
branch '3.6':
bpo-28129: fix ctypes crashes (#386) (#3799)
https://github.com/python/cpython/commit/7d6ddb96b34b94c1cbdf95baa94492c48426404e


--

___
Python tracker 

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



[issue31285] a SystemError and an assertion failure in warnings.warn_explicit()

2017-09-28 Thread Oren Milman

Change by Oren Milman :


--
pull_requests: +3789

___
Python tracker 

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



[issue31158] test_pty: test_basic() fails randomly on Travis CI

2017-09-28 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



[issue29729] RFE: uuid.UUID(bytes=...): support bytes-like types, not only bytes

2017-09-28 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I agree. In any case assert is a bad way of checking argument types. It was 
added in 65b6a80f19736d6313d5eb896d6b2fb6bbf65a03 as a part of migration to 
Python 3. I guess for debugging purposes. Now it isn't needed, 
int.from_bytes() checks whether the type is appropriate.

Do you want to create a pull request Nic?

--

___
Python tracker 

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



[issue31158] test_pty: test_basic() fails randomly on Travis CI

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:

Oh, in fact, it's not that hard to reproduce the failure on Linux:

haypo@selma$ ./python -m test test_pty -m test_basic -F 
Run tests sequentially
0:00:00 load avg: 2.17 [  1] test_pty
0:00:00 load avg: 2.17 [  2] test_pty
0:00:00 load avg: 2.17 [  3] test_pty
(...)
0:00:00 load avg: 2.17 [ 15] test_pty
0:00:00 load avg: 2.17 [ 16] test_pty
test test_pty failed -- Traceback (most recent call last):
  File "/home/haypo/prog/python/master/Lib/test/test_pty.py", line 105, in 
test_basic
self.assertEqual(b'For my pet fish, Eric.\n', normalize_output(s2))
AssertionError: b'For my pet fish, Eric.\n' != b'For m'

test_pty failed
15 tests OK.

1 test failed:
test_pty

Total duration: 486 ms
Tests result: FAILURE

--

___
Python tracker 

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



[issue29729] RFE: uuid.UUID(bytes=...): support bytes-like types, not only bytes

2017-09-28 Thread STINNER Victor

Change by STINNER Victor :


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

___
Python tracker 

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



[issue31619] Strange error when convert hexadecimal with underscores to int

2017-09-28 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

>>> int('1_2_3_4_5_6_7_89', 16)
4886718345
>>> int('1_2_3_4_5_6_7_8_9', 16)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: int string too large to convert

--
components: Interpreter Core
messages: 303240
nosy: georg.brandl, mark.dickinson, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Strange error when convert hexadecimal with underscores to int
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



[issue28129] assertion failures in ctypes

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:

> Shouldn't we close this issue?

Oh, I forgot this issue.

Python 2.7 and 3.6 are also impacted and still accept bug fixes. I proposed 
backports.

--
versions: +Python 2.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



[issue28129] assertion failures in ctypes

2017-09-28 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +3786

___
Python tracker 

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



[issue28129] assertion failures in ctypes

2017-09-28 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +3785
stage:  -> patch review

___
Python tracker 

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



[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:

I abandonned my PR and started to review Antoine's PR 3796 which basically 
combines all previous patches proposed last 6 years :-)

--

___
Python tracker 

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



[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-09-28 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +3784

___
Python tracker 

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



[issue25098] test_uuid fails with pywin32 installed

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:

Zachary: any update on this issue? Is it still a bug?

--
nosy: +haypo

___
Python tracker 

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



[issue29729] RFE: uuid.UUID(bytes=...): support bytes-like types, not only bytes

2017-09-28 Thread STINNER Victor

Change by STINNER Victor :


--
nosy: +serhiy.storchaka
title: UUID bytes constructor has too-tight an assertion -> RFE: 
uuid.UUID(bytes=...): support bytes-like types, not only bytes
type: behavior -> enhancement

___
Python tracker 

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



[issue26793] ctypes issue with threads after fork

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:

The bpo-11063 is going to rewrite uuid using a C extension to avoid ctypes, but 
also defer "import ctypes" until we really need it (when the new C extension is 
not available). I don't think this issue is related to uuid directly, no?

I changed the issue title to: "ctypes issue with threads after fork". Don't 
hesitate to complete/rewrite the title if you understood the issue :-)

--
title: uuid causing thread issues when forking using os.fork py3.4+ -> ctypes 
issue with threads after fork

___
Python tracker 

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



[issue30977] reduce uuid.UUID() memory footprint

2017-09-28 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



[issue28129] assertion failures in ctypes

2017-09-28 Thread Oren Milman

Oren Milman  added the comment:

Shouldn't we close this issue?

--

___
Python tracker 

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



[issue11063] Rework uuid module: lazy initialization and add a new C extension

2017-09-28 Thread STINNER Victor

Change by STINNER Victor :


--
title: uuid.py module import has heavy side effects -> Rework uuid module: lazy 
initialization and add a new C extension

___
Python tracker 

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



[issue11063] uuid.py module import has heavy side effects

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:

I marked bpo-20519 as a duplicate of this issue, even if it's not exactly the 
same. The main purpose of this issue was to use uuid_generate_time() using a C 
extension:

+static PyObject *
+_uuid_generate_random(void)
+{
+uuid_t out;
+uuid_generate_random(out);
+return PyBytes_FromStringAndSize((const char *) out, sizeof(out));
+}

+static PyObject *
+_uuid_generate_time(void)
+{
+uuid_t out;
+uuid_generate_time(out);
+return PyBytes_FromStringAndSize((const char *) out, sizeof(out));
+}

--

___
Python tracker 

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



[issue20519] Replace uuid ctypes usage with an extension module.

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:

There are too many uuid open issues proposing similar changes. I mark this 
issue as a duplicate of bpo-11063 to avoid splitted discussions. Please 
continue the discussion there!

--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> uuid.py module import has heavy side effects

___
Python tracker 

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



[issue11063] uuid.py module import has heavy side effects

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:

I marked bpo-5885 as a duplicate of this issue, even if it's not exactly the 
same. The main purpose of this issue was to use uuid_generate_time() using a C 
extension, as bpo-20519.

+static PyObject *
+uuid_uuid1(PyObject *self, PyObject *args)
+{
+uuid_t out;
+uuid_generate_time(out);
+return PyByteArray_FromStringAndSize((const char *) out,sizeof(out));
+}

+static PyObject *
+uuid_uuid4(PyObject *self, PyObject *args)
+{
+uuid_t out;
+uuid_generate_random(out);
+return PyByteArray_FromStringAndSize(out,sizeof(out));
+}

--

___
Python tracker 

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



[issue31616] Windows installer: Python binaries are user-writable

2017-09-28 Thread R. David Murray

R. David Murray  added the comment:

In fact, this is a backward compatibility issue.  Users expect that if you 
install it in the old location, it behaves like it did in the old location 
(lower security), and this is probably depended on by a number of users of 
python.  We *could* change it in some new feature release I suppose, but I'm 
pretty sure we consciously decided to go with this approach for this reason.

I do wonder what the standard practice is in the Windows world for alternate 
install locations, because that might have been a factor too :)

--
nosy: +r.david.murray

___
Python tracker 

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



[issue11063] uuid.py module import has heavy side effects

2017-09-28 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

PR 3684 seems mostly a subset of what I'm proposing.

--

___
Python tracker 

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



[issue5885] uuid.uuid1() is too slow

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:

Hum, there are many open uuid issues which propose similar changes. I close 
this issue in favor of bpo-11063. Please continue the discussion there.

--
nosy: +haypo
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> uuid.py module import has heavy side effects

___
Python tracker 

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



[issue11063] uuid.py module import has heavy side effects

2017-09-28 Thread STINNER Victor

STINNER Victor  added the comment:

Oh. I was told that the PR 3684 of bpo-5885 in another fix for this issue.

--

___
Python tracker 

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



[issue1350] IDLE - CallTips enhancement - show full doc-string in new window

2017-09-28 Thread Mark Lawrence

Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

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



[issue29400] Add instruction level tracing via sys.settrace

2017-09-28 Thread George King

George King  added the comment:

Nick's implementation of f_trace_lines/f_trace_opcodes serves the same purpose 
as my proposal, and is a simpler solution so I'm abandoning this patch and 
working with that feature instead.

--
stage: test needed -> 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



[issue31618] Change sys.settrace opcode tracing to occur after frame line number update

2017-09-28 Thread George King

George King  added the comment:

The feature was was implemented in bpo-31344. See bpo-29400 for my parallel 
effort, which has been abandoned.

--

___
Python tracker 

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



[issue31618] Change sys.settrace opcode tracing to occur after frame line number update

2017-09-28 Thread George King

New submission from George King :

This patch moves the new opcode tracing added in commit 5a85167 to happen after 
frame->f_lineno is updated. With this patch, when both f_trace_lines and 
f_trace_opcodes are enabled the trace function will see the same line number 
for both the 'line' and 'opcode' events.

A side effect of this patch is that the order of event emission has been 
switched; 'line' now happens before 'opcode'. Maintaining the current order 
would require more elaborate logic.

--
messages: 303225
nosy: gwk, ncoghlan, nedbat, njs, serhiy.storchaka
priority: normal
pull_requests: 3783
severity: normal
status: open
title: Change sys.settrace opcode tracing to occur after frame line number 
update
type: behavior
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



[issue31616] Windows installer: Python binaries are user-writable

2017-09-28 Thread Pat K

Pat K  added the comment:

Thank you for the explanation. I understand this is intentional. However
user without such knowledge of inheritable permissions might want to
default the installation directory to the old one (C:\PythonXX) and
could easily run into this issue without knowing. IMHO extra security
check or explicit warning wouldn't hurt here. Just my 5c.

On 9/28/2017 1:09 PM, Eryk Sun wrote:
> 
> Eryk Sun  added the comment:
> 
> The "(I)" flag in an icacls entry means it's inherited from the parent 
> directory. The installer doesn't override these inherited permissions. 
> Currently, it's your responsibility to do this if you install to a custom 
> directory such as C:\Python36. 
> 
> Starting with Python 3.5, a per-machine installation defaults to a 
> subdirectory of Program Files. This system directory only grants standard 
> users generic read and execute access for subdirectories and files. A 
> per-user installation defaults to the user's Programs directory (i.e. 
> %LocalAppData%\Programs). This directory grants full control to the user, 
> administrators, and the system. Other users have no access.
> 
> --
> components: +Windows
> nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware
> type:  -> enhancement
> 
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue31617] os.path.join() return wrong value in windows

2017-09-28 Thread Eryk Sun

Eryk Sun  added the comment:

This is explained in the docs:

Join one or more path components intelligently If a 
component is an absolute path, all previous components are 
thrown away and joining continues from the absolute path 
component. On Windows, the drive letter is not reset when 
an absolute path component (e.g., r'\foo') is encountered.

--
nosy: +eryksun
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue31536] `make regen-all` triggers wholesale rebuild

2017-09-28 Thread Antoine Pitrou

Change by Antoine Pitrou :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



  1   2   >