[issue33649] asyncio docs overhaul

2018-09-18 Thread miss-islington


miss-islington  added the comment:


New changeset 45452b738b7f94221a94e903fb5975222fbb7a8f by Miss Islington (bot) 
in branch '3.7':
bpo-33649: Fix markup; add another note that asyncio.run is 3.7+ (GH-9389)
https://github.com/python/cpython/commit/45452b738b7f94221a94e903fb5975222fbb7a8f


--

___
Python tracker 

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



[issue32455] PyCompile_OpcodeStackEffect() and dis.stack_effect() are not particularly useful

2018-09-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue33138] Improve standard error for uncopyable types

2018-09-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Does anybody have opinion about this issue? Is this option the best of 
possible? I'm going to merge the PR soon.

--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue33721] os.path.exists() ought to return False if pathname contains NUL

2018-09-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 0185f34ddcf07b78feb6ac666fbfd4615d26b028 by Serhiy Storchaka in 
branch 'master':
 bpo-33721: Make some os.path functions and pathlib.Path methods be tolerant to 
invalid paths.  (#7695)
https://github.com/python/cpython/commit/0185f34ddcf07b78feb6ac666fbfd4615d26b028


--

___
Python tracker 

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



[issue33721] os.path.exists() ought to return False if pathname contains NUL

2018-09-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

os.path.exists() and similar functions will return now False for invalid paths 
(non-encodable paths on Unix, non-decodable bytes paths on Windows, and paths 
containing null characters or bytes).

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



[issue33138] Improve standard error for uncopyable types

2018-09-18 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34711] return ENOTDIR when open() accepts filenames with a trailing slash

2018-09-18 Thread Michael Felt


Michael Felt  added the comment:

On 17/09/2018 16:00, Michael Felt wrote:
> And, now for the PR tests...

Had a review - many thanks, but before I press the resolve button -
Ihope someone can help me understand why the "Travis" etc, checks are
failing, e.g.,

./python -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
echo "generate-posix-vars failed" ; \
rm -f ./pybuilddir.txt ; \
exit 1 ; \
fi
clang -pthread -L/home/travis/multissl/openssl/1.1.0h/lib
-L/home/travis/multissl/openssl/1.1.0h/lib -Xlinker -export-dynamic -o
Programs/_testembed Programs/_testembed.o libpython3.8dm.a -lpthread
-ldl -lutil -lm -lm
Segmentation fault (core dumped)
generate-posix-vars failed

I have no clue how my relatively small change can have this kind of a
effect and then nothing moves forward. Very frustrating!
Thx,
Michael

--

___
Python tracker 

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



[issue34663] Support POSIX_SPAWN_USEVFORK flag in posix_spawn

2018-09-18 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

@vstinner: another option is to ignore "use_vfork" on platforms that don't have 
POSIX_SPAWN_USEVFORK. Using vfork or not is primarily a optimisation, ignoring 
the flag should not result in different behaviour (other than speed).

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue34659] Inconsistency between functools.reduce & itertools.accumulate

2018-09-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The first issue, with ignoring initial=None, is complex because Argument Clinic 
and the inspect module don't support optional parameters without default value. 
It could be possible to use optional groups, but currently Argument Clinic 
supports optional groups only when all parameters are positional-only. For now, 
the only way is getting rid from Argument Clinic.

As for pickling/copying, this task is technically difficult, it but I don't see 
principal problems. The code is already complex (see issue25718) and will be 
more complex. Since the reduce protocol doesn't support keyword arguments, we 
will needs to use either partial() for passing the keyword argument, or chain() 
for imitating it by creating an equivalent object. I can write this code.

Taking to the account the complexity of the implementation and arguments 
against this feature (see issue25193 and the discussion on Python-ideas), is it 
worth to add it?

--

___
Python tracker 

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



[issue34663] Support POSIX_SPAWN_USEVFORK flag in posix_spawn

2018-09-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

If this is an optimization, what is the downside of always using vfork()?

--

___
Python tracker 

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



[issue34518] Documentation for coroutine objects

2018-09-18 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Since there is work on asyncio docs overhaul I just want to bring this to your 
attention since I don't know if this has already been resolved with the merged 
PRs to master and your thoughts on this.

Thanks

--
nosy: +yselivanov

___
Python tracker 

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



[issue34663] Support POSIX_SPAWN_USEVFORK flag in posix_spawn

2018-09-18 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Good question. A comment on 

 says that glibc already uses vfork where appropriate, explicitly using the 
flag may not be necessary. 

Note that I haven't verified if the comment is correct.

--

___
Python tracker 

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



[issue34663] Support POSIX_SPAWN_USEVFORK flag in posix_spawn

2018-09-18 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

The documentation says:

 The child process is created using vfork(2) instead of fork(2) when
   either of the following is true:

   *  the spawn-flags element of the attributes object pointed to by
  attrp contains the GNU-specific flag POSIX_SPAWN_USEVFORK; or

   *  file_actions is NULL and the spawn-flags element of the attributes
  object pointed to by attrp does not contain
  POSIX_SPAWN_SETSIGMASK, POSIX_SPAWN_SETSIGDEF,
  POSIX_SPAWN_SETSCHEDPARAM, POSIX_SPAWN_SETSCHEDULER,
  POSIX_SPAWN_SETPGROUP, or POSIX_SPAWN_RESETIDS.

So using the flag is necessary if you want to force the use of vfork when 
passing any of the flags specified in the second point.

--

___
Python tracker 

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



[issue28908] pydoc getdocloc() is broken

2018-09-18 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34719] Deprecate set to frozenset conversion in set.__contains__

2018-09-18 Thread Javier Dehesa

New submission from Javier Dehesa :

This comes from this SO question: https://stackoverflow.com/q/52382983/1782792

Currently, this works:

> print({1, 2} in {frozenset({1, 2}))
# True

This is strange because set is unhashable. Apparently, it is a case-specific 
feature implemented back in 2003 
(https://github.com/python/cpython/commit/19c2d77842290af9b5f470c1eea2a71d1f77c9fe),
 by which set objects are converted to frozensets when checking for membership 
in another set. Personally I feel this is a bit surprising and inconsistent, 
but that is not the only issue with it. In the original implementation, this 
conversion was basically free because the created frozenset used the same 
storage as the given one. In the current implementation, however 
(https://github.com/python/cpython/blob/3.7/Objects/setobject.c#L1888-L1906), a 
new frozenset object is created, copied from the previous one. It seems this 
was done for thread-safety. The problem with that is that it is significantly 
more expensive:

s = set(range(10))
sf = frozenset(s)
t = { sf }
%timeit sf in t  # True
>>> 31.6 ns ± 1.04 ns per loop (mean ± std. dev. of 7 runs, 1000 loops 
each)
%timeit s in t  # True
>>> 4.9 ms ± 168 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)

In the above case, using the conversion takes five order of magnitude more time 
than the regular check. I suppose there is a memory impact too.

I think this (as far as I know) undocumented feature does not provide a 
significant usability gain, is inconsistent with the documented behavior of set 
and gives rise to obscurely underperfoming code. Removing it would be a 
breaking change, but again, affected code would be relying on undocumented 
behavior (or even "against-documentation" behavior).

--
components: Interpreter Core
messages: 325631
nosy: Javier Dehesa
priority: normal
severity: normal
status: open
title: Deprecate set to frozenset conversion in set.__contains__
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue34720] Fix test_importlib for AIX

2018-09-18 Thread Michael Felt


New submission from Michael Felt :

Issue32374 added a new subtest (test_bad_traverse) in test_importlib. The test 
succeeds when a script calling a bad_traverse exits with a non-zero status 
(e.g., crashes because of segmentation violation)

This patch "fixes" Modules/_testmultiphase.c so that it exits with a non-zero 
status when a NULL pointer is accessed. This is what was causing other systems 
to 'crash' expectedly - while AIX was not.

A simple demo program to demonstrate the difference behavior of AIX:

/*
 * Program to show whether an executable crashes, or not
 * when a NULL pointer is accessed
 * Author: AIXTOOLS
 */

#include
main()
{
long *vpt = NULL;

fprintf(stdout, "vpt = %08lx\n", (long) vpt);
if (*vpt)
fprintf(stdout,"True\n");
else
fprintf(stdout,"False\n");

}

On AIX:
root@x066:[/data/prj/python/git]make nullpr; ./nullpr
cc nullpr.c   -o nullpr
vpt = 
False

On a Linux server:
root@x074:/data/prj/python/git# rm nullpr; make nullpr; ./nullpr
make: Warning: File 'nullpr.c' has modification time 352 s in the future
cc nullpr.c   -o nullpr
nullpr.c:8:1: warning: return type defaults to 'int' [-Wimplicit-int]
 main()
 ^
make: warning:  Clock skew detected.  Your build may be incomplete.
vpt = 
Segmentation fault

--
components: Tests
messages: 325632
nosy: Michael.Felt
priority: normal
severity: normal
status: open
title: Fix test_importlib for AIX
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue34720] Fix test_importlib.test_bad_traverse for AIX

2018-09-18 Thread Michael Felt


Change by Michael Felt :


--
title: Fix test_importlib for AIX -> Fix test_importlib.test_bad_traverse for 
AIX

___
Python tracker 

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



[issue34720] Fix test_importlib.test_bad_traverse for AIX

2018-09-18 Thread Michael Felt


Change by Michael Felt :


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

___
Python tracker 

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



[issue34719] Deprecate set to frozenset conversion in set.__contains__

2018-09-18 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34702] urlopen doesn't handle query strings with "file" scheme

2018-09-18 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue34623] _elementtree.c doesn't call XML_SetHashSalt()

2018-09-18 Thread miss-islington


miss-islington  added the comment:


New changeset cb5778f00ce48631c7140f33ba242496aaf7102b by Miss Islington (bot) 
(Christian Heimes) in branch 'master':
bpo-34623: Use XML_SetHashSalt in _elementtree (GH-9146)
https://github.com/python/cpython/commit/cb5778f00ce48631c7140f33ba242496aaf7102b


--
nosy: +miss-islington

___
Python tracker 

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



[issue34623] _elementtree.c doesn't call XML_SetHashSalt()

2018-09-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8817

___
Python tracker 

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



[issue34623] _elementtree.c doesn't call XML_SetHashSalt()

2018-09-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8816

___
Python tracker 

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



[issue34623] _elementtree.c doesn't call XML_SetHashSalt()

2018-09-18 Thread Christian Heimes


Christian Heimes  added the comment:

Since it's a security fix, the change should land in 3.4 and 3.5, too.

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



[issue34623] _elementtree.c doesn't call XML_SetHashSalt()

2018-09-18 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +8818

___
Python tracker 

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



[issue21109] tarfile: Traversal attack vulnerability

2018-09-18 Thread Tal Einat


Tal Einat  added the comment:

I am not a lawyer, but to the best of my understanding, using such tarballs 
would be fine.  Since Jakub's repo only provides code to generate archive files 
but doesn't include actual archive files, and the generation code is licensed 
via the MIT license, we are free to use the code to generate archive files, 
which would then not fall under the copyright of the author of the generation 
code (Jakub).

--

___
Python tracker 

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



[issue34623] _elementtree.c doesn't call XML_SetHashSalt()

2018-09-18 Thread miss-islington


miss-islington  added the comment:


New changeset 470a435f3b42c9be5fdb7f7b04f3df5663ba7305 by Miss Islington (bot) 
in branch '3.7':
bpo-34623: Use XML_SetHashSalt in _elementtree (GH-9146)
https://github.com/python/cpython/commit/470a435f3b42c9be5fdb7f7b04f3df5663ba7305


--

___
Python tracker 

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



[issue34623] _elementtree.c doesn't call XML_SetHashSalt()

2018-09-18 Thread miss-islington


miss-islington  added the comment:


New changeset 18b20bad75b4ff0486940fba4ec680e96e70f3a2 by Miss Islington (bot) 
(Christian Heimes) in branch '2.7':
[2.7] bpo-34623: Use XML_SetHashSalt in _elementtree (GH-9146) (GH-9394)
https://github.com/python/cpython/commit/18b20bad75b4ff0486940fba4ec680e96e70f3a2


--

___
Python tracker 

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



[issue34623] _elementtree.c doesn't call XML_SetHashSalt()

2018-09-18 Thread miss-islington


miss-islington  added the comment:


New changeset f7666e828cc3d5873136473ea36ba2013d624fa1 by Miss Islington (bot) 
in branch '3.6':
bpo-34623: Use XML_SetHashSalt in _elementtree (GH-9146)
https://github.com/python/cpython/commit/f7666e828cc3d5873136473ea36ba2013d624fa1


--

___
Python tracker 

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



[issue34721] json module loads function

2018-09-18 Thread zack


New submission from zack :

the json.loads function think a string variable is a json type, but the 
variable is "123"

--
components: Library (Lib)
files: json_test.py
messages: 325639
nosy: jaihong
priority: normal
severity: normal
status: open
title: json module loads function
type: behavior
versions: Python 3.5
Added file: https://bugs.python.org/file47813/json_test.py

___
Python tracker 

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



[issue31635] test_strptime failure on OpenBSD

2018-09-18 Thread Paul Ganssle


Paul Ganssle  added the comment:

I do think this is an active bug in OpenBSD's ISO calculations, here: 
https://github.com/openbsd/src/blob/b66614995ab119f75167daaa7755b34001836821/lib/libc/time/wcsftime.c#L326

I re-created this algorithm in Python and at the beginning of the year it gives 
the wrong answer at the beginning of the year in about 50% of years. I have 
spent some time trying to understand the way the algorithm is *supposed* to 
work, but I don't totally understand what it's doing. I'll report this to 
OpenBSD.

--

___
Python tracker 

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



[issue34721] json module loads function

2018-09-18 Thread Ammar Askar


Ammar Askar  added the comment:

This is intentional, the parsed in JSON doesn't necessarily have to have an 
object at the root. This is also what allows you to do:

>>> json.loads("[]")
[]

This behavior is also consistent with browsers, try this in your browser's dev 
console:

> JSON.parse("123")
123
> JSON.parse('"123"')
"123"
> JSON.parse('[]')
[]

More technically, look at the JSON standard here: https://www.json.org/

As you can see, the root value is an "element", which is of type "value" 
surrounded by some whitespace. Values can be any of these:

value
object
array
string
number
"true"
"false"
"null"

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



[issue34542] [TLS] Update test certs to future proof settings

2018-09-18 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +8819

___
Python tracker 

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



[issue34542] [TLS] Update test certs to future proof settings

2018-09-18 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +8820

___
Python tracker 

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



[issue17239] XML vulnerabilities in Python

2018-09-18 Thread STINNER Victor


STINNER Victor  added the comment:

> Who normally updates the vendored libexpat?

I made the 3 latest libexpat updates, and each of them was painful :-)

My notes on vendored libraries:
https://pythondev.readthedocs.io/cpython.html#vendored-external-libraries

I wrote a tool to get the version of all vendored libraries, and a script to 
updated libexpat.

--

___
Python tracker 

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



[issue34659] Inconsistency between functools.reduce & itertools.accumulate

2018-09-18 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

I think I'll pass Raymond, its been so long since I've contributed, in the mean 
time there is github and argument clinic and whatnot so I'm out of training.  
I´m lurking around these parts and maybe shall return one day :)

--

___
Python tracker 

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



[issue34722] Non-deterministic bytecode generation

2018-09-18 Thread Peter Ebden


New submission from Peter Ebden :

We've found that the following code produces non-deterministic bytecode,
even post PEP-552:

def test(x):
if x in {'ONE', 'TWO', 'THREE'}:
pass

It's not too hard to test it:

$ python3.7 -m compileall --invalidation-mode=unchecked-hash test.py
Compiling 'test.py'...
$ sha1sum __pycache__/test.cpython-37.pyc
61e5682ca95e8707b4ef2a79f6454dafd800  __pycache__/test.cpython-37.pyc
$ rm __pycache__/test.cpython-37.pyc
$ python3.7 -m compileall --invalidation-mode=unchecked-hash test.py
Compiling 'test.py'...
$ sha1sum __pycache__/test.cpython-37.pyc
222a06621b491879e5317b34e9dd715bacd89b7d  __pycache__/test.cpython-37.pyc

It looks like the peephole optimiser is converting the LOAD_CONST instructions
for the set into a single LOAD_CONST for a frozenset which then serialises in
nondeterministic order. One can hence work around it by setting PYTHONHASHSEED
to a known value.

I'm happy to help out with this if needed, although I don't have a lot of
familiarity with the relevant code.

--
components: Interpreter Core
messages: 325644
nosy: Peter Ebden
priority: normal
severity: normal
status: open
title: Non-deterministic bytecode generation
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



[issue34663] Support POSIX_SPAWN_USEVFORK flag in posix_spawn

2018-09-18 Thread STINNER Victor


STINNER Victor  added the comment:

Serhiy Storchaka: "If this is an optimization, what is the downside of always 
using vfork()?"

I don't know the vfork() function, but you can find articles like:
"vfork considered dangerous" (old article of 2012)
https://ewontfix.com/7/

But it's unclear to me if vfork() drawbacks also affect posix_spawn(). 
posix_spawn() is well defined: call vfork() and then immediately exec().

Another article:

"First is that vfork pauses the parent thread while the child executes and 
eventually calls an exec family function, this is a huge latency problem for 
applications."

https://developers.redhat.com/blog/2015/08/19/launching-helper-process-under-memory-and-latency-constraints-pthread_create-and-vfork/

--

___
Python tracker 

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



[issue34723] lower() on Turkish letter "İ" returns a 2-chars-long string

2018-09-18 Thread Dogan

New submission from Dogan :

Hey there,

I believe I've come across a bug. It occurs when you try to lower() the Turkish 
uppercase letter "İ". Gonna explain it with example code since it's easier:

>>> len("Ş")
1
>>> len("Ş".lower())
1
>>> len("Ğ")
1
>>> len("Ğ".lower())
1
>>> len("Ö")
1
>>> len("Ö".lower())
1
>>> len("Ç")
1
>>> len("Ç".lower())
1
>>> len("İ")
1
>>> len("İ".lower())
2

When you lower() the Turkish uppercase letter “İ”, it returns a 2 chars long 
string with the first character being “i”, and the second being chr(775).

Should it not simply return “i”?

--
components: Unicode
messages: 325646
nosy: ezio.melotti, vstinner, zamsalak
priority: normal
severity: normal
status: open
title: lower() on Turkish letter "İ" returns a 2-chars-long string
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue34663] Support POSIX_SPAWN_USEVFORK flag in posix_spawn

2018-09-18 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

vfork() is more dangerous than fork() because the parent and child processes 
share memory (not copy-on-write, but really the same memory). Whether or not 
this affects posix_spawn depends on its implementation (to give a very vague 
statement).

Glibc already uses vfork() in a number of cases, I'd expect that those are the 
cases where it is safe to use vfork() in the implementation of posix_spawn in 
the context of glibc.  I'd therefore carefully test the use of vfork() in other 
cases to make sure those don't affect the parent process.

--

___
Python tracker 

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



[issue17239] XML vulnerabilities in Python

2018-09-18 Thread Christian Heimes


Christian Heimes  added the comment:

> * only Windows and macOS will get the fix

Modules/expat can be used on all platforms. A downstream patch is only a 
problem for platforms that compile Python with "./configure 
--with-system-expat".

The security fixes for entity expansion blowup and external entity loading are 
backwards incompatible fixes. Technically they also violate XML standards. In 
practice the vast majority of users will never run into the issue, because 
external entities are scarcely used. The expat parser is a non-validating XML 
parser, so DTDs aren't useful at all. I'd rather break a handful of users than 
to keep the majority of users vulnerable.

To fix billion laughs and quadratic blowup once and for all, we also have to 
break backwards compatibility and require expat >= 2.3.0. For now the modules 
still work with old versions of expat. IMO it's fine. Vendors either have to 
update their libraries or use our copy of expat.

Ultimately it's Benjamin's, Larry's, and Ned's decision. They are release 
managers.

--

___
Python tracker 

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



[issue34723] lower() on Turkish letter "İ" returns a 2-chars-long string

2018-09-18 Thread STINNER Victor

STINNER Victor  added the comment:

> Should it not simply return “i”?

Python implements the Unicode standard.

>>> "U+%04x" % ord("İ")
'U+0130'
>>> ["U+%04x" % ord(ch) for ch in "İ".lower()]
['U+0069', 'U+0307']

>>> unicodedata.name("İ")
'LATIN CAPITAL LETTER I WITH DOT ABOVE'
>>> [unicodedata.name(ch) for ch in "İ".lower()]
['LATIN SMALL LETTER I', 'COMBINING DOT ABOVE']

At the C level(), lower_ucs4() calls _PyUnicode_ToLowerFull() which lookup into 
Python internal Unicode database.

U+0130 character enters the EXTENDED_CASE_MASK case: use 
_PyUnicode_ExtendedCase secondary database for "extended case".

Well, at the end, Python uses the following data file from the Unicode standard:

https://www.unicode.org/Public/9.0.0/ucd/SpecialCasing.txt

Extract:
"""
# Preserve canonical equivalence for I with dot. Turkic is handled below.

0130; 0069 0307; 0130; 0130; # LATIN CAPITAL LETTER I WITH DOT ABOVE
"""


If you want to convert strings differently for the special case of Turkish, you 
need to use a different standard than Unicode...

I close the issue as NOT A BUG.

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



[issue34597] Python needs to check existence of functions at runtime for targeting older macOS platforms

2018-09-18 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

@Zorg: you don't need to sell the usefulness of this functionality. Its just 
that the python developers are volunteers and hence have limited time to work 
on python.

--

___
Python tracker 

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



[issue34663] Support POSIX_SPAWN_USEVFORK flag in posix_spawn

2018-09-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

If glibc already uses vfork() if it is safe, I suppose that using vfork() in 
other cases is unsafe, and we shouldn't support this nonstandard option.

--

___
Python tracker 

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



[issue34597] Python needs to check existence of functions at runtime for targeting older macOS platforms

2018-09-18 Thread Zorg


Zorg  added the comment:

I understand that. I was mainly responding to a question that was asked with 
information I felt was important to provide.

--

___
Python tracker 

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



[issue31635] test_strptime failure on OpenBSD

2018-09-18 Thread Paul Ganssle


Paul Ganssle  added the comment:

Bug reported to BSD here: 
https://marc.info/?l=openbsd-bugs&m=153728102618747&w=2

--

___
Python tracker 

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



[issue25825] AIX shared library extension modules installation broken

2018-09-18 Thread Michael Felt


Michael Felt  added the comment:

On 10/08/2016 17:22, David Edelsohn wrote:
> David Edelsohn added the comment:
Hi, Just thought I would mention that I have a branch with all the test
PR fixes I have made in the last two months.

a) would appreciate your testig them with gcc - to be sure all is good
there as well.
b) If all test also pass for you - maybe if you make a bit of noise
python may be a bit quicker to actually merge them.

Hope this helps (AIX :) )

Michael

Links:
https://github.com/python/cpython/pulls?q=is%3Apr+is%3Aopen+AIX+author%3Aaixtools
https://github.com/aixtools/cpython/tree/aix-pr

--
title: AIX shared library extension modules installation broken: wrong dir 
names -> AIX shared library extension modules installation broken

___
Python tracker 

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



[issue32557] allow shutil.disk_usage to take a file path on Windows also

2018-09-18 Thread Joe Pamer


Joe Pamer  added the comment:

Got it - thanks! That sounds good to me, so I'll take a look at how other 
functions are working around MAX_PATH and update the diff to also avoid the 
copy when possible.

--

___
Python tracker 

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



[issue25825] AIX shared library extension modules installation broken

2018-09-18 Thread Michael Felt


Michael Felt  added the comment:

On 18/09/2018 16:46, Michael Felt wrote:
> Michael Felt  added the comment:

Ignore this. If only I could remove stuff!

Good day all.

--

___
Python tracker 

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



[issue34722] Non-deterministic bytecode generation

2018-09-18 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Have a look at line 512 in Python/marshal.c which calls PyObject_GetIter().  We 
would need to add PySequence_List() and PyList_Sort().  This will slow down 
marshaling but would make the bytecode deterministic.

--
nosy: +rhettinger

___
Python tracker 

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



[issue34719] Deprecate set to frozenset conversion in set.__contains__

2018-09-18 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

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



[issue34719] Deprecate set to frozenset conversion in set.__contains__

2018-09-18 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
versions:  -Python 2.7, 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



[issue34722] Non-deterministic bytecode generation

2018-09-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Not all types are orderable.

>>> sorted({'', None})
Traceback (most recent call last):
  File "", line 1, in 
TypeError: '<' not supported between instances of 'NoneType' and 'str'

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue34722] Non-deterministic bytecode generation

2018-09-18 Thread Eric Snow


Change by Eric Snow :


--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue34719] Deprecate set to frozenset conversion in set.__contains__

2018-09-18 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

The feature was first implemented in Lib/sets.py (arising from PEP 218) in pure 
python. It was found to be useful and carried forward to the C implementation 
for the built-in type.  The feature is documented but not highlighted in the 
Library Reference, "Both set and frozenset support set to set comparisons."

You are correct that feature became less performant when the swap-bodies code 
was eliminated; however, the feature still has value so that a user can write 
"s in t" rather than "frozenset(s) in t".

Thank you for the suggestion, but I'm going to elect to leave the code as-is. 
There's no reason break other people's code and remove a feature that is 
intentional, guaranteed, tested, and sometimes useful in applications that have 
sets of frozensets.

If you don't like the feature, it is okay to not use it ;-)

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



[issue34663] Support POSIX_SPAWN_USEVFORK flag in posix_spawn

2018-09-18 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

You still need to allow the flag as being safe or unsafe depends on the user 
code as glibc cannot know about the details of what is going to be executed. 
That is the reason they have the flag, so the user can disambiguate if is safe 
or not. If we don't expose the flag, the user may know that what is going to do 
is safe or acceptable but then they cannot activate the use of vfork.

--

___
Python tracker 

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



[issue34663] Support POSIX_SPAWN_USEVFORK flag in posix_spawn

2018-09-18 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Some interesting read:

Go is using vfork/posix_spawn when possible:

https://github.com/golang/go/issues/5838

And it seems that have interesting results:

https://about.gitlab.com/2018/01/23/how-a-fix-in-go-19-sped-up-our-gitaly-service-by-30x/

--

___
Python tracker 

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



[issue34582] VSTS builds should use jobs, pools, and test results

2018-09-18 Thread Steve Dower


Steve Dower  added the comment:


New changeset d0f49d2f5085ca68e3dc8725f1fb1c9674bfb5ed by Steve Dower in branch 
'master':
bpo-34582: Adds JUnit XML output for regression tests (GH-9210)
https://github.com/python/cpython/commit/d0f49d2f5085ca68e3dc8725f1fb1c9674bfb5ed


--

___
Python tracker 

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



[issue34724] argparse subparser help indent too short

2018-09-18 Thread Jeremiah Rosen


New submission from Jeremiah Rosen :

The help is indented too early for subparsers with long argument names. I'm 
currently using the ProperIndentParser class from the following gist to create 
my top level parser, which fixes the issue:

https://gist.github.com/TakingItCasual/df40932dcc30012325bfed241bdaabd0

--
components: Library (Lib)
messages: 325663
nosy: Jeremiah Rosen
priority: normal
severity: normal
status: open
title: argparse subparser help indent too short
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue34472] zipfile: does not include optional descriptor signature

2018-09-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 4ba3b50bfe6d50cd82d208023ea23e203ab50589 by Serhiy Storchaka 
(Silas Sewell) in branch 'master':
bpo-34472: Add data descriptor signature to zipfile (GH-8871)
https://github.com/python/cpython/commit/4ba3b50bfe6d50cd82d208023ea23e203ab50589


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue34724] argparse subparser help indent too short

2018-09-18 Thread TakingItCasual


TakingItCasual  added the comment:

More detailed explanation on the SO post I found the HelpFormatter class from:

https://stackoverflow.com/q/3215/2868017

--

___
Python tracker 

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



[issue34472] zipfile: does not include optional descriptor signature

2018-09-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8821

___
Python tracker 

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



[issue34472] zipfile: does not include optional descriptor signature

2018-09-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8822

___
Python tracker 

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



[issue34725] Py_GetProgramFullPath() odd behaviour in Windows

2018-09-18 Thread Mario


New submission from Mario :

According to the doc Py_GetProgramFullPath() should return the full path of the 
program name as set by Py_SetProgramName().

https://docs.python.org/3/c-api/init.html#c.Py_GetProgramFullPath

This works well in Linux, but in Windows it is always the name of the current 
executable (from GetModuleFileNameW).

This is because the 2 files Modules/getpath.c and PC/getpathp.c have completely 
different logic in calculate_program_full_path() vs get_program_full_path().

This difference is harmless when running in the normal interpreter 
(python.exe), but can be quite dramatic when embedding python into a C 
application.

The value returned by Py_GetProgramFullPath() is the same as sys.executable in 
python.

Why this matters? For instance in Linux virtual environments work out of the 
box for embedded applications, while they are completely ignored in Windows.

python -m venv abcd

and then if I run my app inside the (activated) abcd environment in Linux I can 
access the same modules as if I were executing python, while in Windows I still 
get the system module search path.

If you execute the attached program in Linux you get

EXECUTABLE /tmp/abcd/bin/python3
PATH ['/usr/lib/python37.zip', '/usr/lib/python3.7', 
'/usr/lib/python3.7/lib-dynload', '/tmp/abcd/lib/python3.7/site-packages']

in Windows

EXECUTABLE 
c:\TEMP\vsprojects\ConsoleApplication1\x64\Release\ConsoleApplication1.exe
PATH ['C:\\TEMP\\venv\\abcd\\Scripts\\python37.zip', 'C:\\Python37\\Lib', 
'C:\\Python37\\DLLs', 'c:\\TEMP\\vsprojects\\ConsoleApplication1\\x64\\Relea
se', 'C:\\Python37', 'C:\\Python37\\lib\\site-packages']

with a mixture of paths from the venv, system and my app folder.
But more importantly site-packages comes from the system (bad!).

This is because site.py at lines 454 uses the path of the interpreter to locate 
the venv configuration file.

So in the end, virtual environments work out of the box in Linux even for an 
embedded python, but not in Windows.

--
components: Interpreter Core, Windows
files: poc.c
messages: 325666
nosy: mariofutire, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Py_GetProgramFullPath() odd behaviour in Windows
versions: Python 3.6, Python 3.7
Added file: https://bugs.python.org/file47814/poc.c

___
Python tracker 

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



[issue34341] Appending to ZIP archive blows up existing Central Directory entries

2018-09-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +8823

___
Python tracker 

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



[issue34472] zipfile: does not include optional descriptor signature

2018-09-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you for your contribution Silas.

Since popular ZIP file implementation like Info-ZIP and Java write this 
signature unconditionally, I think most unzipping software support it if they 
support reading ZIP files in streaming mode at all, at it is safe to backport 
this change to all maintained versions.

--
type:  -> behavior
versions: +Python 2.7 -Python 3.5

___
Python tracker 

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



[issue34582] VSTS builds should use jobs, pools, and test results

2018-09-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8824

___
Python tracker 

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



[issue34582] VSTS builds should use jobs, pools, and test results

2018-09-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8825

___
Python tracker 

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



[issue34725] Py_GetProgramFullPath() odd behaviour in Windows

2018-09-18 Thread Steve Dower


Steve Dower  added the comment:

That executable doesn't appear to be in a virtual environment - you should be 
running C:\TEMP\venv\abcd\Scripts\python.exe

Does that resolve your problem?

--

___
Python tracker 

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



[issue33649] asyncio docs overhaul

2018-09-18 Thread Yury Selivanov


Change by Yury Selivanov :


--
pull_requests: +8826

___
Python tracker 

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



[issue34725] Py_GetProgramFullPath() odd behaviour in Windows

2018-09-18 Thread Steve Dower


Steve Dower  added the comment:

(Also, the behavior of Py_GetProgramFullPath is intentional, but we do have 
another bug somewhere to be able to override it for embedding purposes. 
sys.executable should be None when it does not contain a suitable path for 
running the normal Python interpreter again. I haven't searched for that bug 
just now, but we should find it and track the issue there, rather than creating 
a different issue.)

--

___
Python tracker 

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



[issue34582] VSTS builds should use jobs, pools, and test results

2018-09-18 Thread Steve Dower


Steve Dower  added the comment:


New changeset 1a89cb5c479d8e4f467d7f96e1781c7275cefa88 by Steve Dower (Miss 
Islington (bot)) in branch '3.7':
bpo-34582: Adds JUnit XML output for regression tests (GH-9210)
https://github.com/python/cpython/commit/1a89cb5c479d8e4f467d7f96e1781c7275cefa88


--

___
Python tracker 

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



[issue34582] VSTS builds should use jobs, pools, and test results

2018-09-18 Thread Steve Dower


Steve Dower  added the comment:


New changeset c9276495fc497898544a38b244b38ff61797f32d by Steve Dower (Miss 
Islington (bot)) in branch '3.6':
bpo-34582: Adds JUnit XML output for regression tests (GH-9210)
https://github.com/python/cpython/commit/c9276495fc497898544a38b244b38ff61797f32d


--

___
Python tracker 

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



[issue25711] Rewrite zipimport from scratch

2018-09-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 79d1c2e6c9d1bc1cf41ec3041801ca1a2b9a995b by Serhiy Storchaka in 
branch 'master':
bpo-25711: Rewrite zipimport in pure Python. (GH-6809)
https://github.com/python/cpython/commit/79d1c2e6c9d1bc1cf41ec3041801ca1a2b9a995b


--

___
Python tracker 

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



[issue34663] Support POSIX_SPAWN_USEVFORK flag in posix_spawn

2018-09-18 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I get the impression that go uses vfork on Linux, not posix_spawn, because go 
doesn't use libc (based on reading the referenced issue, not on deep knowledge 
of go and its implementation).

I do wonder why glibc's implementation of posix_spawn doesn't use vfork more 
often, and in which cases it is safe to explicitly use vfork even when glibc 
won't do so by default.

Enabling the use of vfork without determining when it safe to do so is asking 
for problems, and hard to debug/reproduce ones at that (due to vfork 
semantics).  Adding a "use_vfork" keyword argument to posix_spawn is IMHO not 
the right way to go, it would be better to determine when using vfork is safe 
and then unconditionally enable it.  Otherwise users will have to do the 
research.

--

___
Python tracker 

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



[issue9148] os.execve puts process to background on windows

2018-09-18 Thread Thomas Sibley


Change by Thomas Sibley :


--
nosy: +trs

___
Python tracker 

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



[issue9148] os.execve puts process to background on windows

2018-09-18 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



[issue34725] Py_GetProgramFullPath() odd behaviour in Windows

2018-09-18 Thread Mario


Mario  added the comment:

On 18/09/2018 19:24, Steve Dower wrote:
> 
> Steve Dower  added the comment:
> 
> That executable doesn't appear to be in a virtual environment - you should be 
> running C:\TEMP\venv\abcd\Scripts\python.exe
> 
> Does that resolve your problem?
> 

Nope,

I am *not* running python, I am running a C app which embeds the python 
interpreter.
I am running exactly

c:\TEMP\vsprojects\ConsoleApplication1\x64\Release\ConsoleApplication1.exe

In a later comment you say the behaviour of Py_GetProgramFullPath is 
intentional: which behaviour? 
Windows? Linux? or the fact that they behave differently?

I guess that if there were a way to force Py_GetProgramFullPath() it would 
solve my problem, because 
I could direct site.py towards the correct virtual environment.

If sys.executable becomes None for embedded python (without the ability to set 
it), then virtual 
environments wont work at all, which would be sad.

--

___
Python tracker 

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



[issue34726] Add support of checked hash-based pycs in zipimport

2018-09-18 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Currently zipimport refuses to handle checked hash-based pycs (PEP 552).

--
components: Library (Lib)
messages: 325675
nosy: brett.cannon, eric.snow, ncoghlan, serhiy.storchaka, twouters
priority: normal
severity: normal
status: open
title: Add support of checked hash-based pycs in zipimport
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue34727] Windows/2.7.15 IOError [Errno 0] when user interacts with cmd console

2018-09-18 Thread cowlinator


New submission from cowlinator :

I can consistently reproduce a bug in 2.7.15 on Windows which causes an 
unexpected IOError.

Steps to reproduce:

Enter the following code in a plain-vanilla windows command line console:

>>> import sys
>>> while True:
... sys.stdout.write('.')

Then, pause the output, either by clicking and holding the scrollbar for 10 
seconds, or by highlighting text with the mouse for 10 seconds and then 
pressing 'enter' to un-highlight.
Upon resuming, the following error is seen:

Traceback (most recent call last):
  File "", line 2, in 
IOError: [Errno 0] Error

--
components: IO, Windows
messages: 325676
nosy: cowlinator, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Windows/2.7.15 IOError [Errno 0] when user interacts with cmd console
type: behavior
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



[issue25711] Rewrite zipimport from scratch

2018-09-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +8827

___
Python tracker 

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



[issue34663] Support POSIX_SPAWN_USEVFORK flag in posix_spawn

2018-09-18 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I did some more research:

*  seems to indicate 
that glibc switched to a different implementation of posix_spawn that uses 
clone(2) instead of fork()/vfork() to avoid some problems with vfork(). 

The start of the issue also contains some information on why glibc is (was?) so 
conservative about using vfork, and a possible work around (disable cancelation 
points around the call to posix_spawn).

* 
 
is the source for the guts of posix_spawn for some version of glibc, and that 
indeed does use clone(...|CLONE_VFORK...) unconditionally and does not appear 
to test for POSIX_SPAWN_USEVFORK. 



It looks like the advise to use POSIX_SPAWN_USEVFORK is outdated, although I'm 
not 100% sure of my conclusion.  A glibc expert should be able to confirm or 
refute this. 

@pablogsal: do you have more information on why you want to enable this flag? 
Do you have measurements that show that adding this flag helps?

--

___
Python tracker 

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



[issue34663] Support POSIX_SPAWN_USEVFORK flag in posix_spawn

2018-09-18 Thread STINNER Victor


STINNER Victor  added the comment:

Oh wow, I didn't expect that exposing a constant would be a source of such deep 
debate!

(I'm not saying that the debate is useless or negative, it's useful and 
constructive, just I'm surprised how system programming can be hard sometimes!)

--

___
Python tracker 

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



[issue25711] Rewrite zipimport from scratch

2018-09-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +8828

___
Python tracker 

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



[issue34726] Add support of checked hash-based pycs in zipimport

2018-09-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue34726] Add support of checked hash-based pycs in zipimport

2018-09-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests:  -8829

___
Python tracker 

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



[issue34726] Add support of checked hash-based pycs in zipimport

2018-09-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
stage: patch review -> needs patch

___
Python tracker 

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



[issue32245] OSError: raw write() returned invalid length on latest Win 10 Consoles

2018-09-18 Thread Eryk Sun


Change by Eryk Sun :


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



[issue34341] Appending to ZIP archive blows up existing Central Directory entries

2018-09-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 29034baf58156e2462b0680e9092c0a3cccb0798 by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-34341: Fix appending to ZIP archives with the ZIP64 extension. 
(GH-8683). (GH-9400)
https://github.com/python/cpython/commit/29034baf58156e2462b0680e9092c0a3cccb0798


--

___
Python tracker 

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



[issue34472] zipfile: does not include optional descriptor signature

2018-09-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +8830

___
Python tracker 

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



[issue34341] Appending to ZIP archive blows up existing Central Directory entries

2018-09-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue34727] Windows/2.7.15 IOError [Errno 0] when user interacts with cmd console

2018-09-18 Thread Eryk Sun


Eryk Sun  added the comment:

This may be the same problem as issue 32245, which was a third-party bug that 
Microsoft fixed in the last Spring update of Windows 10. Which version of 
Windows are you using?

--
nosy: +eryksun

___
Python tracker 

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



[issue34727] Windows/2.7.15 IOError [Errno 0] when user interacts with cmd console

2018-09-18 Thread cowlinator


cowlinator  added the comment:

I think you are probably right.  
I'm using Windows 10 Version 1709 (OS Build 16299.611)

--

___
Python tracker 

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



[issue9148] os.execve puts process to background on windows

2018-09-18 Thread Eryk Sun


Eryk Sun  added the comment:

Python doesn't go out of its way to fake a cross-platform POSIX environment in 
Windows, complete with emulated fork and exec. I don't recommend using 
nt.execv[e] or the os.exec* functions in Windows. Their behavior is almost 
always undesired. I'd be in favor of deprecating them and eventually removing 
them. Use subprocess instead.

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



[issue34727] Windows/2.7.15 IOError [Errno 0] when user interacts with cmd console

2018-09-18 Thread Eryk Sun


Eryk Sun  added the comment:

With Windows 10 release 1803, I can't reproduce either this problem or the 
problems from issue 32245. I'm marking this issue closed as a duplicate. Open a 
new issue if you still experience the problem after updating to Windows 10 
release 1803 or 1809.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> OSError: raw write() returned invalid length on latest Win 10 
Consoles

___
Python tracker 

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



[issue34728] deprecate *loop* argument for asyncio.sleep

2018-09-18 Thread Yury Selivanov


New submission from Yury Selivanov :

asyncio.sleep is a coroutine; passing a *loop* argument to it makes no sense 
anymore.

We should raise a DeprecationWarning in Python 3.8 and 3.9 and remove it in 4.0.

--
components: asyncio
keywords: easy
messages: 325684
nosy: asvetlov, yselivanov
priority: normal
severity: normal
stage: needs patch
status: open
title: deprecate *loop* argument for asyncio.sleep
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue34728] deprecate *loop* argument for asyncio.sleep

2018-09-18 Thread Yury Selivanov


Yury Selivanov  added the comment:

Same for asyncio.wait and asyncio.wait_for.

--

___
Python tracker 

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



[issue33649] asyncio docs overhaul

2018-09-18 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset 471503954a91d86cf04228c38134108c67a263b0 by Yury Selivanov in 
branch 'master':
bpo-33649: Add a high-level section about Futures; few quick fixes (GH-9403)
https://github.com/python/cpython/commit/471503954a91d86cf04228c38134108c67a263b0


--

___
Python tracker 

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



[issue33649] asyncio docs overhaul

2018-09-18 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8831

___
Python tracker 

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



[issue33649] asyncio docs overhaul

2018-09-18 Thread miss-islington


miss-islington  added the comment:


New changeset 73c0006e71683b7d5b28192f18a2b9796e4195ef by Miss Islington (bot) 
in branch '3.7':
bpo-33649: Add a high-level section about Futures; few quick fixes (GH-9403)
https://github.com/python/cpython/commit/73c0006e71683b7d5b28192f18a2b9796e4195ef


--

___
Python tracker 

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



  1   2   >