[issue34540] shutil._call_external_zip should use subprocess

2018-08-28 Thread Benjamin Peterson


Change by Benjamin Peterson :


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

___
Python tracker 

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



[issue34540] shutil._call_external_zip should use subprocess

2018-08-28 Thread Benjamin Peterson


New submission from Benjamin Peterson :

disutils.spawn isn't very good at quoting command lines (#8987). We need to use 
subprocess to avoid shell injection.

--
components: Library (Lib)
messages: 324301
nosy: benjamin.peterson
priority: normal
severity: normal
status: open
title: shutil._call_external_zip should use subprocess
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



[issue34539] namedtuple's exec() throws segmentation fault

2018-08-28 Thread Álvaro Justen

New submission from Álvaro Justen :

I was working on a library called rows[https://github.com/turicas/rows] when a 
segmentation fault was thrown in the moment I've tried to read a CSV file. 
Since this part of the code is implemented completely in Python, I thought it 
could be a bug in Python itself.
Investigating the code I found it was faulting at exec()'s line inside 
namedtuple code (Lib/collections/__init__.py). After some time testing, I've 
came up with this piece of code to reproduce it:

```
try:
float('áxxx')
except:
from collections import namedtuple
namedtuple('T', 'f')
```

The code works if I:
- Run passing `PYTHONMALLOC=debug`
- Place 'from collections import namedtuple' into the first line
- Remove any char from the string in the 'float(...)' line
- Remove the 'á' from the string in the 'float(...)' line

I've tested the code on Python 3.6.6, 3.7.0, 3.7-dev and 3.8-dev (versions 
installed using pyenv on a Debian GNU/Linux machine) and the problem happened 
only in 3.7.0.
This issue seems to be related to https://bugs.python.org/issue34087 but I 
preferred to create a new one since I don't know if there are automated tests 
for this specific case.

--
components: Library (Lib)
files: namedtuple_bug.py
messages: 324300
nosy: turicas
priority: normal
severity: normal
status: open
title: namedtuple's exec() throws segmentation fault
type: crash
versions: Python 3.7
Added file: https://bugs.python.org/file47772/namedtuple_bug.py

___
Python tracker 

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



[issue34535] queue.Queue(timeout=0.001) avg delay Windows:14.5ms, Ubuntu: 0.063ms

2018-08-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Victor or Steve, do you know the resolution of perf_counter() and monotonic() 
on Windows?

--
nosy: +rhettinger, vstinner

___
Python tracker 

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



[issue34481] Different behavior of C and Python impls of datetime.strftime with non-UTF-8-encodable strings

2018-08-28 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue34481] Different behavior of C and Python impls of datetime.strftime with non-UTF-8-encodable strings

2018-08-28 Thread Paul Ganssle


Change by Paul Ganssle :


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

___
Python tracker 

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



[issue34485] _PyCoreConfig: add stdio_encoding and stdio_errors

2018-08-28 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 124b9eb4e41ba1676dad954eec9a1fb3480794e4 by Victor Stinner in 
branch 'master':
bpo-34485: Add _Py_ClearStandardStreamEncoding() (GH-8982)
https://github.com/python/cpython/commit/124b9eb4e41ba1676dad954eec9a1fb3480794e4


--

___
Python tracker 

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



[issue34485] _PyCoreConfig: add stdio_encoding and stdio_errors

2018-08-28 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 98c49c6ab239875e35a3c271bc8fabde6c9be804 by Victor Stinner in 
branch '3.7':
bpo-34485: Fix _Py_InitializeCore() for C locale coercion (GH-8979) (GH-8981)
https://github.com/python/cpython/commit/98c49c6ab239875e35a3c271bc8fabde6c9be804


--

___
Python tracker 

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



[issue34485] _PyCoreConfig: add stdio_encoding and stdio_errors

2018-08-28 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8456

___
Python tracker 

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



[issue2506] Add mechanism to disable optimizations

2018-08-28 Thread Arthur Goldberg


Arthur Goldberg  added the comment:

I'm another user of Ned's coverage tool. Our team at the Mount Sinai School of 
Medicine is building tools to model the dynamics of biochemistry inside 
individual cells. Our short term aims are to better understanding microbiology 
and model microorganisms so they can be engineered to more effectively produce 
drugs and do other industrial tasks. Long term, we seek to build genetically 
personalized models of human cells which can be used to improve the medical 
care of cancer and other illnesses. We're funded by several agencies of the 
federal government. Our field is called whole-cell modeling.

We use Python because it provides a wide array of powerful tools we can reuse 
to reduce our development time, enables us to rapidly prototype software to 
test and advance our modeling ideas, and is fun to program. Using git, pip, 
coverage, GitHub, CircleCI, Docker and other tools we've built a robust 
development environment that enables multiple people to contribute to advancing 
our tools for whole-cell modeling. We strongly emphasize software engineering 
because the data we use is large, incomplete and inconsistent, and our models 
are complex and difficult to train, verify and validate. We want to have a high 
level of confidence in our tested code so that if we have trouble with a model 
we can focus on checking the data and understanding the model design. Coverage 
testing is an important part of our software engineering. We test both line and 
branch coverage.

While working today on our simulator I found code that should have been fully 
covered except for a # pragma no cover, but was not fully covered. I reported 
it to Ned (https://github.com/nedbat/coveragepy/issues/697) who reproduced it 
in a simpler example and pointed out that this "Add mechanism to disable 
optimizations" issue contributed to the problem.

I realize that approximately 0.0% of Python users work on whole-cell modeling, 
which diminishes the importance of this use case. But Python is widely used in 
computational biomedicine, which represents many more users. Case in point -- 
I've created and teach a course in Biomedical Software Engineering which uses 
Python and teaches coverage testing to masters, PhD, and MD/PhD students.

We'd appreciate your help improving Ned's coverage tool. You can learn more 
about us at http://www.karrlab.org/ and https://github.com/KarrLab.

Regards
Arthur

--
nosy: +ArthurGoldberg

___
Python tracker 

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



[issue33407] Implement Py_DEPRECATED() macro for Visual Studio

2018-08-28 Thread Zackery Spytz


Change by Zackery Spytz :


--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue34485] _PyCoreConfig: add stdio_encoding and stdio_errors

2018-08-28 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8455

___
Python tracker 

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



[issue34479] ArgumentParser subparser error display at the wrong level

2018-08-28 Thread paul j3


paul j3  added the comment:

Errors that are associated with a specific argument, such as a wrong 'type' do 
get usage from the appropriate subparser.  

e.g.

In [164]: p.parse_args('--foo 1 cmd1 --bar x'.split())
usage: ipython3 cmd1 [-h] [--bar BAR]
ipython3 cmd1: error: argument --bar: invalid int value: 'x'

`required` tests also issue subparser specific usage; mutually exclusive tests 
probably do so as well.

But this unrecognized argument error is a bit less specific.  In your example 
'-x a' and 'a -x' will both produce the same error message.  The route by which 
the '-x' is put into the 'extras' list is different in the two cases, but in 
both it's the top 'parse_(known_)args' that determines whether to just return 
them, or raise an error.  '-x a -x' will put 2 '-x' in the unrecognized list.

If you really need a subparser specific message it might be possible to do so 
by modifying, or subclassing the _SubParsersAction class, making it raise an 
error when there are 'extras' rather than returning them as 'unrecognized'.  
But that's not a backward compatible change.

--

___
Python tracker 

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



[issue34485] _PyCoreConfig: add stdio_encoding and stdio_errors

2018-08-28 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 2c8ddcf4f14f3e4c87a6fe6678ab5ad09130c6ab by Victor Stinner in 
branch 'master':
bpo-34485: Fix _Py_InitializeCore() for C locale coercion (GH-8979)
https://github.com/python/cpython/commit/2c8ddcf4f14f3e4c87a6fe6678ab5ad09130c6ab


--

___
Python tracker 

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



[issue33407] Implement Py_DEPRECATED() macro for Visual Studio

2018-08-28 Thread Zackery Spytz


Change by Zackery Spytz :


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

___
Python tracker 

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



[issue34485] _PyCoreConfig: add stdio_encoding and stdio_errors

2018-08-28 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8453

___
Python tracker 

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



[issue34200] importlib: python -m test test_pkg -m test_7 fails randomly

2018-08-28 Thread STINNER Victor


STINNER Victor  added the comment:

Failure on AMD64 Windows8.1 Non-Debug 3.x buildbot:

https://buildbot.python.org/all/#/builders/12/builds/1223

ERROR: test_4 (test.test_pkg.TestPkg)
FAIL: test_7 (test.test_pkg.TestPkg)

--

___
Python tracker 

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



[issue34200] importlib: python -m test test_pkg -m test_7 fails randomly

2018-08-28 Thread STINNER Victor


STINNER Victor  added the comment:

Brett:
> I can't reproduce with master on macOS.

Vladimir Matveev:
> I've tried to repro this on Mac, Windows box and Windows VM - works fine for 
> all cases.

Well, it's a race condition :-( It seems hard to reproduce, but it exists ;-)

--

___
Python tracker 

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



[issue34200] importlib: python -m test test_pkg -m test_7 fails randomly

2018-08-28 Thread STINNER Victor


STINNER Victor  added the comment:

Recent failure on AMD64 Debian root 3.x:

https://buildbot.python.org/all/#/builders/27/builds/1433

0:07:40 load avg: 2.19 [278/418/1] test_pkg failed -- running: test_tools (1 
min 18 sec)
test_1 (test.test_pkg.TestPkg) ... ok
test_2 (test.test_pkg.TestPkg) ... ok
test_3 (test.test_pkg.TestPkg) ... ok
test_4 (test.test_pkg.TestPkg) ... ERROR
test_5 (test.test_pkg.TestPkg) ... ok
test_6 (test.test_pkg.TestPkg) ... ok
test_7 (test.test_pkg.TestPkg) ... FAIL
test_8 (test.test_pkg.TestPkg) ... ok

==
ERROR: test_4 (test.test_pkg.TestPkg)
--
Traceback (most recent call last):
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_pkg.py", 
line 180, in test_4
self.run_code(s)
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_pkg.py", 
line 69, in run_code
exec(textwrap.dedent(code), globals(), {"self": self})
  File "", line 2, in 
  File "/tmp/tmpblwoj1h4/t4.py", line 1, in 
RuntimeError: Shouldnt load t4.py

==
FAIL: test_7 (test.test_pkg.TestPkg)
--
Traceback (most recent call last):
  File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_pkg.py", 
line 260, in test_7
'__name__', '__package__', '__path__', '__spec__'])
AssertionError: Lists differ: ['__c[34 chars]__loader__', '__name__', 
'__package__', '__spec__'] != ['__c[34 chars]__loader__', '__name__', 
'__package__', '__path__', '__spec__']

First differing element 6:
'__spec__'
'__path__'

Second list contains 1 additional elements.
First extra element 7:
'__spec__'

  ['__cached__',
   '__doc__',
   '__file__',
   '__loader__',
   '__name__',
   '__package__',
+  '__path__',
   '__spec__']

--
Ran 8 tests in 0.038s

FAILED (failures=1, errors=1)

--

___
Python tracker 

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



[issue34485] _PyCoreConfig: add stdio_encoding and stdio_errors

2018-08-28 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 9e4994d410970fb4e75168401d159ba47a8f7108 by Victor Stinner in 
branch 'master':
bpo-34485: Enhance init_sys_streams() (GH-8978)
https://github.com/python/cpython/commit/9e4994d410970fb4e75168401d159ba47a8f7108


--

___
Python tracker 

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



[issue34403] test_utf8_mode.test_cmd_line() fails on HP-UX due to false assumptions

2018-08-28 Thread STINNER Victor


STINNER Victor  added the comment:

> Can we backport this to 3.7 at least?

My policy is to focus on the master branch to support a new platform. Then add 
a buildbot and find a core developer to maintain this platform. See the PEP 11 
for details.

I would prefer to see a full test suite passing before discussing which changes 
should or should not be backported.

I would also prefer to first see a more general discussion about who is going 
to support HP-UX.

IMHO HP-UX is not officially supported today. My list of supported platforms:
https://pythondev.readthedocs.io/cpython.html#supported-platforms

See the test_utf8_mode now pass on HP-UX, I close the issue. Please open more 
specific issues for other failures. You might open a meta issue to track all 
HP-UX issues.

--

___
Python tracker 

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



[issue34207] test_cmd_line test_utf8_mode test_warnings fail in all FreeBSD 3.x (3.8) buildbots

2018-08-28 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue34520] test_asyncio leaked [2, 2, 2] references, sum=6 in AMD64 Windows8.1 Refleaks 3.7

2018-08-28 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-32710.

--
nosy: +vstinner

___
Python tracker 

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



[issue34520] test_asyncio leaked [2, 2, 2] references, sum=6 in AMD64 Windows8.1 Refleaks 3.7

2018-08-28 Thread Brett Cannon


Brett Cannon  added the comment:

If it isn't leaking in 3.8 then it's possibly not disposing of the event loop 
(I added a check for that in 
https://github.com/python/cpython/commit/8425de4147eb8d83befbb8ea77516fc764bb4309#diff-226dcee10b9d2f379e54d4415489236f
 ).

--
nosy: +brett.cannon

___
Python tracker 

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



[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-08-28 Thread Nathaniel Manista

New submission from Nathaniel Manista :

https://docs.python.org/3.8/tutorial/errors.html (and all other versions of 
that page back at least as far as 2.7) currently contain the guidance "When 
creating a module that can raise several distinct errors, a common practice is 
to create a base class for exceptions defined by that module, and subclass that 
to create specific exception classes for different error conditions: ".

It may have seemed like a good idea at the time, but we now know from years of 
experience that this is an experiment that didn't pan out and we can consider 
this guidance a Now-Contraindicated Best Practice Of Yesteryear™.

Modules define subclasses of Exception for lots of reasons. Some of those 
subclasses have no relation to one another except that they are subclasses of 
Exception. Some of those subclasses define Exception instances that are never 
raised by code in the module, but that are expected to be raised by code passed 
to and called by the module.

Yes, there are times when a common base class may be appropriate - such as when 
an inheritance hierarchy and polymorphism that satisfy the Liskov Substitution 
Principle make sense for the Exception subclasses, and when the base class 
itself is used (such as when the base class is an item in the Raises: section 
of a function's doc string). But these cases aren't so common as to justify the 
advice being offered generally about all Exception subclass definitions.

Exception subclasses are just classes. Advising that authors may wish to define 
a common base class for all Exception subclasses in a module is like advising 
authors that they may wish to define a common base class for all object 
subclasses in a module - it's very, very, very occasionally a good idea in the 
particular circumstances of a particular module's implementation, but very 
generally not.

--
assignee: docs@python
components: Documentation
messages: 324286
nosy: Nathaniel Manista, docs@python
priority: normal
severity: normal
status: open
title: Remove encouragement to author a base class for all Exception subclasses 
in a module
type: enhancement
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



[issue34479] ArgumentParser subparser error display at the wrong level

2018-08-28 Thread paul j3


paul j3  added the comment:

The subparser is called with `parse_known_args` which just puts unknown args in 
a _UNRECOGNIZED_ARGS_ATTR attribute slot in the namespace, which is then passed 
back to the main parser.

(this occurs in _SubParsersAction.__call__)

If `parser.parse_known_args` is used, then these arguments will appear in the 
`extras` list.  Otherwise `parser.parse_args` issues the 'unrecognized 
arguments' error message (with the main parser usage).

I suspect this issue has been raised previously.  And I don't see any easy way 
of altering the behavior.

--
nosy: +paul.j3

___
Python tracker 

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



[issue34485] _PyCoreConfig: add stdio_encoding and stdio_errors

2018-08-28 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8452

___
Python tracker 

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



[issue34537] test_gdb fails with LC_ALL=C

2018-08-28 Thread STINNER Victor

New submission from STINNER Victor :

On Python 3.7 and master, test_strings() of test_gdb fails if gdb uses Python 
3.6 (before UTF-8 Mode and C locale coercion):

* gdb uses ASCII encoding for stdout
* tested Python uses UTF-8 thanks to the UTF-8 Mode and/or C locale coercion


vstinner@apu$ LC_ALL=C ./python -m test -v test_gdb -m test_strings
== CPython 3.7.0+ (heads/3.7:65ef7425a3, Aug 28 2018, 16:29:30) [GCC 8.1.1 
20180712 (Red Hat 8.1.1-5)]
== Linux-4.17.6-200.fc28.x86_64-x86_64-with-fedora-28-Twenty_Eight little-endian
== cwd: /home/vstinner/prog/python/3.7/build/test_python_21689
== CPU count: 8
== encodings: locale=UTF-8, FS=utf-8
Run tests sequentially
0:00:00 load avg: 0.35 [1/1] test_gdb
GDB version 8.1:
GNU gdb (GDB) Fedora 8.1.1-3.fc28
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 

This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word".
test_strings (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of unicode strings ... FAIL

==
FAIL: test_strings (test.test_gdb.PrettyPrintTests)
Verify the pretty-printing of unicode strings
--
Traceback (most recent call last):
  File "/home/vstinner/prog/python/3.7/Lib/test/test_gdb.py", line 331, in 
test_strings
check_repr('\u2620')
  File "/home/vstinner/prog/python/3.7/Lib/test/test_gdb.py", line 323, in 
check_repr
self.assertGdbRepr(text)
  File "/home/vstinner/prog/python/3.7/Lib/test/test_gdb.py", line 271, in 
assertGdbRepr
% (gdb_repr, exp_repr, gdb_output)))
AssertionError: "'\\u2620'" != "'☠'"
- '\u2620'
+ '☠'
 : "'\\u2620'" did not equal expected "'☠'"; full output was:
Breakpoint 1 at 0x52fc1b: file Python/bltinmodule.c, line 1216.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, builtin_id (self=, v='\u2620') at Python/bltinmodule.c:1216
1216return PyLong_FromVoidPtr(v);
#0  builtin_id (self=, v='\u2620') at Python/bltinmodule.c:1216


--
Ran 1 test in 1.030s

FAILED (failures=1)
test test_gdb failed
test_gdb failed

== Tests result: FAILURE ==

1 test failed:
test_gdb

Total duration: 1 sec 422 ms
Tests result: FAILURE

--
components: Tests, Unicode
messages: 324284
nosy: ezio.melotti, vstinner
priority: normal
severity: normal
status: open
title: test_gdb fails with LC_ALL=C
versions: 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



[issue34522] PyTypeObject's tp_base initialization bug

2018-08-28 Thread Eddie Elizondo


Eddie Elizondo  added the comment:

@ronaldoussoren Please read the complete analysis from the mailing list: 
https://mail.python.org/pipermail/python-dev/2018-August/154946.html. The 
description here was just a rehash and I probably missed some context. 

Particularly, when I said: "PyTypeObject's ob_type should always be set by 
PyType_Ready" I was referring to the PyTypeObject's that are statically set in 
C code. Metatypes explicitly have to set the ob_type and that's already handled.

In the current state of things, you have static PyTypeObjects that are being 
used before calling PyType_Ready due to this macro. This change just 
standardizes the header of static PyTypeObject throughout the entire codebase.

--

___
Python tracker 

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



[issue22872] multiprocessing.Queue raises AssertionError

2018-08-28 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



[issue34535] queue.Queue(timeout=0.001) avg delay Windows:14.5ms, Ubuntu: 0.063ms

2018-08-28 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



[issue34536] Enum._missing_ doesn't raise TypeError when a non-Enum object is a returned

2018-08-28 Thread Paul Pinterits


New submission from Paul Pinterits :

In a conversation with Ethan Furman (the author of the enum module) I've been 
informed that Enum automatically checks whether the _missing_ method has 
returned an instance of the correct class, and raises a TypeError if not. 
(Link: https://stackoverflow.com/a/52064774/1222951)

However, this simply does not happen.

```
import enum

class MyEnum(enum.Enum):
FOO = "foo"

@classmethod
def _missing_(cls, value):
return 5

print(MyEnum('bar'))  # output: 5
```

--
components: Library (Lib)
messages: 324282
nosy: Paul Pinterits
priority: normal
severity: normal
status: open
title: Enum._missing_ doesn't raise TypeError when a non-Enum object is a 
returned
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



[issue34534] importlib.resources does not work with packages that have no __init__.py

2018-08-28 Thread Barry A. Warsaw


Barry A. Warsaw  added the comment:

https://docs.python.org/3/reference/import.html#regular-packages

Regular packages have __init__.py files and namespace packages do not.  
"Implicit non-namespace packages" aren't really A Thing.

This design choice is deliberate; namespace packages themselves have no 
physical location so there's no place to put resources within them.  Is there a 
problem with adding empty __init__.py files to regular packages with resources?

--
resolution:  -> wont fix
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



[issue34522] PyTypeObject's tp_base initialization bug

2018-08-28 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

(added "object model" reviewers to the nosy list)

--
nosy: +benjamin.peterson, twouters

___
Python tracker 

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



[issue34522] PyTypeObject's tp_base initialization bug

2018-08-28 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I don't agree with "This means that a PyTypeObject's ob_type should always be 
set by PyType_Ready.", and therefore don't agree with the change to 
PyVarObject_HEAD_INIT.

In particular this is not correct when the type has a custom metatype (e.g. 
ob_type != _Type). 

BTW. I don't understand why changing the invocation of PyVarObject_HEAD_INIT is 
needed at all.  Adding calls to PyType_Ready can be don without that change 
(and I agree with explicitly initialising all types).

--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue34534] importlib.resources does not work with packages that have no __init__.py

2018-08-28 Thread Girts Folkmanis


Girts Folkmanis  added the comment:

> What's the difference between "namespace packages and implicit non-namespace 
> packages"? 

To me, the semantic difference is that "namespace packages" are what is used 
when you have "foo.bar" and "foo.baz" come from different distributions 
(https://packaging.python.org/guides/packaging-namespace-packages/). They get 
mentioned in "setup(packages=[...])" in distribution package's setup.py.

--

___
Python tracker 

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



[issue34535] queue.Queue(timeout=0.001) avg delay Windows:14.5ms, Ubuntu: 0.063ms

2018-08-28 Thread Paul Overing


New submission from Paul Overing :

I have found that using timeout with a python queue.Queue() results in an 
average delay of  14.5ms in Windows over Ubuntu in python 3.6.5/3.7, I 
subtracted the 1 ms timeout.

I have also tried datetime.datetime.now() to measure the time, with similar 
results. 

Does that make sense?


import queue
import time

max=0
min=1
num = 1
sum = 0
for x in range(1):
q = queue.Queue()
start = time.perf_counter()
try:
msg = q.get(block=True, timeout=.001)
except:
end = time.perf_counter()

chng = end-start -.001

if chng > max:
max = chng
if chng < min:
min = chng
sum = sum + chng

print(f"Avg: {sum/num}")
print(f"Min: {min}")
print(f"Max: {max}")

Results:

Window 10, Python 3.6.5/3.7
Avg: 0.014549868429997701
Min: 0.00167414200046
Max: 0.1389025150284

Ubuntu 16.04, Python 3.6.5/3.7
Avg: 6.275181290839012e-05
Min: 4.89290034456644e-05
Max: 8.690999695681965e-05

--
components: Windows
messages: 324277
nosy: Gammaguy, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: queue.Queue(timeout=0.001) avg delay Windows:14.5ms, Ubuntu: 0.063ms
type: performance
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue34534] importlib.resources does not work with packages that have no __init__.py

2018-08-28 Thread Eric V. Smith


Eric V. Smith  added the comment:

What's the difference between "namespace packages and implicit non-namespace 
packages"? I think those are the same thing, aren't they?

--
nosy: +barry, brett.cannon, eric.smith

___
Python tracker 

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



[issue34534] importlib.resources does not work with packages that have no __init__.py

2018-08-28 Thread Girts Folkmanis


New submission from Girts Folkmanis :

importlib.resources does not seem to work with packages that don't have 
__init__.py present. Since 3.3+ generally there is no need to create empty 
__init__.py, as directories are automatically treated as packages even without 
the file present. So my expectation would be that importlib.resources would 
follow the same suit. 

Repro, where I expect that both "mod1" and "mod2" would return the files when 
contents() is called:

$ find .
.
./mod2
./mod2/data.txt
./test.py
./mod1
./mod1/__init__.py
./mod1/data.txt

$ cat test.py
import importlib.resources

print('mod1:', list(importlib.resources.contents('mod1')))
print('mod2:', list(importlib.resources.contents('mod2')))

$ python3.7 test.py
mod1: ['__init__.py', '__pycache__', 'data.txt']
mod2: []# < here I would expect to see files too


Looking at the source of Lib/importlib/resources.py, there is the following 
code in contents():

[..]
# Is the package a namespace package?  By definition, namespace packages
# cannot have resources.  We could use _check_location() and catch the
# exception, but that's extra work, so just inline the check.
elif package.__spec__.origin is None or not package.__spec__.has_location:
return ()
[..]

This is the branch that is taken - but it's not necessarily a namespace package 
here, at least to my understanding. Is there a way to make the code here 
distinguish between namespace packages and implicit non-namespace packages 
here, and allow contents() (and other functions) to work?

--
components: Library (Lib)
messages: 324275
nosy: girtsf
priority: normal
severity: normal
status: open
title: importlib.resources does not work with packages that have no __init__.py
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



[issue25433] whitespace in strip()/lstrip()/rstrip()

2018-08-28 Thread Elliot Edmunds


Elliot Edmunds  added the comment:

Not sure how helpful it would be to have the re.sub expressions for lstrip and 
rstrip, but I think it would look like:

l_stripped = re.sub(r'^\s*', '', foo)
r_stripped = re.sub(r'\s*$', '', foo)

--
nosy: +Elliot Edmunds
Added file: https://bugs.python.org/file47769/whitespace_regex.py

___
Python tracker 

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



[issue34062] Python launcher on Windows does not work with --list or --list-paths

2018-08-28 Thread Brendan Gerrity


Change by Brendan Gerrity :


--
nosy: +bgerrity

___
Python tracker 

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



[issue34529] add the option for json.dumps to return newline delimited json

2018-08-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Would this need be fulfilled by the *separators* option?

>>> from json import dumps
>>> query = dict(system='primary', action='load')
>>> print(dumps(query, separators=(',\n', ': ')))
{"system": "primary",
"action": "load"}

--
nosy: +rhettinger

___
Python tracker 

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



[issue34531] doc Move comment about list sorting behavour outside impl-detail directive

2018-08-28 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

The sentence should be left as-is.  It is there to make the following two 
sentences more intelligible.

The docs otherwise make no promises about other implementations and this is as 
it should be.

--
nosy: +rhettinger
resolution:  -> rejected
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



[issue34508] return of non-parenthesized star-unpacking expression a SyntaxError

2018-08-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

> I'm surprised that they are supported in augmented assignments: `a += 1, 2, 
> 3`.

I guess at the time it was felt that it was better to support it everywhere it 
*could* be supported -- and if a is a list it even makes some amount of sense. 
In any case it's too late to change. :-)

--

___
Python tracker 

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



[issue34533] Apply PEP384 to _csv module

2018-08-28 Thread Eddie Elizondo


Change by Eddie Elizondo :


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

___
Python tracker 

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



[issue34533] Apply PEP384 to _csv module

2018-08-28 Thread Eddie Elizondo


New submission from Eddie Elizondo :

This applies the heap type refactoring from PEP 384 to the _csv module.

--
components: Extension Modules
messages: 324268
nosy: eelizondo
priority: normal
severity: normal
status: open
title: Apply PEP384 to _csv module
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



[issue34508] return of non-parenthesized star-unpacking expression a SyntaxError

2018-08-28 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I understand why non-parenthesized tuples are supported in assignments, in 
return statements and yield expressions and in for loops, but I'm surprised 
that they are supported in augmented assignments: `a += 1, 2, 3`.

--

___
Python tracker 

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



[issue34508] return of non-parenthesized star-unpacking expression a SyntaxError

2018-08-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

That's fair. Maybe we shouldn't support `for x in *a, *b:` at all then, until 
we've got a BDFL decision? (Because once you support it one way you can't 
easily change the semantics without breaking backwards compatibility.)

--

___
Python tracker 

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



[issue34532] Python launcher on Windows exits with error when requesting list of available versions

2018-08-28 Thread Brendan Gerrity


New submission from Brendan Gerrity :

When any of the list available pythons arguments is used (e.g. `py -0`), the 
launcher exits with the error code 103 `RC_NO_PYTHON`.

This is inconsistent with the launcher's `-h` help argument, which exits with a 
0.

--
components: Windows
messages: 324265
nosy: bgerrity, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Python launcher on Windows exits with error when requesting list of 
available versions
type: behavior
versions: 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



[issue34482] datetime: Tests for potential crashes due to non-UTF-8-encodable strings

2018-08-28 Thread Alexey Izbyshev


Alexey Izbyshev  added the comment:

Yes, I've referenced the relevant message from #6697 in #34454.

The specific test you've referenced should be changed after #34481 is fixed -- 
it highlights inconsistency between C and Python implementations.

--

___
Python tracker 

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



[issue34508] return of non-parenthesized star-unpacking expression a SyntaxError

2018-08-28 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

> It would need a special case so that `for x in *a, *b:` doesn't first 
> construct a tuple of all elements in a and b. Thoughts?

It may be surprising that `for x in *a, *b:` behave differently from `for x in 
(*a, *b):`.

It is idiomatic to create a list of keys and iterate it if you want to modify 
the dict during iterating:

for key in list(d):
# modify d

This can be written in a form

for key in [*d]:
# modify d

or

for key in (*d,):
# modify d

(although the latter variant is slightly slower).

--

___
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-08-28 Thread Jakub Wilk


Jakub Wilk  added the comment:

I've tested Lars's patch against my collection of sly tarballs:
https://github.com/jwilk/path-traversal-samples

SafeTarFile defeated most, but not all attacks.
It still allows directory traversal for these two tarfile:

1) 
https://github.com/jwilk/path-traversal-samples/releases/download/0/dirsymlink2a.tar

lrwxrwxrwx  cur -> .
lrwxrwxrwx  par -> cur/..
-rw-r--r--  par/moo

2) 
https://github.com/jwilk/path-traversal-samples/releases/download/0/dirsymlink2b.tar

lrwxrwxrwx  cur -> .
lrwxrwxrwx  cur/par -> ..
-rw-r--r--  par/moo

--

___
Python tracker 

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



[issue34403] test_utf8_mode.test_cmd_line() fails on HP-UX due to false assumptions

2018-08-28 Thread Michael Osipov


Michael Osipov <1983-01...@gmx.net> added the comment:

Can we backport this to 3.7 at least?

--

___
Python tracker 

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



[issue34403] test_utf8_mode.test_cmd_line() fails on HP-UX due to false assumptions

2018-08-28 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset d500e5307aec9c5d535f66d567fadb9c587a9a36 by Victor Stinner in 
branch 'master':
bpo-34403: On HP-UX, force ASCII for C locale (GH-8969)
https://github.com/python/cpython/commit/d500e5307aec9c5d535f66d567fadb9c587a9a36


--

___
Python tracker 

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



[issue34531] doc Move comment about list sorting behavour outside impl-detail directive

2018-08-28 Thread Andrés Delfino

Change by Andrés Delfino :


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

___
Python tracker 

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



[issue34531] doc Move comment about list sorting behavour outside impl-detail directive

2018-08-28 Thread Andrés Delfino

New submission from Andrés Delfino :

As this text is phrased:

CPython implementation detail: While a list is being sorted, the effect of 
attempting to mutate, or even inspect, the list is undefined. The C 
implementation of Python makes the list appear empty for the duration, and 
raises ValueError if it can detect that the list has been mutated during a sort.

I take it that the first sentence is a general comment for all implementations, 
as the second sentence does define a specific behavior in CPython, so it's not 
undefined there.

I propose taking the first sentence out of the impl-detail directive.

--
assignee: docs@python
components: Documentation
messages: 324259
nosy: adelfino, docs@python
priority: normal
severity: normal
status: open
title: doc Move comment about list sorting behavour outside impl-detail 
directive
type: enhancement
versions: Python 2.7, 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



[issue34508] return of non-parenthesized star-unpacking expression a SyntaxError

2018-08-28 Thread Guido van Rossum


Guido van Rossum  added the comment:

I think all of these are good.

Perhaps with a small change the for-loop example can allow an elegant way of 
iterating over multiple iterables. It would need a special case so that `for x 
in *a, *b:` doesn't first construct a tuple of all elements in a and b. 
Thoughts?

--

___
Python tracker 

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



[issue34529] add the option for json.dumps to return newline delimited json

2018-08-28 Thread Michał Radwański

Michał Radwański  added the comment:

So this format is just a series of JSON, delimited by a newline. 
Instead of changing API, you might consider this piece of code:

def ndjsondump(objects):
return '\n'.join(json.dumps(obj) for obj in objects)

Conversely, first you `str.splitlines`, then `json.loads` each line separately.

Does it satisfy your needs?

--
nosy: +enedil

___
Python tracker 

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



[issue24632] Improve documentation about __main__.py

2018-08-28 Thread Mitch Gann


Mitch Gann  added the comment:

Can someone please update the Docs on this?  Its been over 3 years since the 
issue was raised and seems fairly straightforward to address.  Also considering 
its a fairly important feature of the language which deals with the entry point 
for packages/modules to be executed, I know many Engineers/Developers using and 
learning the language would benefit from official documentation on this aspect.

--
nosy: +MGann85

___
Python tracker 

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



[issue1529353] Squeezer - squeeze large output in IDLE's shell

2018-08-28 Thread Tal Einat


Tal Einat  added the comment:

I've gone ahead and addressed all of the significant issues raised here:

* Squeezer is no longer an extension
* Expanding problematically large outputs prompts the user for confirmation
* "copy" and "view" moved to a right-click context menu
* use IDLE's TextView for viewing squeezed outputs
  * I added the ability to set the text wrapping
* default minimum # lines for auto-squeezing increased to 50

I've also updated all of the tests accordingly and added a few.

There a several tweaks to consider, including those mentioned in my previous 
message, plus colors and key bindings.

This is now ready for another review!

--

___
Python tracker 

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



[issue34508] return of non-parenthesized star-unpacking expression a SyntaxError

2018-08-28 Thread Mark Dickinson


Mark Dickinson  added the comment:

Thanks, Serhiy. I'm happy to extend my PR to cover those cases, if there's 
general agreement that it's worth doing so. (*I* personally think this is worth 
doing, since it smooths some currently rough edges and removes a few surprises, 
but I'm not comfortable with pushing this forward just on that single data 
point.)

--

___
Python tracker 

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



[issue34403] test_utf8_mode.test_cmd_line() fails on HP-UX due to false assumptions

2018-08-28 Thread Michael Osipov


Michael Osipov <1983-01...@gmx.net> added the comment:

Victor,

this looks good to me:
> osipovmi@blnn724x:/var/osipovmi/cpython []
> $ git fetch vstinner
> remote: Counting objects: 65, done.
> remote: Compressing objects: 100% (18/18), done.
> remote: Total 65 (delta 41), reused 43 (delta 37), pack-reused 10
> Unpacking objects: 100% (65/65), done.
> From https://github.com/vstinner/cpython
>  + 6171da5569...559de620d7 hpux_force_ascii -> vstinner/hpux_force_ascii  
> (forced update)
>  * [new branch]posix_locale37   -> vstinner/posix_locale37
> osipovmi@blnn724x:/var/osipovmi/cpython []
> $ git reset --hard  vstinner/hpux_force_ascii
> HEAD is now at 559de620d7 bpo-34403: On HP-UX, force ASCII for C locale
> $ gmake -j 8
> ...
> osipovmi@blnn724x:/var/osipovmi/cpython []
> $ LC_ALL=C ./python -m test -j0 -r -uall,-network
> ...
> == Tests result: FAILURE ==
> 
> 357 tests OK.
> 
> 35 tests failed:
> test_asyncio test_asyncore test_bytes test_c_locale_coercion
> test_code test_concurrent_futures test_ctypes test_devpoll
> test_distutils test_embed test_faulthandler test_fileio test_gdb
> test_httpservers test_importlib test_io test_mmap
> test_multiprocessing_fork test_multiprocessing_forkserver
> test_multiprocessing_main_handling test_multiprocessing_spawn
> test_normalization test_os test_pkg test_posix test_pty test_re
> test_signal test_socket test_subprocess test_support
> test_threading test_time test_unicode test_zlib
> 
> 26 tests skipped:
> test_curses test_dbm_gnu test_epoll test_idle test_kqueue
> test_lzma test_msilib test_ossaudiodev test_smtpnet
> test_socketserver test_spwd test_startfile test_tcl test_timeout
> test_tix test_tk test_ttk_guionly test_ttk_textonly test_turtle
> test_urllib2net test_urllibnet test_winconsoleio test_winreg
> test_winsound test_xmlrpc_net test_zipfile64
> osipovmi@blnn724x:/var/osipovmi/cpython []
> $ ./python -m test -j0 -r -uall,-network
> ...
> == Tests result: FAILURE ==
> 
> 357 tests OK.
> 
> 35 tests failed:
> test_asyncio test_asyncore test_bytes test_c_locale_coercion
> test_code test_concurrent_futures test_ctypes test_devpoll
> test_distutils test_embed test_faulthandler test_fileio test_gdb
> test_httpservers test_importlib test_io test_mmap
> test_multiprocessing_fork test_multiprocessing_forkserver
> test_multiprocessing_main_handling test_multiprocessing_spawn
> test_normalization test_os test_posix test_pty test_re
> test_readline test_signal test_socket test_subprocess test_support
> test_threading test_time test_unicode test_zlib
> 
> 26 tests skipped:
> test_curses test_dbm_gnu test_epoll test_idle test_kqueue
> test_lzma test_msilib test_ossaudiodev test_smtpnet
> test_socketserver test_spwd test_startfile test_tcl test_timeout
> test_tix test_tk test_ttk_guionly test_ttk_textonly test_turtle
> test_urllib2net test_urllibnet test_winconsoleio test_winreg
> test_winsound test_xmlrpc_net test_zipfile64
> 
> Total duration: 14 min 23 sec
> Tests result: FAILURE

The test_utf8_mode passes. Some other tests likely fail due to this Roman8 
stuff: test_re and friends. I am analyzing the failures step by step and have 
already a few fixes around. Waiting for other PRs to be merged first.

--

___
Python tracker 

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



[issue34516] httplib sets unbefitting "Host" in request header when requests an ipv6 format url.

2018-08-28 Thread Martin Panter

Martin Panter  added the comment:

This sounds like a duplicate of Issue 28539. My understanding of that report is 
that Urllib3 half parses the URL by splitting out the port number, but returns 
a hostname with square brackets intact. Requests then passes the hostname 
(string with brackets) and port number (integer) to Python’s HTTPConnection 
constructor.

I think this is a bug in how Requests or “urllib3” is using Python’s 
HTTPConnection class. Requests should either leave the port number with the 
hostname in the string, or extract the raw hostname by removing the brackets.

--
nosy: +martin.panter
resolution:  -> duplicate
status: open -> pending
superseder:  -> httplib/http.client HTTPConnection._set_hostport() regression

___
Python tracker 

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



[issue34498] Python 3.7 breaks on singledispatch_function.register(pseudo_type), which Python 3.6 accepted

2018-08-28 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

> Could we revert abstract types in `typing` to respond True to 
> `isinstance(..., type)` again?

No, making them classes will cause significant performance penalty (I don't 
remember numbers now, but importing `typing` may be twice slower). Plus this 
will re-introduce some bugs and inconsistencies.

> I don't want singledispatch, or any other library like it, to have to 
> special-case typing.

I didn't propose this. I proposed to allow all objects that pretend to be types 
but are not actually instances of `type`.

--

___
Python tracker 

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



[issue34527] On FreeBSD, Python 3 doesn't support support the POSIX locale

2018-08-28 Thread STINNER Victor


STINNER Victor  added the comment:

I wanted to quickly fix this issue since I'm working on 3 different issues 
where I got conflicts with these changes, and the other issues were impacted by 
this bug.

I sent an email to python-dev about this issue:
https://mail.python.org/pipermail/python-dev/2018-August/155052.html

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



[issue34523] Choose the filesystem encoding before Python initialization (add _PyCoreConfig.filesystem_encoding)

2018-08-28 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-34485 which allows to select (using _PyCoreConfig) the encoding 
and error handlers of standard streams like sys.stdout.

--

___
Python tracker 

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



[issue34498] Python 3.7 breaks on singledispatch_function.register(pseudo_type), which Python 3.6 accepted

2018-08-28 Thread Łukasz Langa

Łukasz Langa  added the comment:

> I would say we could update the check in `functools` to accept more things.

Could we revert abstract types in `typing` to respond True to `isinstance(..., 
type)` again?  I don't want singledispatch, or any other library like it, to 
have to special-case typing.   Especially for *non-generic* variants, 
responding True to `isinstance()` seems reasonable to me.  We cannot dispatch 
by `Sequence[int]` and some such so it makes sense for *those* to keep failing 
going forward.

The current suggested workaround of using abc.Sequence instead will work.

--

___
Python tracker 

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



[issue34527] On FreeBSD, Python 3 doesn't support support the POSIX locale

2018-08-28 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 4ff38870b1de8a3add5357edf125c2866bc42b54 by Victor Stinner in 
branch '3.6':
bpo-34527: Fix FreeBSD with POSIX locale (GH-8975)
https://github.com/python/cpython/commit/4ff38870b1de8a3add5357edf125c2866bc42b54


--

___
Python tracker 

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



[issue34530] distutils: find_executable() fails if the PATH environment variable is not set

2018-08-28 Thread STINNER Victor


STINNER Victor  added the comment:

I'm not sure that it's worth it to modify Python 3.7 and older. distutils 
changes are now well welcomed (breaking setuptools or pip is unpopular :-)).

--
nosy: +Marcus.Smith, dstufft, ncoghlan, paul.moore
versions:  -Python 2.7, 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



[issue34530] distutils: find_executable() fails if the PATH environment variable is not set

2018-08-28 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue34529] add the option for json.dumps to return newline delimited json

2018-08-28 Thread ron


New submission from ron :

Many service providers such as Google BigQuery do not accept Json.
They accept newline delimited Json.

https://cloud.google.com/bigquery/docs/loading-data-cloud-storage-json#limitations

please allow to receive this format directly from the dump.

--
messages: 324244
nosy: ronron
priority: normal
severity: normal
status: open
title: add the option for json.dumps to return newline delimited json
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



[issue34530] distutils: find_executable() fails if the PATH environment variable is not set

2018-08-28 Thread STINNER Victor


New submission from STINNER Victor :

Example:

$ env -i ./python -c 'import distutils.spawn; 
print(distutils.spawn.find_executable("true"))'
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/vstinner/prog/python/master/Lib/distutils/spawn.py", line 176, in 
find_executable
path = os.environ['PATH']
  File "/home/vstinner/prog/python/master/Lib/os.py", line 672, in __getitem__
raise KeyError(key) from None
KeyError: 'PATH'


Attached PR fixes the issue for the master branch.

--
components: Library (Lib)
messages: 324245
nosy: vstinner
priority: normal
severity: normal
status: open
title: distutils: find_executable() fails if the PATH environment variable is 
not set
versions: Python 2.7, 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



[issue34523] Choose the filesystem encoding before Python initialization (add _PyCoreConfig.filesystem_encoding)

2018-08-28 Thread STINNER Victor


STINNER Victor  added the comment:

> The compilation failed on my PR when running 
> PCbuild\amd64\_freeze_importlib.exe: (...)

This issue should now be fixed.

--

___
Python tracker 

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



[issue34403] test_utf8_mode.test_cmd_line() fails on HP-UX due to false assumptions

2018-08-28 Thread Michael Felt


Michael Felt  added the comment:

No time to compile for a couple of days. Stress from others wins instead. 

Maybe on Friday. 

Sent from my iPhone

> On 28 Aug 2018, at 13:20, STINNER Victor  wrote:
> 
> 
> STINNER Victor  added the comment:
> 
>> -check('utf8=0', [arg.decode(encoding, 'surrogateescape')],
>> +check('utf8=0', [arg.decode('ascii', 'surrogateescape')],
>>   LC_ALL='C')
>> (...)
>> == Tests result: SUCCESS ==
> 
> Good, it works.
> 
> I updated my PR 8969 to implement properly my idea. With this PR, on HP-UX 
> with C or POSIX locale, Python now uses ASCII for its "filesystem encoding": 
> sys.getfilesystemencoding() returns "ascii".
> 
> Michael: can you please try my updated PR 8969?
> 
> * apply the updated change
> * recompile Python
> * run the test suite using: LC_ALL=C ./python -m test -j0 -r
> 
> You may also test with the current locale: ./python -m test -j0 -r
> 
> If everything is good on your side, I will merge my PR.
> 
> --
> 
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue34527] On FreeBSD, Python 3 doesn't support support the POSIX locale

2018-08-28 Thread STINNER Victor


STINNER Victor  added the comment:

Note: Python 2.7 is not affected: it doesn't have "force_ascii" and 
"LC_ALL=POSIX ./python -m test test_cmd_line_script" pass successfully.

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



[issue34527] On FreeBSD, Python 3 doesn't support support the POSIX locale

2018-08-28 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8448

___
Python tracker 

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



[issue34527] On FreeBSD, Python 3 doesn't support support the POSIX locale

2018-08-28 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 65ef7425a32ee411d8047a4fad0fc6bb9ff733b1 by Victor Stinner in 
branch '3.7':
bpo-34527: POSIX locale enables the UTF-8 Mode (GH-8972) (GH-8974)
https://github.com/python/cpython/commit/65ef7425a32ee411d8047a4fad0fc6bb9ff733b1


--

___
Python tracker 

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



[issue34527] On FreeBSD, Python 3 doesn't support support the POSIX locale

2018-08-28 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8447

___
Python tracker 

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



[issue34403] test_utf8_mode.test_cmd_line() fails on HP-UX due to false assumptions

2018-08-28 Thread STINNER Victor


STINNER Victor  added the comment:

> -check('utf8=0', [arg.decode(encoding, 'surrogateescape')],
> +check('utf8=0', [arg.decode('ascii', 'surrogateescape')],
>LC_ALL='C')
>  (...)
> == Tests result: SUCCESS ==

Good, it works.

I updated my PR 8969 to implement properly my idea. With this PR, on HP-UX with 
C or POSIX locale, Python now uses ASCII for its "filesystem encoding": 
sys.getfilesystemencoding() returns "ascii".

Michael: can you please try my updated PR 8969?

* apply the updated change
* recompile Python
* run the test suite using: LC_ALL=C ./python -m test -j0 -r

You may also test with the current locale: ./python -m test -j0 -r

If everything is good on your side, I will merge my PR.

--

___
Python tracker 

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



[issue24482] itertools.tee causes segfault in a multithreading environment, while the equivalent implementation doesn't

2018-08-28 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I can also reproduce the original script's segfault in 2.7 but not in master. 
There is a related bug as per the original description by Dmitry that 
itertools.tee is not thread safe in https://bugs.python.org/msg323817 and a 
related SO answer to this that will add some context 
https://stackoverflow.com/a/44638570/2610955

Thanks

--
nosy: +xtreak

___
Python tracker 

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



[issue24482] itertools.tee causes segfault in a multithreading environment, while the equivalent implementation doesn't

2018-08-28 Thread Xiang Zhang


Change by Xiang Zhang :


--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> itertools.tee not thread-safe; can segfault interpreter when 
wrapped iterator releases GIL

___
Python tracker 

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



[issue34410] itertools.tee not thread-safe; can segfault interpreter when wrapped iterator releases GIL

2018-08-28 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This might be redundant but I googled 'itertools tee thread safe' and came 
across a detailed SO answer from 2017 that explains the issue along with a 
similar example that causes segfault in the compiler but it was not reported 
here it seems. It also proposes a possible solution to fix the iterator but not 
tee itself. 

SO answer : https://stackoverflow.com/a/44638570/2610955

Similar open issue that could be a duplicate 

https://bugs.python.org/issue24482


Thanks

--

___
Python tracker 

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



[issue34403] test_utf8_mode.test_cmd_line() fails on HP-UX due to false assumptions

2018-08-28 Thread Michael Osipov


Michael Osipov <1983-01...@gmx.net> added the comment:

Here is the output to your questions:
> osipovmi@blnn724x:/var/osipovmi/cpython []
> $ git checkout hpux_force_ascii
> Branch 'hpux_force_ascii' set up to track remote branch 'hpux_force_ascii' 
> from 'vstinner'.
> Switched to a new branch 'hpux_force_ascii'
> osipovmi@blnn724x:/var/osipovmi/cpython []
> $ git cherry-pick 217af1d38db3e1e875180c6fa160f0fc80e46003
> [hpux_force_ascii 7ce2927185] bpo-34403, bpo-34207: Fix 
> test_utf8_mode.test_cmd_line()
>  Author: Victor Stinner 
>  Date: Tue Aug 28 09:35:25 2018 +0200
>  1 file changed, 20 insertions(+), 11 deletions(-)
> osipovmi@blnn724x:/var/osipovmi/cpython []
> $ export CC=/opt/aCC/bin/cc ; \
>  export CXX=/opt/aCC/bin/aCC ; \
>  export LDFLAGS=-L/usr/local/lib/hpux32 ; \
>  export UNIX_STD=1998 ; \
> ./configure --prefix=/var/osipovmi/python37-testing --without-gcc 
> --with-system-expat --with-pydebug --with-openssl=/opt/openssl
> ...
> osipovmi@blnn724x:/var/osipovmi/cpython []
> $ gmake -j 8
> ...
> osipovmi@blnn724x:/var/osipovmi/cpython []
> $ ./python -m test test_utf8_mode
> Run tests sequentially
> 0:00:00 [1/1] test_utf8_mode
> test test_utf8_mode failed -- Traceback (most recent call last):
>   File "/var/osipovmi/cpython/Lib/test/test_utf8_mode.py", line 235, in 
> test_cmd_line
> LC_ALL='C')
>   File "/var/osipovmi/cpython/Lib/test/test_utf8_mode.py", line 214, in check
> self.assertEqual(args, ascii(expected), out)
> AssertionError: "['h\\udca7\\udce9']" != "['h\\xcf\\xd5']"
> - ['h\udca7\udce9']
> + ['h\xcf\xd5']
>  : roman8:['h\udca7\udce9']
> 
> test_utf8_mode failed
> 
> == Tests result: FAILURE ==
> 
> 1 test failed:
> test_utf8_mode
> 
> Total duration: 3 sec 58 ms
> Tests result: FAILURE
> osipovmi@blnn724x:/var/osipovmi/cpython []
> $ git diff
> diff --git a/Lib/test/test_utf8_mode.py b/Lib/test/test_utf8_mode.py
> index 5af35aed61..89c1f92615 100644
> --- a/Lib/test/test_utf8_mode.py
> +++ b/Lib/test/test_utf8_mode.py
> @@ -231,7 +231,7 @@ class UTF8ModeTests(unittest.TestCase):
> 
>  # Check that the command line is decoded from the locale encoding
>  with self.subTest(encoding=encoding):
> -check('utf8=0', [arg.decode(encoding, 'surrogateescape')],
> +check('utf8=0', [arg.decode('ascii', 'surrogateescape')],
>LC_ALL='C')
> 
>  def test_optim_level(self):
> osipovmi@blnn724x:/var/osipovmi/cpython []
> $ ./python -m test test_utf8_mode
> Run tests sequentially
> 0:00:00 [1/1] test_utf8_mode
> 
> == Tests result: SUCCESS ==
> 
> 1 test OK.
> 
> Total duration: 3 sec 65 ms
> Tests result: SUCCESS
> 
> osipovmi@blnn724x:/var/osipovmi/cpython []
> $ LC_ALL=C ./python -X utf8=0
> Python 3.8.0a0 (heads/hpux_force_ascii:7ce2927185, Aug 28 2018, 12:43:04) [C] 
> on hp-ux11
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import locale ; import sys
> >>> sys.getfilesystemencoding() ; locale.getpreferredencoding()
> 'hp-roman8'
> 'roman8'
> >>>
> osipovmi@blnn724x:/var/osipovmi/cpython []
> $

I cannot give a qualified answer on
> Maybe Python should also force ASCII here?
but since you have figured out that the conversion is broken, one must treat is 
as such or use ASCII only and UTF-8 for the rest.

--

___
Python tracker 

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



[issue34528] Windows installer: Failed to run untrusted mode.

2018-08-28 Thread Cabu


New submission from Cabu :

At work, we are using Windows 7 Enterprise. I have local admin rights on a 
separate account.

When trying to install Python 3.6.3 or 3.7.0 for amd64, the installer stop 
after a couple of seconds without any message/popup. But, I have found the 
attched log in a temp folder.

It seems that the installer try to run a copy of itself in a folder where even 
the local admin can't run executables by company policy.

I didn't find any issue with the same error code in the tracker.

--
components: Installation
files: Setup_20180828111438_Failed.txt
messages: 324235
nosy: Cabu, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Windows installer: Failed to run untrusted mode.
type: crash
versions: Python 3.6, Python 3.7
Added file: https://bugs.python.org/file47768/Setup_20180828111438_Failed.txt

___
Python tracker 

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



[issue34527] On FreeBSD, Python 3 doesn't support support the POSIX locale

2018-08-28 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 5cb258950ce9b69b1f65646431c464c0c17b1510 by Victor Stinner in 
branch 'master':
bpo-34527: POSIX locale enables the UTF-8 Mode (GH-8972)
https://github.com/python/cpython/commit/5cb258950ce9b69b1f65646431c464c0c17b1510


--

___
Python tracker 

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



[issue34523] Choose the filesystem encoding before Python initialization (add _PyCoreConfig.filesystem_encoding)

2018-08-28 Thread STINNER Victor


STINNER Victor  added the comment:

The compilation failed on my PR when running 
PCbuild\amd64\_freeze_importlib.exe:

ValueError: only 'strict' and 'surrogateescape' error handlers are supported, 
not 'surrogatepass'

The error comes from locale_error_handler(). Before my change, 
PyUnicode_EncodeFSDefault() and PyUnicode_DecodeFSDefault() used 
Py_FileSystemDefaultEncodeErrors which is initialized to "surrogateescape", but 
only set to "surrogatepass" by initfsencoding().

With my change, the error handler is directly set to "surrogatepass", but 
currently, unicode_encode_locale() and unicode_decode_locale() don't accept 
this error handler.

--

___
Python tracker 

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



[issue26544] platform.libc_ver() returns incorrect version number

2018-08-28 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +8446

___
Python tracker 

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



[issue34508] return of non-parenthesized star-unpacking expression a SyntaxError

2018-08-28 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Other examples:

eval('*(1, 2), 3')

a = []; a += *(1, 2), 3

for i in *(1, 2), 3: pass

def g(): yield *(1, 2), 3

--
nosy: +benjamin.peterson, gvanrossum, serhiy.storchaka

___
Python tracker 

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



[issue34527] On FreeBSD, Python 3 doesn't support support the POSIX locale

2018-08-28 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue26544] platform.libc_ver() returns incorrect version number

2018-08-28 Thread STINNER Victor


STINNER Victor  added the comment:

Would it be possible to add a few tests on platform._comparable_version()? It 
would make me more confortable for backports.

--

___
Python tracker 

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



[issue26544] platform.libc_ver() returns incorrect version number

2018-08-28 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +8444

___
Python tracker 

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



[issue26544] platform.libc_ver() returns incorrect version number

2018-08-28 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +8443

___
Python tracker 

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



[issue34527] On FreeBSD, Python 3 doesn't support support the POSIX locale

2018-08-28 Thread STINNER Victor


New submission from STINNER Victor :

vstinner@freebsd$ env -i LC_ALL=POSIX ./python -m test -v test_cmd_line_script  
-m test_non_ascii
== CPython 3.8.0a0 (heads/master:096329f0b2, Aug 28 2018, 09:30:55) [Clang 
4.0.0 (tags/RELEASE_400/final 297347)]
== FreeBSD-11.1-RELEASE-amd64-64bit-ELF little-endian
== cwd: /usr/home/vstinner/prog/python/master/build/test_python_13073
== CPU count: 2
== encodings: locale=US-ASCII, FS=ascii
Run tests sequentially
0:00:00 load avg: 0.48 [1/1] test_cmd_line_script
test_non_ascii (test.test_cmd_line_script.CmdLineTest) ... FAIL

==
FAIL: test_non_ascii (test.test_cmd_line_script.CmdLineTest)
--
Traceback (most recent call last):
  File 
"/usr/home/vstinner/prog/python/master/Lib/test/test_cmd_line_script.py", line 
512, in test_non_ascii
'stdout=%r stderr=%r' % (stdout, stderr))
AssertionError: "'./@test_13073_tmp\\udce7w\\udcf0.py'" != "''"
- './@test_13073_tmp\udce7w\udcf0.py'
+ ''
 : stdout=b"''\n" stderr=b"Failed checking if argv[0] 
is an import path entry\nUnicodeEncodeError: 'ascii' codec can't encode 
character '\\xe7' in position 17: ordinal not in range(128)"

--
Ran 1 test in 0.093s

FAILED (failures=1)
test test_cmd_line_script failed
test_cmd_line_script failed

== Tests result: FAILURE ==

1 test failed:
test_cmd_line_script

Total duration: 170 ms
Tests result: FAILURE


By the way, the UTF-8 Mode is not enabled by the POSIX locale:

vstinner@freebsd$ env -i LC_ALL=POSIX ./python -c 'import sys; 
print(sys.flags.utf8_mode)'
0

It contradicts the PEP 540 which says the the UTF-8 Mode is enabled by the 
POSIX locale:

https://www.python.org/dev/peps/pep-0540/#abstract

> This mode is off by default, but is automatically activated when using the 
> "POSIX" locale.

--
components: Interpreter Core
messages: 324230
nosy: ncoghlan, vstinner
priority: normal
severity: normal
status: open
title: On FreeBSD, Python 3 doesn't support support the POSIX locale
versions: 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



[issue34519] Add additional aliases for HP Roman 8

2018-08-28 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The hp-roman8 codec was added in issue996067. The link to the original data 
(ftp://dkuug.dk/i18n/charmaps/HP-ROMAN8) is dead now.

--

___
Python tracker 

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



[issue34519] Add additional aliases for HP Roman 8

2018-08-28 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Please provide references for the definition of 'cp1051' and 'ibm1051'.

--
nosy: +lemburg, serhiy.storchaka

___
Python tracker 

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



[issue11190] test_locale error on AIX

2018-08-28 Thread STINNER Victor


STINNER Victor  added the comment:

> So, I guess it is still an issue to be examined, just not urgently.

The test pass in the master branch, so I close the issue.

If you want to do something, discuss with the maintainers of AIX C library to 
ask them if strcoll() work as expected according to them.

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



[issue11190] test_locale error on AIX

2018-08-28 Thread Michael Felt


Michael Felt  added the comment:

Ok - testing other Python3 versions:

3.4.9 - failed
3.5.5 - failed

3.7.0 - passes - ah - but due to skip tests!
test_strcoll (test.test_locale.TestEnUSCollation) ... testing with 
'en_US.ISO8859-1'... ok
test_strcoll_with_diacritic (test.test_locale.TestEnUSCollation) ... skipped 
'bpo-29972: broken test on AIX'
test_strxfrm (test.test_locale.TestEnUSCollation) ... testing with 
'en_US.ISO8859-1'... ok
test_strxfrm_with_diacritic (test.test_locale.TestEnUSCollation) ... skipped 
'bpo-29972: broken test on AIX'

So, I guess it is still an issue to be examined, just not urgently.

--
versions: +Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8 -Python 
3.2

___
Python tracker 

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



[issue34403] test_utf8_mode.test_cmd_line() fails on HP-UX due to false assumptions

2018-08-28 Thread STINNER Victor


STINNER Victor  added the comment:

...
> byte 0xA7 decoded to Unicode character U+00A7
...

Well, it confirms what I expected: nl_langinfo(CODESET) announces "roman8", but 
mbstowcs() uses Latin1 encoding in practice.

So I wrote the PR 8969 which forces the ASCII encoding in that case. I'm not 
sure how test_utf8_mode is supposed to be fixed in that case.

Michael: you can try to apply PR 8969, and then apply manually PR 8967 patch:
https://patch-diff.githubusercontent.com/raw/python/cpython/pull/8967.patch

But I expect that with both patches, test_utf8_mode will still fail on 
test_cmd_line(). You can try to modify test_cmd_line() to force encoding to 
"ascii".

What are the values of sys.getfilesystemencoding() and 
locale.getpreferredencoding() with the C locale with PR 8969? I expect "roman8" 
which can cause issue in os.fsencode()/os.fsdecode(). Maybe Python should also 
force ASCII here?

--

___
Python tracker 

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



[issue34403] test_utf8_mode.test_cmd_line() fails on HP-UX due to false assumptions

2018-08-28 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +8442

___
Python tracker 

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



[issue34526] Path.relative_to() taking multiple arguments could be better documented

2018-08-28 Thread Antony Lee

New submission from Antony Lee :

Currently, the docs for Path.relative_to read

PurePath.relative_to(*other)
Compute a version of this path relative to the path represented by other. 
If it’s impossible, ValueError is raised: (examples follow)

It's a bit confusing why other is a star-args, especially as no example 
actually passes more than one argument to relative_to.

The docstring is a tiny bit clearer:

Return the relative path to another path identified by the passed
arguments.  If the operation is not possible (because this is not
a subpath of the other path), raise ValueError.

Effectively, a Path is constructed from all *other args and used as base for 
the computation of the relative path.  It looks a bit like a misfeature to me, 
but at least it could be better documented (e.g. by adding 
`Path("/tmp/foo/bar").relative_to("/tmp", "foo") == Path("bar")` as example in 
the docs).

--
assignee: docs@python
components: Documentation
messages: 324224
nosy: Antony.Lee, docs@python
priority: normal
severity: normal
status: open
title: Path.relative_to() taking multiple arguments could be better documented
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



  1   2   >