[issue36030] add internal API function to create tuple without items array initialization

2019-02-19 Thread Sergey Fedoseev


New submission from Sergey Fedoseev :

PyTuple_New() fills items array with NULLs to make usage of Py_DECREF() safe 
even when array is not fully filled with real items.
There are multiple cases when this initialization step can be avoided to 
improve performance. For example it gives such speed-up for PyList_AsTuple():

Before:
$ python -m perf timeit -s "l = [None] * 10**6" "tuple(l)"
.
Mean +- std dev: 4.43 ms +- 0.01 ms

After:
$ python -m perf timeit -s "l = [None] * 10**6" "tuple(l)"
.
Mean +- std dev: 4.11 ms +- 0.03 ms

--
messages: 335897
nosy: sir-sigurd
priority: normal
severity: normal
status: open
title: add internal API function to create tuple without items array 
initialization
type: performance
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



[issue36030] add internal API function to create tuple without items array initialization

2019-02-19 Thread Sergey Fedoseev


Change by Sergey Fedoseev :


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

___
Python tracker 

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



[issue36030] add internal API function to create tuple without items array initialization

2019-02-19 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
nosy: +vstinner

___
Python tracker 

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



[issue35126] Mistake in FAQ about converting number to string.

2019-02-19 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
keywords: +easy

___
Python tracker 

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



[issue36028] Integer Division discrepancy with float

2019-02-19 Thread Mark Dickinson


Mark Dickinson  added the comment:

[Au Vo]

> Python2 produces 10.0 as the answers for all of the above calculation.

Can you double check this, and confirm which Python version and operating 
system you're using? Like others, I'm not seeing any difference between Python 
2 and Python 3, and as far as I'm aware the implementation of `//` for floats 
hasn't changed between Python 2 and Python 3.

There's no behavioural bug here: all operations are producing perfectly 
correctly rounded results, which is about as good as one could possibly hope 
for. And as Tim says:

> In any case, none of this is going to change after 30 years ;-)

It's surprising, sure, but it's correct, and I can't imagine any fudge that 
would make the two results match without introducing a horde of other weird 
corner cases.

[Tim]

> For Python 3 I had thought Guido agreed to change a % b for floats to
> return an exact result (exactly equal to the mathematical a - q*b for
> some mathematical integer q) such that abs(a % b) <= abs(b)/2, which
> is most useful most often for floats.  But that didn't happen.

If it's any consolation, we do at least have `math.remainder` in Python 3.7, 
which does exactly this.

Closing this issue.

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

___
Python tracker 

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



[issue36028] Integer Division discrepancy with float

2019-02-19 Thread Mark Dickinson


Mark Dickinson  added the comment:

> Can you double check this, and confirm which Python version and operating 
> system you're using?

Sorry; I missed the screenshots. It looks as though you labelled those the 
wrong way around, BTW: I think "Screen Shot 2019-02-18 at 9.07.37 PM.png" is 
the Python 2 one, and it looks as though Trinket does indeed give a result of 
10 for 1 // 0.1. Unfortunately, there's little information about how Trinket is 
implemented. Is it CPython-based?

--

___
Python tracker 

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



[issue35954] Incoherent type conversion in configparser

2019-02-19 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Other methods validate explicitly their arguments with _validate_value_types 
for example.

Here it raises KeyError which does not seem to be the appropriate exception. 
ConfigParser implementing the mapping protocol it seems weird to me to have

>>> a = 123
>>> config[a] = {}
>>> config[a]
KeyError: 123

I would have prefered a TypeError to be raised on __setitem__ but this is now 
documented behavior.

--

___
Python tracker 

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



[issue36026] Different error message when sys.settrace is used (regressions)

2019-02-19 Thread SylvainDe


Change by SylvainDe :


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



[issue36031] add internal API function to effectively convert just created list to tuple

2019-02-19 Thread Sergey Fedoseev


New submission from Sergey Fedoseev :

There are several cases in CPython sources when PyList_AsTuple() is used with 
just created list and immediately after that this list is Py_DECREFed. This 
operation can be performed more effectively since refcount of items is not 
changed. For example it gives such speed-up for BUILD_TUPLE_UNPACK:

Before:
$ python -m perf timeit -s "l = [None]*10**6" "(*l,)"
.
Mean +- std dev: 8.75 ms +- 0.10 ms

After:
$ python -m perf timeit -s "l = [None]*10**6" "(*l,)"
.
Mean +- std dev: 5.41 ms +- 0.07 ms

--
messages: 335901
nosy: sir-sigurd
priority: normal
severity: normal
status: open
title: add internal API function to effectively convert just created list to 
tuple
type: performance
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



[issue36026] Different error message when sys.settrace is used

2019-02-19 Thread INADA Naoki


INADA Naoki  added the comment:

> Thus, even if this eventually deserves to be closed as a non-issue, I'd 
> rather go on the safe side and double check if this is the desirable 
> behaviour or if something went wrong with the commits previously mentioned. 

As Serhiy mentioned, this error message is raised from optimization path.
Nothing went wrong.  Error messages are vary depending on internal C code 
paths.  So this is not an bug or issue.  People must not rely on error message.

On the other hand, I don't oppose to making error messages more consistent.
It improve code health, like fixing typos in C comment which Python user 
doesn't see.

--
components: +Interpreter Core
title: Different error message when sys.settrace is used (regressions) -> 
Different error message when sys.settrace is used
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



[issue36028] Integer Division discrepancy with float

2019-02-19 Thread Mark Dickinson


Mark Dickinson  added the comment:

> Unfortunately, there's little information about how Trinket is implemented. 
> Is it CPython-based?

>From a little playing around, Trinket only provides a subset of Python (one 
>might say "batteries not included"), and it's not clear what its basis is. 
>None of `sys.version_info`, `sys.platform`, `sys.float_info`, 
>`sys.float_repr_style`, `int.bit_length` or `math.fmod` was available in my 
>Python 2 tests.

1 % 0.1 gives 0.1, but 1 // 0.1 gives 10, so the invariant that Tim mentions is 
broken on Trinket.

@Au Vo: it looks as though you should take this up with the Trinket developers. 
It looks like a problem with their Python-subset implementation.

--

___
Python tracker 

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



[issue36031] add internal API function to effectively convert just created list to tuple

2019-02-19 Thread Sergey Fedoseev


Change by Sergey Fedoseev :


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

___
Python tracker 

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



[issue36026] Different error message when sys.settrace is used

2019-02-19 Thread SylvainDe


SylvainDe  added the comment:

Thanks for the investigation. I'm fine with the explanation provided.

--

___
Python tracker 

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



[issue36032] Wrong output in tutorial (3.1.2. Strings)

2019-02-19 Thread Amit Amely


New submission from Amit Amely :

This is the tutorial text:

>>> prefix = 'Py'
>>> prefix 'thon'  # can't concatenate a variable and a string literal
  ...
SyntaxError: invalid syntax
>>> ('un' * 3) 'ium'
  ...
SyntaxError: invalid syntax

This is the actual result:

>>> prefix = 'Py'
>>> prefix 'thon'  # can't concatenate a variable and a string literal
  File "", line 1
prefix 'thon'  # can't concatenate a variable and a string literal
^
SyntaxError: invalid syntax

--
assignee: docs@python
components: Documentation
messages: 335905
nosy: Amit Amely, docs@python
priority: normal
severity: normal
status: open
title: Wrong output in tutorial (3.1.2. Strings)
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



[issue36028] Integer Division discrepancy with float

2019-02-19 Thread Mark Dickinson


Change by Mark Dickinson :


--
resolution: not a bug -> third party

___
Python tracker 

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



[issue36031] add internal API function to effectively convert just created list to tuple

2019-02-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Could you provide more real world examples? Optimizing just one artificial 
example does not look impressive.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue36028] Integer Division discrepancy with float

2019-02-19 Thread Mark Dickinson


Mark Dickinson  added the comment:

>From a little more digging, it seems that Trinket's Python 2 is based on 
>Skulpt (so is a JavaScript implementation of a subset of Python), while the 
>Python 3 "trinket" connects to an Ubuntu Linux server running CPython 3.6.6.

--

___
Python tracker 

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



[issue36029] Use consistent case for HTTP header fields

2019-02-19 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Thank you for your contribution and your issue, it's really appreciated. I had 
a doubt about this point and I wanted to verify about the HTTP headers.

But in the previous version of this RFC7230: 
https://www.w3.org/Protocols/rfc2616/rfc2616.html

Here is the section 4.2 "Message Headers" of this previous RFC: 
https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.2
where you have "Field names are case-insensitive".

We can see the RFC2616 was replaced by multiple RFCs (7230-7237) and in the RFC 
7230, there is a section 3.2 where there is the description of the header 
fields.

In the section 3.2 of RFC7230:

3.2. Header Fields
"
Each header field consists of a case-insensitive field name followed
by a colon (":"), optional leading whitespace, the field value, and
optional trailing whitespace.
"

https://tools.ietf.org/html/rfc7230#section-3.2

So in this case, it's case-insensitive.

I think we can close this issue and the associated Pull Request.

Have a nice day and thank you,

--
nosy: +matrixise

___
Python tracker 

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



[issue36032] Wrong output in tutorial (3.1.2. Strings)

2019-02-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The output in tutorial is correct. "..." means omitted output (we don't want to 
clutter examples with insignificant details).

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



[issue35859] Capture behavior depends on the order of an alternation

2019-02-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests:  -11700

___
Python tracker 

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



[issue35689] IDLE: Docstrings and test for colorizer

2019-02-19 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy:  -miss-islington
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



[issue35859] Capture behavior depends on the order of an alternation

2019-02-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests:  -11701

___
Python tracker 

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



[issue36031] add internal API function to effectively convert just created list to tuple

2019-02-19 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
nosy: +vstinner

___
Python tracker 

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



[issue35126] Mistake in FAQ about converting number to string.

2019-02-19 Thread miss-islington

miss-islington  added the comment:


New changeset c611db4942a07c81f54e6584615bbddc51034a77 by Miss Islington (bot) 
(Stéphane Wirtel) in branch '2.7':
[2.7] bpo-35126: Fix a mistake in FAQ about converting number to string 
(GH-11911)
https://github.com/python/cpython/commit/c611db4942a07c81f54e6584615bbddc51034a77


--
nosy: +miss-islington

___
Python tracker 

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



[issue36026] Different error message when sys.settrace is used

2019-02-19 Thread INADA Naoki


INADA Naoki  added the comment:

Is this make sense?

>>> set.add(0)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: descriptor 'add' for type 'set' doesn't apply to type 'int'
>>> set.add.__get__(0)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: descriptor 'add' for type 'set' doesn't apply to type 'int'

--

___
Python tracker 

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



[issue36026] Different error message when sys.settrace is used

2019-02-19 Thread INADA Naoki


Change by INADA Naoki :


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

___
Python tracker 

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



[issue36032] Wrong output in tutorial (3.1.2. Strings)

2019-02-19 Thread Amit Amely


Amit Amely  added the comment:

But it also contains an error message part which has nothing to do with
this example (marked in dark green)

This only works with two literals though, not with variables or expressions:

>>> prefix = 'Py'>>> prefix 'thon'  # can't concatenate a variable and a string 
>>> literal  ...SyntaxError: invalid syntax>>> ('un' * 3) 'ium'  
>>> ...SyntaxError: invalid syntax

If you want to concatenate variables or a variable and a literal, use +:

On Tue, Feb 19, 2019 at 10:58 AM Serhiy Storchaka 
wrote:

>
> Serhiy Storchaka  added the comment:
>
> The output in tutorial is correct. "..." means omitted output (we don't
> want to clutter examples with insignificant details).
>
> --
> nosy: +serhiy.storchaka
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue36026] Different error message when sys.settrace is used

2019-02-19 Thread SylvainDe


SylvainDe  added the comment:

This looks good to me :)

--

___
Python tracker 

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



[issue36026] Different error message when sys.settrace is used

2019-02-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I consider this as a minor regression in 3.7, unless there were reasons to 
change error messages. I think that in this case the change that restores error 
messages should be backported to 3.7.

--

___
Python tracker 

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



[issue36032] Wrong output in tutorial (3.1.2. Strings)

2019-02-19 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

@serhiy

I think Amit wants to say there is no triple point in these examples of the 
tutorial.

--
nosy: +matrixise

___
Python tracker 

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



[issue36032] Wrong output in tutorial (3.1.2. Strings)

2019-02-19 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

and when you execute the examples, the REPL does not generate the triple points.

For me, the examples of the tuto are correct and we don't need to add '...' in 
the examples.

--

___
Python tracker 

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



[issue36031] add internal API function to effectively convert just created list to tuple

2019-02-19 Thread Sergey Fedoseev


Sergey Fedoseev  added the comment:

Does this look like more real world example?

Before:
$ python -m perf timeit -s "t = (1, 2, 3)" "(*t, 4, 5)"
.
Mean +- std dev: 95.7 ns +- 2.3 ns

After:
$ python -m perf timeit -s "t = (1, 2, 3)" "(*t, 4, 5)"
.
Mean +- std dev: 85.1 ns +- 0.6 ns

--

___
Python tracker 

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



[issue36026] Different error message when sys.settrace is used

2019-02-19 Thread INADA Naoki


INADA Naoki  added the comment:

@Serhiy Error messages are not changed in 3.7.  They are different from 3.6.
Optimization in 3.7 changed "code path", not error message.
So it's difficult to fix this without breaking existing behavior.

Python 3.6.7 (default, Dec 18 2018, 17:32:18)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
>>> set.add(0)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: descriptor 'add' requires a 'set' object but received a 'int'
>>> set.add.__get__(0)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: descriptor 'add' for 'set' objects doesn't apply to 'int' object

--

___
Python tracker 

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



[issue36026] Different error message when sys.settrace is used

2019-02-19 Thread INADA Naoki


INADA Naoki  added the comment:

BTW, should we have different error message for class methods and instance 
mehtods?

* method: "descriptor 'X' for 'Y' objects doesn't apply to a 'Z' object"
* classmethod: "descriptor 'X' for 'Y' types doesn't apply to a 'Z' type"

Currently, classmethod notice about subtype, but instance method doesn't notice 
about subtype.
Should we notice about subtype in both error message?
Could someone write short, clear, and consistent error message?

--

___
Python tracker 

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



[issue36024] ctypes: test_ctypes test_callbacks() crash on AArch64 with SELinux enabled

2019-02-19 Thread STINNER Victor


STINNER Victor  added the comment:

Florian Weimer wrote a fix for libffi, so the bug is in libffi and not 
Python/ctypes. I close the issue. There are enough open issues to track this 
bug :-)
https://github.com/libffi/libffi/issues/470

--
resolution:  -> third party
stage:  -> resolved
status: open -> closed
title: ctypes: test_ctypes test_callbacks() crash on AArch64 -> ctypes: 
test_ctypes test_callbacks() crash on AArch64 with SELinux enabled

___
Python tracker 

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



[issue36021] [Security][Windows] webbrowser: WindowsDefault uses os.startfile() and so can be abused to run arbitrary commands

2019-02-19 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


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

___
Python tracker 

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



[issue36027] Consider adding modular multiplicative inverse to the math module

2019-02-19 Thread Mark Dickinson


Mark Dickinson  added the comment:

+1 for the pow(value, -1, modulus) spelling. It should raise `ValueError` if 
`value` and `modulus` are not relatively prime.

It would feel odd to me _not_ to extend this to `pow(value, n, modulus)` for 
all negative `n`, again valid only only if `value` is relatively prime to 
`modulus`.

--

___
Python tracker 

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



[issue36027] Consider adding modular multiplicative inverse to the math module

2019-02-19 Thread Mark Dickinson


Mark Dickinson  added the comment:

Here's an example of some code in the standard library that would have 
benefited from the availability of `pow(x, n, m)` for arbitrary negative n: 
https://github.com/python/cpython/blob/e7a4bb554edb72fc6619d23241d59162d06f249a/Lib/_pydecimal.py#L957-L960

if self._exp >= 0:
exp_hash = pow(10, self._exp, _PyHASH_MODULUS)
else:
exp_hash = pow(_PyHASH_10INV, -self._exp, _PyHASH_MODULUS)

where:

_PyHASH_10INV = pow(10, _PyHASH_MODULUS - 2, _PyHASH_MODULUS)

With the proposed addition, that just becomes `pow(10, self._exp, 
_PyHASH_MODULUS)`, and the `_PyHASH_10INV` constant isn't needed any more.

--

___
Python tracker 

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



[issue36030] add internal API function to create tuple without items array initialization

2019-02-19 Thread STINNER Victor


STINNER Victor  added the comment:

Sergey Fedoseev wrote similar change for list: bpo-34151.

--

___
Python tracker 

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



[issue29515] socket module missing IPPROTO_IPV6, IPPROTO_IPV4 on Windows

2019-02-19 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

It turns out having this fix would be useful for proceeding with issue17561, 
which right now cannot support dual-stack IPv4/6 on Windows because 
IPPROTO_IPV6 is missing, see my comment:
https://github.com/python/cpython/pull/11784#issuecomment-465078646

--
dependencies: +Add socket.bind_socket() convenience function
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue36033] logging.makeLogRecord should update "rv" using a dict defined with bytes instead of strings

2019-02-19 Thread Rodolfo Alonso


New submission from Rodolfo Alonso :

When using Pycharm to execute unit/functional tests (OpenStack development), 
oslo_privsep.daemon._ClientChannel.out_of_band retrieves the record from the 
input arguments. Pycharm arguments are stored in a dictionary using bytes 
instead of strings.

When logging.makeLogRecord tries to update "rv", the value in "dict" parameter 
(using bytes) doesn't update "rv" values.

--
messages: 335925
nosy: ralonsoh
priority: normal
severity: normal
status: open
title: logging.makeLogRecord should update "rv" using a dict defined with bytes 
instead of strings
type: enhancement
versions: Python 3.5

___
Python tracker 

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



[issue15248] Better explain "TypeError: 'tuple' object is not callable"

2019-02-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +11957

___
Python tracker 

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



[issue35942] posixmodule.c:path_converter() returns an invalid exception message for broken PathLike objects

2019-02-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +11956

___
Python tracker 

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



[issue35942] posixmodule.c:path_converter() returns an invalid exception message for broken PathLike objects

2019-02-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +11958

___
Python tracker 

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



[issue35942] posixmodule.c:path_converter() returns an invalid exception message for broken PathLike objects

2019-02-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests:  -11956

___
Python tracker 

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



[issue36026] Different error message when sys.settrace is used

2019-02-19 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



[issue36012] Investigate slow writes to class variables

2019-02-19 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



[issue33944] Deprecate and remove pth files

2019-02-19 Thread STINNER Victor


STINNER Victor  added the comment:

> 3.  I realize that PEPs are needed for any change and even to define what 
> that change might look like, but is there any value in adding 
> PendingDeprecationWarnings for 3.8 if that's a possible action that will 
> happen?  As I understand it, it would be easier to remove that warning later 
> instead of delaying any actions from it.

We cannot modify Python before a PEP is approved. It's too early to see that a 
PEP removing support for .pth file will be approved or not. There are too many 
constraints and use cases.

--

___
Python tracker 

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



[issue1054041] Python doesn't exit with proper resultcode on SIGINT

2019-02-19 Thread STINNER Victor


STINNER Victor  added the comment:

> if (PyOS_setsig(SIGINT, SIG_DFL) == SIG_ERR) {
>perror("signal");  /* Impossible in normal environments. */

In my experience, Python is were impossible things happen. Would it be possible 
to write a better error message to explain what happened?

I expect that if PyOS_setsig() fails, the user cannot do much for that. It may 
be a bug in the libc and so cannot be fixed easily. Maybe we should simply 
ignore the error?

--

___
Python tracker 

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



[issue29515] socket module missing IPPROTO_IPV6, IPPROTO_IPV4 on Windows

2019-02-19 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

@eryksun I tried your patch (https://bugs.python.org/issue29515#msg287477) on 
Windows 10 and it looks good. It introduces the following new constants:

IPPROTO_IGMP
IPPROTO_GGP
IPPROTO_PUP
IPPROTO_IDP
IPPROTO_ND
IPPROTO_MAX
IPPROTO_HOPOPTS
IPPROTO_IPV4
IPPROTO_IPV6
IPPROTO_ROUTING
IPPROTO_FRAGMENT
IPPROTO_ESP
IPPROTO_AH
IPPROTO_ICMPV6
IPPROTO_NONE
IPPROTO_DSTOPTS
IPPROTO_EGP
IPPROTO_PIM
IPPROTO_SCTP

...plus these Windows-only ones for which I had to add an additional 
PyModule_AddIntMacro() call:

IPPROTO_ICLFXBM
IPPROTO_ST
IPPROTO_CBT
IPPROTO_IGP
IPPROTO_RDP
IPPROTO_PGM
IPPROTO_L2TP

Up 'till now only these ones were exposed:

IPPROTO_ICMP
IPPROTO_TCP
IPPROTO_UDP
IPPROTO_RAW

I think we can proceed with this. Care to provide a patch?

--

___
Python tracker 

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



[issue27632] build on AIX fails when builddir != srcdir, more than bad path to ld_so_aix

2019-02-19 Thread Michael Felt


Michael Felt  added the comment:

As far as 'master' is concerned, this has been resolved, so I'll close it 
myself.

--
stage:  -> resolved
status: open -> closed
versions: +Python 3.8 -Python 3.4

___
Python tracker 

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



[issue29757] The loop in utility `socket.create_connection()` swallows previous errors

2019-02-19 Thread STINNER Victor


STINNER Victor  added the comment:

I propose the close the issue as WONTFIX. I don't see how the current behavior 
is an issue.

I expect a very large traceback just because a server is down/reject 
connections. I'm not sure that I want that by default.

> ## The problem
> So currently the loop in `socket.create_connection()` ignores all 
> intermediate errors and reports only the last connection failure, 
which  might be irrelevant.  For instance, when both IPv4 & IPv6 networks are 
supported, usually the last address is a IPv6 address and it frequently fails 
with an irrelevant error - the actual cause have already been ignored.

It's not so hard to reimplement create_connection(): it's a loop on 
getaddrinfo(). So you can decide how to deal with errors.

--

I recall that Yury Selivanov, Nathnaniel Smith and Guido van Rossum discussed 
the idea of "MultiError": an object which contains multiple exceptions, object 
which would render properly all exceptions when a traceback is displayed.

--

___
Python tracker 

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



[issue35773] test_bdb fails on AIX bot (regression)

2019-02-19 Thread Michael Felt


Michael Felt  added the comment:

Again - after switching the env variable LANG to the 'default' everything works 
as expected.

Leaving it open as a regression - because everything was working with a 
non-default setting.

When I have more time I'll do a git bisect to try and establish the change 
where it went wrong.

--

___
Python tracker 

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



[issue36032] Wrong output in tutorial (3.1.2. Strings)

2019-02-19 Thread INADA Naoki


INADA Naoki  added the comment:

@Amit Please confirm docs.python.org before submitting issue.
#33460 fixed it already.

--
nosy: +inada.naoki

___
Python tracker 

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



[issue15248] Better explain "TypeError: 'tuple' object is not callable"

2019-02-19 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11959

___
Python tracker 

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



[issue36032] Wrong output in tutorial (3.1.2. Strings)

2019-02-19 Thread INADA Naoki


INADA Naoki  added the comment:

Uh!  You meant Python 2.7!!
It doesn't make sense to improve Python 2.7 tutorial.
If you're reading Python 2 tutorial, please read 3.7 tutorial instead!!!

--

___
Python tracker 

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



[issue15248] Better explain "TypeError: 'tuple' object is not callable"

2019-02-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 8e79e6e56f516385ccb761e407dfff3a39253180 by Serhiy Storchaka in 
branch 'master':
Fix syntax warnings in tests introduced in bpo-15248. (GH-11932)
https://github.com/python/cpython/commit/8e79e6e56f516385ccb761e407dfff3a39253180


--

___
Python tracker 

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



[issue35942] posixmodule.c:path_converter() returns an invalid exception message for broken PathLike objects

2019-02-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +11961

___
Python tracker 

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



[issue15248] Better explain "TypeError: 'tuple' object is not callable"

2019-02-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +11960

___
Python tracker 

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



[issue35942] posixmodule.c:path_converter() returns an invalid exception message for broken PathLike objects

2019-02-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 8d01eb49fc7ff914feeb2e2090d1d6ef15c932ab by Serhiy Storchaka in 
branch 'master':
Fix syntax warnings in tests introduced in bpo-35942. (GH-11934)
https://github.com/python/cpython/commit/8d01eb49fc7ff914feeb2e2090d1d6ef15c932ab


--

___
Python tracker 

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



[issue35942] posixmodule.c:path_converter() returns an invalid exception message for broken PathLike objects

2019-02-19 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11962

___
Python tracker 

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



[issue36034] Suprise halt caused by -Werror=implicit-function-declaration in ./Modules/posixmodule.c

2019-02-19 Thread Michael Felt


New submission from Michael Felt :

On a system using an older version of gcc (v5.7.4) I get an error: (also AIX 
6.1)

gcc -pthread -Wno-unused-result -Wsign-compare -g -O0 -Wall  -O  
-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter 
-Wno-missing-field-initializers -Werror=implicit-function-declaration  
-I./Include/internal  -I. -I./Include-DPy_BUILD_CORE_BUILTIN  
-DPy_BUILD_CORE -I./Include/internal -c ./Modules/posixmodule.c -o 
Modules/posixmodule.o
./Modules/posixmodule.c: In function 'os_preadv_impl':
./Modules/posixmodule.c:8765:9: error: implicit declaration of function 
'preadv' [-Werror=implicit-function-declaration]
./Modules/posixmodule.c: In function 'os_pwritev_impl':
./Modules/posixmodule.c:9336:9: error: implicit declaration of function 
'pwritev' [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors

On another system - same code base (commit 
e7a4bb554edb72fc6619d23241d59162d06f249a) no "error" status. (AIX 7.2)

Not knowing gcc I have no idea which is correct - maybe they both are because 
the second system (where I am a guest) has an explicit declaration of these 
routines.

Is there a flag I can add to gcc to get the "in-line" pre-processing output so 
I can look for differences with regard to these two functions?

Thanks for hint.

--
messages: 335936
nosy: Michael.Felt
priority: normal
severity: normal
status: open
title: Suprise halt caused by -Werror=implicit-function-declaration in 
./Modules/posixmodule.c
type: compile error
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



[issue36035] pathlib.Path().rglob() breaks with broken symlinks

2019-02-19 Thread Jörg Stucke

New submission from Jörg Stucke :

When using rglob() to iterate over the files of a directory containing a broken 
symlink (a link pointing to itself) rglob breaks with "[Errno 40] Too many 
levels of symbolic links" (OS: Linux).

Steps to reproduce:

mkdir tmp
touch foo
ls -s foo tmp/foo
cd tmp
file foo
foo: broken symbolic link to foo

python3
>>> from pathlib import Path
>>> for f in Path().rglob("*"):
print(x)

foo
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.8/pathlib.py", line 1105, in rglob
for p in selector.select_from(self):
  File "/usr/local/lib/python3.8/pathlib.py", line 552, in _select_from
for starting_point in self._iterate_directories(parent_path, is_dir, 
scandir):
  File "/usr/local/lib/python3.8/pathlib.py", line 536, in _iterate_directories
entry_is_dir = entry.is_dir()
OSError: [Errno 40] Too many levels of symbolic links: './foo'


What is more, stat(), is_dir(), is_file() and exists() also do not like those 
broken links:
>>> Path("foo").is_file()
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.8/pathlib.py", line 1361, in is_file
return S_ISREG(self.stat().st_mode)
  File "/usr/local/lib/python3.8/pathlib.py", line 1151, in stat
return self._accessor.stat(self)
OSError: [Errno 40] Too many levels of symbolic links: 'foo'


Is this intended behaviour or is this a bug? I guess it's not intended, since 
it makes it impossible to iterate over such a directory with rglob(). I could 
not find anything similar in the bug tracker, but 
https://bugs.python.org/issue26012 seems to be related.

Tested with Python 3.8.0a1, 3.6.7 and 3.5.2 (OS: Linux Mint 19)

--
components: Library (Lib)
messages: 335937
nosy: Jörg Stucke
priority: normal
severity: normal
status: open
title: pathlib.Path().rglob() breaks with broken symlinks
type: behavior
versions: Python 3.5, Python 3.6, Python 3.8

___
Python tracker 

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



[issue36034] Suprise halt caused by -Werror=implicit-function-declaration in ./Modules/posixmodule.c

2019-02-19 Thread Michael Felt


Michael Felt  added the comment:

correction - gcc version is v4.7.4

--

___
Python tracker 

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



[issue35942] posixmodule.c:path_converter() returns an invalid exception message for broken PathLike objects

2019-02-19 Thread miss-islington


miss-islington  added the comment:


New changeset a8834905df853510f38d4e2d628bed8229fd7482 by Miss Islington (bot) 
in branch '3.7':
Fix syntax warnings in tests introduced in bpo-35942. (GH-11934)
https://github.com/python/cpython/commit/a8834905df853510f38d4e2d628bed8229fd7482


--

___
Python tracker 

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



[issue36035] pathlib.Path().rglob() breaks with broken symlinks

2019-02-19 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

I confirm this issue with python 3.7

but your script is wrong (you declare f and use x in your script)

/tmp$ mkdir demo
/tmp$ cd demo/
/t/demo$ mkdir tmp  

 /t/demo$ touch foo 

  /t/demo$ ln -s foo tmp/foo

   /t/demo$ cd tmp/ 

/t/d/tmp$ file foo  

 
foo: broken symbolic link to foo

/t/d/tmp$ python3   

 mar 19 fév 2019 13:20:15 CET
Python 3.7.2 (default, Jan 16 2019, 19:49:22) 
[GCC 8.2.1 20181215 (Red Hat 8.2.1-6)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pathlib import Path
>>> for p in Path().rglob('*'):
... print(p)
... 
foo
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib64/python3.7/pathlib.py", line 1105, in rglob
for p in selector.select_from(self):
  File "/usr/lib64/python3.7/pathlib.py", line 552, in _select_from
for starting_point in self._iterate_directories(parent_path, is_dir, 
scandir):
  File "/usr/lib64/python3.7/pathlib.py", line 536, in _iterate_directories
entry_is_dir = entry.is_dir()
OSError: [Errno 40] Too many levels of symbolic links: './foo'
>>>

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



[issue36035] pathlib.Path().rglob() breaks with broken symlinks

2019-02-19 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
nosy: +pitrou

___
Python tracker 

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



[issue36021] [Security][Windows] webbrowser: WindowsDefault uses os.startfile() and so can be abused to run arbitrary commands

2019-02-19 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

@vstinner, all the tests pass on AppVeyor and Travis,

I check if the resource is local (file://) or not, and if the given path is a 
file (c:\\windows\\system32\\calc.exe), I check if this one is an executable.

--

___
Python tracker 

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



[issue36021] [Security][Windows] webbrowser: WindowsDefault uses os.startfile() and so can be abused to run arbitrary commands

2019-02-19 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

After a small test, os.access() on a text file is True, and it's wrong in my 
case.

--

___
Python tracker 

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



[issue31506] Improve the error message logic for object_new & object_init

2019-02-19 Thread Nick Coghlan


Nick Coghlan  added the comment:

Paolo: it still won't be completely clear, since there's still the subtle issue 
that __new__ is a static method rather than a class method, so the correct 
calls up to the base class are respectively:

super(Singleton, cls).__new__(cls) # Static method, cls needs to be passed 
explicitly

super(Singleton, self).__init__() # Bound method, self filled in 
automatically

--

___
Python tracker 

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



[issue36036] Add method to get user defined command line arguments in unittest.main

2019-02-19 Thread Rémi Lapeyre

Change by Rémi Lapeyre :


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



[issue36036] Add method to get user defined command line arguments in unittest.main

2019-02-19 Thread Rémi Lapeyre

New submission from Rémi Lapeyre :

Hi, I'm working on issue 18765 (running pdb.post_mortem() on failing test 
cases) where I need to control the behavior of a TestCase based on some outside 
input.

For this issue, I want to add a new --pdb option to turn this feature on when 
enabled. As of today, it seems to me that the command line arguments given to 
the TestProgram are not accessible from the TestCase.

Would adding a new parameter to TestCase be breaking backward compatibility? If 
so, what would be a better way to access command line arguments from TestCase?



In addition to this, I have the need for another project to change the behavior 
of TestCases based on a custom command line argument. I propose to add a new 
method `getCustomArguments` that will take the parser as input so the user can 
define it's own arguments by subclassing TestProgram

What do you think about this?

--
files: 0001-WIP.patch
keywords: patch
messages: 335944
nosy: remi.lapeyre
priority: normal
severity: normal
status: open
title: Add method to get user defined command line arguments in unittest.main
Added file: https://bugs.python.org/file48154/0001-WIP.patch

___
Python tracker 

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



[issue31506] Improve the error message logic for object_new & object_init

2019-02-19 Thread Nick Coghlan


Nick Coghlan  added the comment:


New changeset 5105483acb3aca318304bed056dcfd7e188fe4b5 by Nick Coghlan (Sanyam 
Khurana) in branch 'master':
bpo-31506: Clarify error messages for object.__new__ and object.__init__ 
(GH-11641)
https://github.com/python/cpython/commit/5105483acb3aca318304bed056dcfd7e188fe4b5


--

___
Python tracker 

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



[issue31506] Improve the error message logic for object_new & object_init

2019-02-19 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11963

___
Python tracker 

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



[issue31506] Improve the error message logic for object_new & object_init

2019-02-19 Thread miss-islington


miss-islington  added the comment:


New changeset 64ca72822338e0ba6e4f14d0a1cd3a9dcfa6c9ac by Miss Islington (bot) 
in branch '3.7':
bpo-31506: Clarify error messages for object.__new__ and object.__init__ 
(GH-11641)
https://github.com/python/cpython/commit/64ca72822338e0ba6e4f14d0a1cd3a9dcfa6c9ac


--
nosy: +miss-islington

___
Python tracker 

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



[issue31506] Improve the error message logic for object_new & object_init

2019-02-19 Thread Nick Coghlan


Nick Coghlan  added the comment:

The revised behaviour now makes the error messages consistent with each other:

>>> class TooManyArgs():
... def __new__(cls):
... super().__new__(cls, 1)
... 
>>> TooManyArgs()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 3, in __new__
TypeError: object.__new__() takes exactly one argument (the type to instantiate)
>>> class NotEnoughArgs():
... def __new__(cls):
... super().__new__()
... 
>>> NotEnoughArgs()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 3, in __new__
TypeError: object.__new__(): not enough arguments
>>> class TooManyInitArgs():
... def __init__(self):
... super().__init__(1, 2, 3)
... 
>>> TooManyInitArgs()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 3, in __init__
TypeError: object.__init__() takes exactly one argument (the instance to 
initialize)
>>> class NotEnoughInitArgs():
... def __init__(self):
... object.__init__()
... 
>>> NotEnoughInitArgs()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 3, in __init__
TypeError: descriptor '__init__' of 'object' object needs an argument

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



[issue36021] [Security][Windows] webbrowser: WindowsDefault uses os.startfile() and so can be abused to run arbitrary commands

2019-02-19 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
nosy: +mdk

___
Python tracker 

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



[issue36021] [Security][Windows] webbrowser: WindowsDefault uses os.startfile() and so can be abused to run arbitrary commands

2019-02-19 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

@vstinner

Could we imagine to create a whitelist just for the html file?

like that, we could open an html file and reject an executable file.

--

___
Python tracker 

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



[issue35925] test_httplib test_nntplib test_ssl fail on ARMv7 Debian buster bot (OpenSSL 1.1.1a)

2019-02-19 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

Getting those failures on RHEL8 as well, which can be worked around by setting 
the env OPENSSL_CONF=/non-existing-file


==
ERROR: test_protocol_sslv23 (test.test_ssl.ThreadedTests)
Connecting to an SSLv23 server with various client options
--
Traceback (most recent call last):
  File "/root/cpython/_install/lib/python2.7/test/test_ssl.py", line 2370, in 
test_protocol_sslv23
try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1, 'TLSv1')
  File "/root/cpython/_install/lib/python2.7/test/test_ssl.py", line 2103, in 
try_protocol_combo
chatty=False, connectionchatty=False)
  File "/root/cpython/_install/lib/python2.7/test/test_ssl.py", line 2031, in 
server_params_test
s.connect((HOST, server.port))
  File "/root/cpython/_install/lib/python2.7/ssl.py", line 864, in connect
self._real_connect(addr, False)
  File "/root/cpython/_install/lib/python2.7/ssl.py", line 855, in _real_connect
self.do_handshake()
  File "/root/cpython/_install/lib/python2.7/ssl.py", line 828, in do_handshake
self._sslobj.do_handshake()
SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version 
(_ssl.c:727)

==
ERROR: test_protocol_tlsv1_1 (test.test_ssl.ThreadedTests)
Connecting to a TLSv1.1 server with various client options.
--
Traceback (most recent call last):
  File "/root/cpython/_install/lib/python2.7/test/test_ssl.py", line 2444, in 
test_protocol_tlsv1_1
try_protocol_combo(ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1_1, 'TLSv1.1')
  File "/root/cpython/_install/lib/python2.7/test/test_ssl.py", line 2103, in 
try_protocol_combo
chatty=False, connectionchatty=False)
  File "/root/cpython/_install/lib/python2.7/test/test_ssl.py", line 2031, in 
server_params_test
s.connect((HOST, server.port))
  File "/root/cpython/_install/lib/python2.7/ssl.py", line 864, in connect
self._real_connect(addr, False)
  File "/root/cpython/_install/lib/python2.7/ssl.py", line 855, in _real_connect
self.do_handshake()
  File "/root/cpython/_install/lib/python2.7/ssl.py", line 828, in do_handshake
self._sslobj.do_handshake()
SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version 
(_ssl.c:727)

--
nosy: +cstratak

___
Python tracker 

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



[issue36037] test_ssl fails on RHEL8 strict OpenSSL configuration

2019-02-19 Thread STINNER Victor


New submission from STINNER Victor :

RHEL8 uses a strict crypto policy by default. For example, SSLContext uses TLS 
1.2 as the minimum version by default.

Attached PR fix test_ssl for RHEL8. The PR is not specific to RHEL8. It should 
also fix test_ssl on Debian: see bpo-35925 and bpo-36005.

test_ssl failures on RHEL8:

==
ERROR: test_PROTOCOL_TLS (test.test_ssl.ThreadedTests)
Connecting to an SSLv23 server with various client options
--
Traceback (most recent call last):
  File "/root/cpython-master/Lib/test/test_ssl.py", line 3079, in 
test_PROTOCOL_TLS
try_protocol_combo(ssl.PROTOCOL_TLS, ssl.PROTOCOL_TLSv1, 'TLSv1')
  File "/root/cpython-master/Lib/test/test_ssl.py", line 2623, in 
try_protocol_combo
stats = server_params_test(client_context, server_context,
  File "/root/cpython-master/Lib/test/test_ssl.py", line 2549, in 
server_params_test
s.connect((HOST, server.port))
  File "/root/cpython-master/Lib/ssl.py", line 1150, in connect
self._real_connect(addr, False)
  File "/root/cpython-master/Lib/ssl.py", line 1141, in _real_connect
self.do_handshake()
  File "/root/cpython-master/Lib/ssl.py", line 1117, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version 
(_ssl.c:1055)

==
ERROR: test_protocol_tlsv1_1 (test.test_ssl.ThreadedTests)
Connecting to a TLSv1.1 server with various client options.
--
Traceback (most recent call last):
  File "/root/cpython-master/Lib/test/test_ssl.py", line 3150, in 
test_protocol_tlsv1_1
try_protocol_combo(ssl.PROTOCOL_TLS, ssl.PROTOCOL_TLSv1_1, 'TLSv1.1')
  File "/root/cpython-master/Lib/test/test_ssl.py", line 2623, in 
try_protocol_combo
stats = server_params_test(client_context, server_context,
  File "/root/cpython-master/Lib/test/test_ssl.py", line 2549, in 
server_params_test
s.connect((HOST, server.port))
  File "/root/cpython-master/Lib/ssl.py", line 1150, in connect
self._real_connect(addr, False)
  File "/root/cpython-master/Lib/ssl.py", line 1141, in _real_connect
self.do_handshake()
  File "/root/cpython-master/Lib/ssl.py", line 1117, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version 
(_ssl.c:1055)

==
FAIL: test_min_max_version (test.test_ssl.ContextTests)
--
Traceback (most recent call last):
  File "/root/cpython-master/Lib/test/test_ssl.py", line 1093, in 
test_min_max_version
self.assertIn(
AssertionError:  not found in {, }

--

Ran 150 tests in 3.318s

FAILED (failures=1, errors=2, skipped=9)

--
assignee: christian.heimes
components: SSL, Tests
messages: 335950
nosy: christian.heimes, vstinner
priority: normal
severity: normal
status: open
title: test_ssl fails on RHEL8 strict OpenSSL configuration
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



[issue36037] test_ssl fails on RHEL8 strict OpenSSL configuration

2019-02-19 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue36037] test_ssl fails on RHEL8 strict OpenSSL configuration

2019-02-19 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +cstratak, gregory.p.smith

___
Python tracker 

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



[issue36037] test_ssl fails on RHEL8 strict OpenSSL configuration

2019-02-19 Thread STINNER Victor


STINNER Victor  added the comment:

On Python 2.7.16rc, similar tests are failing on RHEL8:

ERROR: test_protocol_sslv23 (test.test_ssl.ThreadedTests)
ERROR: test_protocol_tlsv1_1 (test.test_ssl.ThreadedTests)

... But right now, Python 2.7 doesn't give access to 
minimum_version/maximum_version :-( Not even to read these versions. So I'm not 
sure how to skip or fix these tests, without backporting code for these 
attributes.

--

___
Python tracker 

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



[issue36027] Consider adding modular multiplicative inverse to the math module

2019-02-19 Thread Berry Schoenmakers


Berry Schoenmakers  added the comment:

Agreed, extending pow(value, n, modulus) to negative n would be a great 
addition!

To have modinv(value, modulus) next to that also makes a lot of sense to me, as 
this would avoid lots of confusion among users who are not so experienced with 
modular arithmetic. I know from working with generations of students and 
programmers how easy it is to make mistakes here (including lots of mistakes 
that I made myself;)

One would implement pow() for negative n, anyway, by first computing the 
modular inverse and then raising it to the power -n. So, to expose the modinv() 
function to the outside world won't cost much effort.

Modular powers, in particular, are often very confusing. Like for a prime 
modulus p, all of pow(a, -1,p), pow(a, p-2, p), pow(a, -p, p) are equal to 
eachother, but a common mistake is to take pow(a, p-1, p) instead. For a 
composite modulus things get much trickier still, as the exponent is then 
reduced in terms of the Euler phi function. 

And, even if you are not confused by these things, it's still a bit subtle that 
you have to use pow(a, -1,p) instead of pow(a, p-2, p) to let the modular 
inverse be computed efficiently. With modinv() available separately, one would 
expect --and get-- an efficient implementation with minimal overhead (e.g., not 
implemented via a complete extended-gcd).

--
nosy: +lschoe

___
Python tracker 

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



[issue36038] ^ used in inaccurate example in regex-howto

2019-02-19 Thread Louis Michael


New submission from Louis Michael :

at https://docs.python.org/3/howto/regex.html#regex-howto
and
https://docs.python.org/3.8/howto/regex.html#regex-howto
https://docs.python.org/3.7/howto/regex.html#regex-howto
https://docs.python.org/3.6/howto/regex.html#regex-howto
https://docs.python.org/3.5/howto/regex.html#regex-howto
https://docs.python.org/3.4/howto/regex.html#regex-howto
https://docs.python.org/2.7/howto/regex.html#regex-howto

The following paragraph seems to have a small issue:
"
You can match the characters not listed within the class by complementing the 
set. This is indicated by including a '^' as the first character of the class; 
'^' outside a character class will simply match the '^' character. For example, 
[^5] will match any character except '5'.
"
^ does not simply match ^ outside a character class since is a special 
character that represents the start of the string. 

I think the paragraph should read: 
You can match the characters not listed within the class by complementing the 
set. This is indicated by including a '^' as the first character of the class; 
'^' will act differently outside a character class as explained later. For 
example, [^5] will match any character except '5'.

--
assignee: docs@python
components: Documentation
messages: 335953
nosy: docs@python, eric.araujo, ezio.melotti, louism, mdk, willingc
priority: normal
severity: normal
status: open
title: ^ used in inaccurate example in regex-howto
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



[issue35126] Mistake in FAQ about converting number to string.

2019-02-19 Thread Cheryl Sabella


Change by Cheryl Sabella :


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



[issue36021] [Security][Windows] webbrowser: WindowsDefault uses os.startfile() and so can be abused to run arbitrary commands

2019-02-19 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

@vstinner

I have a whitelist where the HTML files (.html, .html, .dhtml, .xhtml, ...) are 
allowed. For the rest, I do not execute os.startfile()

--

___
Python tracker 

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



[issue36037] test_ssl fails on RHEL8 strict OpenSSL configuration

2019-02-19 Thread STINNER Victor


STINNER Victor  added the comment:

> RHEL8 uses a strict crypto policy by default. For example, SSLContext uses 
> TLS 1.2 as the minimum version by default.

Ah, I forgot to mention that a workaround is to use OPENSSL_CONF=/ environment 
variable to ignore RHEL crypto policy (don't load system OpenSSL configuration).

--

___
Python tracker 

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



[issue36027] Consider adding modular multiplicative inverse to the math module

2019-02-19 Thread Mark Dickinson


Mark Dickinson  added the comment:

> it's still a bit subtle that you have to use pow(a, -1,p) instead of pow(a, 
> p-2, p) to let the modular inverse be computed efficiently

That's not 100% clear: the binary powering algorithm used to compute `pow(a, 
p-2, p)` is fairly efficient; the extended gcd algorithm used to compute the 
inverse may or may not end up being comparable. I certainly wouldn't be 
surprised to see `pow(a, p-2, p)` beat a pure Python xgcd for computing the 
inverse.

--

___
Python tracker 

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



[issue36021] [Security][Windows] webbrowser: WindowsDefault uses os.startfile() and so can be abused to run arbitrary commands

2019-02-19 Thread STINNER Victor


STINNER Victor  added the comment:

Parsing an URL and deciding if an URL is "safe" or not is hard.

For example, PR 11931 denies "file://" URLs, but I don't see the issue with 
opening such URL:
file:///home/vstinner/prog/GIT/github.io/output/index.html
(local path to a HTML file)

The problem here is that os.startfile() can be abused to run arbitrary command.

Another option would be to behave as Unix classes: run directly as specific 
browser like Chrome or Firefox.

Maybe the registry can help? I found interesting keys:

"HKEY_CURRENT_USER\Software\Classes\BSURL\shell\open\command"
"HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice\Progid"
"HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice\Progid"
"HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\ftp\UserChoice\Progid"
"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.htm\UserChoice\Progid"
"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\UserChoice\Progid"
"HKEY_CURRENT_USER\Software\Clients\StartmenuInternet\"

--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue36019] test_urllib fail in s390x buildbots: http://www.example.com/

2019-02-19 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

ok for me if you prefer to use a function test with pythontest.net

--

___
Python tracker 

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



[issue36021] [Security][Windows] webbrowser: WindowsDefault uses os.startfile() and so can be abused to run arbitrary commands

2019-02-19 Thread STINNER Victor


STINNER Victor  added the comment:

PR 11931 experimented other tests:

 return os.path.isfile(path) and os.access(path, os.X_OK)

and:

is_exe = False
with open(path, 'rb') as fp:
s = fp.read(2)
is_exe = s != b'MZ'
 return os.path.isfile(path) and is_exe

I'm not sure that it's safe. Windows support a wide range of programs: .COM, 
.EXE, .VBS, .BAT, etc. It's hard to get a complete list.

--

___
Python tracker 

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



[issue36033] logging.makeLogRecord should update "rv" using a dict defined with bytes instead of strings

2019-02-19 Thread SilentGhost


Change by SilentGhost :


--
components: +Library (Lib)
nosy: +vinay.sajip

___
Python tracker 

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



[issue34053] Support localization of unicode descriptions

2019-02-19 Thread Pander


Pander  added the comment:

As discussed on python-ideas, created scripts at 
https://github.com/OpenTaal/python-unicodedata_l10n that provide a starting 
point.

--

___
Python tracker 

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



[issue36039] Replace append loops with list comprehensions

2019-02-19 Thread Lukas Geiger

New submission from Lukas Geiger :

Lib uses loops to append to a new list in quite a few places. I think it would 
be better to replace those with list comprehensions.

Benefits of this change:
  - List comprehensions are generally more readable than appending to a newly 
created list
  - List comprehensions are also a lot faster.
Toy example:
In [1]: %%timeit
   ...: l = []
   ...: for i in range(5000):
   ...: l.append(i)
375 µs ± 1.73 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)

In [2]: %%timeit
   ...: l = [i for i in range(5000)]
168 µs ± 1.08 µs per loop (mean ± std. dev. of 7 runs, 1 loops each)

Possible drawbacks:
  - Refactoring can always introduce bugs and makes it harder to get meaningful 
output from git blame. In this case I think the diff is very manageable, making 
the changes easy to review.

Personally, I think the codebase would benefit from this change both in terms 
of some small performance gains and maintainability. I'd be happy to make a PR 
to fix this.

--
components: Library (Lib)
messages: 335961
nosy: lgeiger
priority: normal
severity: normal
status: open
title: Replace append loops with list comprehensions
type: performance
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



[issue36039] Replace append loops with list comprehensions

2019-02-19 Thread Paul Ganssle


Paul Ganssle  added the comment:

I think I'm -1 on a general project or policy to replace all for-append loops 
with list comprehensions, but I'm generally positive about individual 
improvements to the code base, on a case-by-case basis.

I can't speak for anyone but myself, but I imagine that if you can identify a 
few places where this sort of change would make a significant performance 
improvement, it would be well-received.

--
nosy: +p-ganssle

___
Python tracker 

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



[issue36019] test_urllib fail in s390x buildbots: http://www.example.com/

2019-02-19 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Here is the list of the external resources that we use in the tests.

test_issue16464 (test.test_urllib2.MiscTests) ... skipped "Resource 
'http://www.example.com/' is not available"
test_close (test.test_urllib2net.CloseSocketTest) ... skipped "Resource 
'http://www.example.com/' is not available"
test_custom_headers (test.test_urllib2net.OtherNetworkTests) ... skipped 
"Resource 'http://www.example.com' is not available"
test_sites_no_connection_close (test.test_urllib2net.OtherNetworkTests) ... 
skipped 'XXX: http://www.imdb.com is gone'
test_http_basic (test.test_urllib2net.TimeoutTest) ... skipped "Resource 
'http://www.example.com' is not available"
test_http_default_timeout (test.test_urllib2net.TimeoutTest) ... skipped 
"Resource 'http://www.example.com' is not available"
test_http_no_timeout (test.test_urllib2net.TimeoutTest) ... skipped "Resource 
'http://www.example.com' is not available"
test_http_timeout (test.test_urllib2net.TimeoutTest) ... skipped "Resource 
'http://www.example.com' is not available"

in the failed tests:
test_urllib2 test_urllib2net test_urllibnet

--

___
Python tracker 

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



[issue36037] test_ssl fails on RHEL8 strict OpenSSL configuration

2019-02-19 Thread STINNER Victor


STINNER Victor  added the comment:

Python 2.7 and 3.6 have no SSLContext.minimum_version attribute (even with 
OpenSSL 1.1.1). I think that we will workaround this issue in Fedora and RHEL8 
spec file (recipe to build RPM packages) using "export 
OPENSSL_CONF=/non-existing-file".

--

___
Python tracker 

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



[issue35153] Allow to set headers in xmlrpc.client.ServerProxy

2019-02-19 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset beda52ed36e701e45f22903fc4d3bec0d085b25b by Victor Stinner 
(Cédric Krier) in branch 'master':
bpo-35153: Add headers parameter to xmlrpc.client.ServerProxy (GH-10308)
https://github.com/python/cpython/commit/beda52ed36e701e45f22903fc4d3bec0d085b25b


--
nosy: +vstinner

___
Python tracker 

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



[issue36035] pathlib.Path().rglob() breaks with broken symlinks

2019-02-19 Thread Jörg Stucke

Jörg Stucke  added the comment:

A possible solution for python 3.7+ could be to add "ELOOP" to _IGNORED_ERROS 
in pathlib but I'm not exactly sure of the side effects.

--

___
Python tracker 

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



  1   2   3   >