[issue35369] List sorting makes duplicate comparisons

2018-11-30 Thread Tim Peters


Tim Peters  added the comment:

Yup, it can do some redundant comparisons; more on that here:

https://mail.python.org/pipermail/python-dev/2018-August/155020.html

I'm not inclined to make this already-difficult code even harder to understand 
for something that's quite likely not to matter - or even hurt.  For example, 
if we're sorting a million randomly ordered objects, we can expect about 20 
million comparisons.  9,800 is so close to zero compared to that it wouldn't be 
a measurable difference even if the new code came for free - which it doesn't.

It adds whole new piles of tests/branches, which will almost certainly be 
mis-predicted on the first iteration of the outer loop because they always fail 
the "initial" part on iterations after the first.  At best, they're cheap but 
pure do-nothing overhead on outer-loop iterations after the first.

I also dislike that binarysort grows a pile of undocumented assumptions about 
the _context_ it's called in.  As is, it can be used to sort any slice meeting 
the requirements spelled out in the comments.  "Leaking" requirements across 
function boundaries is fragile.

Note that this part:

else IFLT(pivot, *p) {
r = p;
}
else {
l = p + 1;
}

doesn't work at all the way it "looks like" it works.  It expands to:

else if ((k = ISLT(pivot, *p)) < 0) goto fail;
if (k) {
r = p:
}
else {
l = p + 1;
}

The

r = p;

and

l = p + 1;

lines you added above in your new code are useless, because this final "if (k)" 
block executes regardless of whether `initial` is true or false.  Indeed, if 
you hadn't _also_ added new code to set `k` to 0 or 1, the code would be wrong. 
 But that's impossible to see without expanding the macro.

So if you pursue this, at least rewrite that block as:

else {
IFLT(pivot, *p) {
r = p;
else {
l = p + 1;
}
}

and remove the new "k = 1;" and "k = 0;" mystery lines.

But unless there are real-world cases that show significant speedups, I'm - as 
I said in the message I linked to above - happy with the tradeoffs already in 
place.

--

___
Python tracker 

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



[issue33130] functools.reduce signature uses `iterable`, documentation should use the same term

2018-11-30 Thread Ben Finney


Ben Finney  added the comment:

Hah, sorry to use a local-filesystem URL. (Hooray for locally-installed 
developer documentation!)

The same section is online at 
https://docs.python.org/3/library/functools.html#functools.reduce .

--

___
Python tracker 

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



[issue33130] functools.reduce signature uses `iterable`, documentation should use the same term

2018-11-30 Thread Ben Finney


Ben Finney  added the comment:

The library documentation (e.g. 
file:///usr/share/doc/python3/html/library/functools.html#functools.reduce ) 
also has this dissonance:

>  functools.reduce(`function`, `iterable` [, `initializer` ])
>
>Apply function of two arguments cumulatively to the items of `sequence`, 
> from left to right, so as to reduce the sequence to a single value.

--
nosy: +bignose
title: functools.reduce signature/docstring discordance -> functools.reduce 
signature uses `iterable`, documentation should use the same term

___
Python tracker 

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



[issue35354] Generator functions stack overflow

2018-11-30 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Brett, the user had an invalid email address in their profile thus adding 
comments to the issue caused a server error while sending notification to them. 
So they have been removed from the issue. Please see : 
https://python.zulipchat.com/#narrow/stream/116501-workflow/subject/Is.20adding.20comment.20in.20bpo.20broken.20for.20anyone.3F/near/148846056

As for the issue OP attached a reproducer where they produce NameError with the 
"new" variable which is not defined in the try block and catch the exception to 
make recursive calls in https://bugs.python.org/file47958/crash.py

--

___
Python tracker 

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



[issue35369] List sorting makes duplicate comparisons

2018-11-30 Thread David Wyde


Change by David Wyde :


Added file: https://bugs.python.org/file47963/sort.py

___
Python tracker 

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



[issue35369] List sorting makes duplicate comparisons

2018-11-30 Thread David Wyde


New submission from David Wyde :

Python's Timsort sometimes makes the same comparison twice. This leads to extra 
compares, which can hurt performance.

Python sorts several length-3 permutations in 4 steps, and the problem 
accumulates with bigger data. There are ~9,800 duplicate less-than checks when 
sorting a million randomly ordered numbers, and 24,386 wasted comparisons when 
sorting all permutations of length 8.

I've attached a patch to fix this issue. Feedback and improvements are 
appreciated. Speed seems roughly comparable, and should be much improved for 
expensive comparison functions.

The same problem occurs in the Chromium Browser, and probably other ports of 
Python's Timsort implementation.

--
files: sort-fix.diff
keywords: patch
messages: 330839
nosy: dwyde, tim.peters
priority: normal
severity: normal
status: open
title: List sorting makes duplicate comparisons
type: performance
versions: Python 3.8
Added file: https://bugs.python.org/file47962/sort-fix.diff

___
Python tracker 

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



[issue34850] Emit a syntax warning for "is" with a literal

2018-11-30 Thread Nathaniel Smith


Nathaniel Smith  added the comment:

> In my experience people are more likely to run code through a linter than 
> they are to ever run an interpreter with DeprecationWarning enabled.

This used to be true, and it was a disaster. So there's been a lot of work to 
fix it, and it's not true anymore.

Starting in 3.7, the built-in REPL has DeprecationWarning enabled by default, 
as do all standalone scripts (see PEP 565).

IPython/Jupyter has enabled DeprecationWarning by default for interactive code 
for about 3 years now: https://github.com/ipython/ipython/issues/8478

pytest started showing DeprecationWarnings by default a few months ago, and 
unittest has done so for ages.

I don't think I've ever met someone who skipped straight to linting, without 
ever having used a REPL, or written a script, or written a test :-)

--

___
Python tracker 

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



[issue34850] Emit a syntax warning for "is" with a literal

2018-11-30 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

I'm actually fine either way.  Consider me a solid ±0

--

___
Python tracker 

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



[issue34850] Emit a syntax warning for "is" with a literal

2018-11-30 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Looks like we have a stand-off between core devs, and no BDFL to make a ruling.

There is support for the feature from at least Barry and Raymond  (although I 
think Guido was cool on the idea, maybe?). Gregory, do you feel strongly enough 
about this that you would reverse the commit if Serhiy just went ahead and 
committed it? Nobody wants a revert war :-)

To me, this seems like a low-cost feature that will help some developers 
without inconveniencing anyone. As Serhiy points out, SyntaxWarning is only 
emitted when the code is compiled, so it is only going to be visible to the 
developer of the module, not the user of the module.

Let's not allow the perfect be the enemy of the good enough. I think this is a 
helpful feature for developers, and as Raymond says it will help teach 
beginners the difference between `is` and equality. The people who are most 
prone to making this mistake are the ones least likely to be using a linter. 
And we know it is helpful: Serhiy already used it to find a bug in IDLE.

Gregory, you wanted to close this as not a bug, but nobody says it is a bug, it 
is an enhancement. And I think there is consensus that this *is* an 
enhancement. Nobody has said that there are good use cases for using `is` on 
literals in production code.

--

___
Python tracker 

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



[issue34850] Emit a syntax warning for "is" with a literal

2018-11-30 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

Given that linters like pylint can already detect the common case of this issue 
when using `is` and `is not` to compare to a literal where == or != seems more 
appropriate, I don't think a warning is very useful.

In my experience people are more likely to run code through a linter than they 
are to ever run an interpreter with DeprecationWarning enabled.

I do like the concept of using a not visible by default warning, but I don't 
think adding a LintWarning or misusing DeprecationWarning adds much value.

I suggest closing this issue as won't fix / not a bug.

--

___
Python tracker 

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



[issue33015] Fix function cast warning in thread_pthread.h

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:

> I don't think it is crazy for 2.7, but I'd move that to its own issue as you 
> already nicely addressed the problem related to this PR without needing that.

Good idea. I created bpo-35368. I close this issue since it's now fixed.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue35368] [2.7] Make PyMem_Malloc() thread-safe in debug mode

2018-11-30 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue35368] [2.7] Make PyMem_Malloc() thread-safe in debug mode

2018-11-30 Thread STINNER Victor


New submission from STINNER Victor :

While fixing bpo-33015, I discovered that PyMem_Malloc() isn't thread-safe when 
Python is compiled in debug mode:
https://bugs.python.org/issue33015#msg330806

I wrote PR 10828 to make PyMem_Malloc() thread-safe when Python is compiled in 
debug mode.

--
components: Interpreter Core
messages: 330833
nosy: gregory.p.smith, vstinner
priority: normal
severity: normal
status: open
title: [2.7] Make PyMem_Malloc() thread-safe in debug mode
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



[issue33015] Fix function cast warning in thread_pthread.h

2018-11-30 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

I don't think it is crazy for 2.7, but I'd move that to its own issue as you 
already nicely addressed the problem related to this PR without needing that.

--

___
Python tracker 

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



[issue34850] Emit a syntax warning for "is" with a literal

2018-11-30 Thread Nathaniel Smith


Nathaniel Smith  added the comment:

Would it be more acceptable to use a DeprecationWarning? It's not really the 
right thing because we're not planning to ever actually remove the 
functionality. But, we've already gone to a lot of trouble to try to show 
DeprecationWarnings specifically to devs and not end users (hiding them by 
default, except if the source was the REPL or a test, getting patches into 
every test framework to handle this, etc.). And the issues here seem to be 
identical.

Or maybe LintWarning inherits from DeprecationWarning? Or the share a common 
superclass?

--

___
Python tracker 

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



[issue33015] Fix function cast warning in thread_pthread.h

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:

> why was that only an issue on 2.7?

I added PyMem_RawMalloc() to Python 3.4 and this function must be thread-safe.

https://docs.python.org/dev/c-api/memory.html#raw-memory-interface
"These functions are thread-safe, the GIL does not need to be held."

I replaced PyMem_RawMalloc() with PyMem_Malloc() when I backported the change, 
but I didn't know that PyMem_Malloc() isn't thread-safe *in debug mode*!

Gregory: do you think that it would be be crazy to fix PyMem_Malloc() to make 
it thread-safe in debug mode as well? I implemented a fix: PR 10828.

--

___
Python tracker 

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



[issue33015] Fix function cast warning in thread_pthread.h

2018-11-30 Thread Gregory P. Smith


Gregory P. Smith  added the comment:

why was that only an issue on 2.7?

--

___
Python tracker 

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



[issue35352] test_asyncio fails on RHEL8, or on Fedora using NEXT security policy

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:

I tested on Fedora 29 using:

   sudo update-crypto-policies --set NEXT

With this config, I was able to reproduce the test_asyncio failure on 3.6, 3.7 
and master branches.

I confirm that the commits fixed test_asyncio in these 3 branches. Thanks 
Charalampos Stratakis!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
title: test_asyncio fails on RHEL8 -> test_asyncio fails on RHEL8, or on Fedora 
using NEXT security policy

___
Python tracker 

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



[issue34850] Emit a syntax warning for "is" with a literal

2018-11-30 Thread Guido van Rossum


Change by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue29657] os.symlink: FileExistsError shows wrong message

2018-11-30 Thread Rich Jones


Rich Jones  added the comment:

@Larry - that would be an acceptable solution!

I'm here because I encountered this error independently. I explain why the  
arrow is a problem here: https://bugs.python.org/issue35367

The issue is that the '->' notation is already used by the standard operating 
system utilities in this context, so for Python overload this semantically in 
this case is the source of all the confusion.

It would avoid the scare that we've all encountered if it just said 'src'/'dst' 
rather than '->'.

Thanks!
R

--
nosy: +miserlou

___
Python tracker 

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



[issue35365] Use wchar_t* buffer instead of Unicode object in code page decoder

2018-11-30 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue31177] unittest mock's reset_mock throws an error when an attribute has been deleted

2018-11-30 Thread Eli_B


Change by Eli_B :


--
pull_requests: +10074

___
Python tracker 

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



[issue35367] FileExistsError During os.symlink() Displays Arrow in the Wrong Direction

2018-11-30 Thread Eryk Sun


Change by Eryk Sun :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> os.symlink: FileExistsError shows wrong message

___
Python tracker 

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



[issue35367] FileExistsError During os.symlink() Displays Arrow in the Wrong Direction

2018-11-30 Thread Rich Jones


New submission from Rich Jones :

If I try to create a symlink which already exists, I get a FileExistsError. In 
this error message, the explanatory arrow is pointing in the wrong direction. 
This gave us a big scare in our logs!

Example:

```
$ ls
HELLO.txt
$ python3
Python 3.7.0 (default, Jul 23 2018, 20:22:55)
[Clang 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.symlink('HELLO.txt', 'GOODBYE.txt')
$ ls -lah *
lrwxr-xr-x  1 rjones  staff 9B Nov 30 15:36 GOODBYE.txt -> HELLO.txt
-rw-r--r--  1 rjones  staff 4B Nov 30 15:34 HELLO.txt
$ python3
Python 3.7.0 (default, Jul 23 2018, 20:22:55)
[Clang 9.1.0 (clang-902.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.symlink('HELLO.txt', 'GOODBYE.txt')
Traceback (most recent call last):
  File "", line 1, in 
FileExistsError: [Errno 17] File exists: 'HELLO.txt' -> 'GOODBYE.txt'
```

Notice that the arrow in the error message is pointing from HELLO to GOODBYE, 
but if you if you look at the `ls` output, it is pointing from GOODBYE to 
HELLO, which is the correct behavior.

The Python3 error message should be changed to reflect the correct direction of 
the symlink. 

This is a Python3 only bug, as the paths aren't displayed in Python2.

I can PR if this is accepted as a bug.

Thanks!
Rich

--
components: Library (Lib)
messages: 330826
nosy: miserlou
priority: normal
severity: normal
status: open
title: FileExistsError During os.symlink() Displays Arrow in the Wrong Direction
type: behavior
versions: 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



[issue34850] Emit a syntax warning for "is" with a literal

2018-11-30 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I like this proposal better than a separate test mode.  But users will see 
compiler warnings for main modules and for packages recompiled for a new 
version or for a maintenance releases with a byte code bump, and for 
unprecompiled packages on systems that do not allow .pyc caching.

The first will not matter for packages with minimal main modules.  Recompiles 
will be rare.  I suspect that the 3rd possibility is also rare.

--

___
Python tracker 

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



[issue35354] Generator functions stack overflow

2018-11-30 Thread Brett Cannon


Brett Cannon  added the comment:

How did you make a recursive generator? The 'yield' would have paused 
execution. Do you have code you can share to reproduce? Otherwise blowing your 
stack out is normal behaviour in a function which you can deal with by lowering 
your stack depth with sys.setrecursionlimit() to one that will raise 
RecursionError before you blow your stack.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue34867] Add mode to disable small integer and interned string caches

2018-11-30 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Steven, thank you for splitting this off for proper discussion.

To me, the base issue is that CPython is both the language reference 
implementation and, as yet, the main production implementation.  As the latter, 
it has unintended and unwanted bugs and intentional optimizations added for 
performance rather than language conformance.  Some of these, like caching, 
affect boolean results involving 'is' and id().  Problems arise when people 
confuse reference features with implementation features.

This issue proposes adding a mode that turns off certain optimization features. 
 There is another proposal to turn off other optimizations (again during code 
analysis and testing) that affect tracing results and sometimes coverage 
results based thereon, giving false negatives.  In either case, I see the 
result as a 'language reference' mode.  As Steven suggested, the result is in a 
sense less chaotic, not more.  A chaos mode for caching would randomly cache or 
not.

Multiple comments above contain 'bug'.  Given that the language leaves 
implementations to cache certain immutables -- or not -- the bug in code meant 
to be implementation independent is to depend on caching *either way*.  Turning 
caching off only catches the 'bug' of assuming caching, not the bug of assuming 
no caching.

>From a math viewpoint, n is n for all n, so 'is' *is* the proper comparison 
>for ints.  From this viewpoint, caching should be the default and having not 
>caching most values of n, and having to use '==' instead of 'is', is the 
>practice time-space tradeoff compromise.  

Like Raymond, I currently think that this proposal lacks sufficient 
justification.

--
nosy: +terry.reedy
type:  -> enhancement

___
Python tracker 

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



[issue35366] Monkey Patching class derived from ctypes.Union doesn't work

2018-11-30 Thread Martijn Pieters


Martijn Pieters  added the comment:

This is a repeat of old-tracker issue 1700288, see 
https://github.com/python/cpython/commit/08ccf202e606a08f4ef85df9a9c0d07e1ba1#diff-998bfefaefe2ab83d5f523e18f158fa4,
 which fixed this for StructType_setattro but failed to do the same for 
UnionType_setattro

--
nosy: +mjpieters

___
Python tracker 

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



[issue35358] Document that importlib.import_module accepts names that are not valid Python syntax

2018-11-30 Thread Brett Cannon


Brett Cannon  added the comment:

I agree that this shouldn't change and at best can be a documentation update to 
mention the fact that importlib.import_module() doesn't restrict itself to 
valid syntax names on purpose.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python
priority: normal -> low
title: avoid '-' in importlib.import_module and builtins.__import__ -> Document 
that importlib.import_module accepts names that are not valid Python syntax

___
Python tracker 

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



[issue35352] test_asyncio fails on RHEL8

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:

I leave the issue open until someone validates manually that the issue os fixed 
in all branches with stricter security (ex: RHEL8).

--

___
Python tracker 

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



[issue35352] test_asyncio fails on RHEL8

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 02250e57c37339ea6de08ab077a307e75eef02f5 by Victor Stinner in 
branch '3.6':
bpo-35352: test_asyncio uses the certificate set from the test directory 
(GH-10826) (GH-10832)
https://github.com/python/cpython/commit/02250e57c37339ea6de08ab077a307e75eef02f5


--

___
Python tracker 

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



[issue35352] test_asyncio fails on RHEL8

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 38bed786a219c65d5a51c7ef4ffd97e12653a095 by Victor Stinner in 
branch '3.7':
[3.7] bpo-35352: test_asyncio uses the certificate set from the test directory 
(GH-10826) (GH-10834)
https://github.com/python/cpython/commit/38bed786a219c65d5a51c7ef4ffd97e12653a095


--

___
Python tracker 

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



[issue35366] Monkey Patching class derived from ctypes.Union doesn't work

2018-11-30 Thread Vijay


New submission from Vijay :

I am trying to "monkey patch" a class derived from Python ctypes "Union", but I 
am unable to do so - getting weird errors and sometimes seg-faults. The same 
thing works quite well when deriving from ctypes "Structure".

I have narrowed this to down to the simplest possible test case which I am 
posting below. I am using Python 3.6.4. I am wondering if I am doing something 
wrong (or is there a problem with the ctypes "Union" implementation?). 

The example python code is attached with this issue.

Please see the output below (for the attached code in Python 3.6.4).

Using Structure:

Print Type #1: [ 10, 20 ]
Original : 
Patched : 
Patched (dict) : 
Print Type #2: ( 10, 20 )
Using Union:

Print Type #1: [ 20, 20 ]
Original : 
Patched : 
Patched (dict) : 
Traceback (most recent call last):
  File "ctypes_bug.py", line 54, in 
print(a)
TypeError: 'managedbuffer' object is not callable

Clearly, I am able to "patch" __str__ when the corresponding Python object was 
derived from "Structure", but I am unable to "patch" __str__ when the 
corresponding Python object was derived from "Union".

Interestingly, MyUnion.__dict__[__str__] and MyUnion.__str__ shows different 
results - which is weird as well.

Is there something I am doing wrong here, or is there an issue with 
ctypes.Union? I highly appreciate any help or insight!

--
components: ctypes
files: ctypes_bug.py
messages: 330817
nosy: rvijayc
priority: normal
severity: normal
status: open
title: Monkey Patching class derived from ctypes.Union doesn't work
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47961/ctypes_bug.py

___
Python tracker 

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



[issue35365] Use wchar_t* buffer instead of Unicode object in code page decoder

2018-11-30 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

Currently the code page decoder uses the legacy Unicode C API for creating an 
output buffer as a Unicode object with PyUnicode_WCHAR_KIND. Proposed PR makes 
it using a raw wchar_t* buffer.

This is necessary for deprecating and removing the legacy Unicode C API in 
future.

--
assignee: serhiy.storchaka
components: Interpreter Core
messages: 330816
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Use wchar_t* buffer instead of Unicode object in code page decoder
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



[issue35364] Datetime “fromtimestamp()” ignores inheritance if timezone is not None

2018-11-30 Thread Adrien


Adrien  added the comment:

Actually, this also occurs while using "astimezone()" on a custom child class 
(I suppose this method is used by "fromtimestamp()").

--

___
Python tracker 

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



[issue35352] test_asyncio fails on RHEL8

2018-11-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +10073

___
Python tracker 

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



[issue35352] test_asyncio fails on RHEL8

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 7212148c95947b0fdfcb0c8e37d4357287bdb4bd by Victor Stinner in 
branch 'master':
bpo-35352: Cleanup test_asyncio/utils.py (GH-10831)
https://github.com/python/cpython/commit/7212148c95947b0fdfcb0c8e37d4357287bdb4bd


--

___
Python tracker 

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



[issue35352] test_asyncio fails on RHEL8

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:

> IIRC two copies exist from very early development times when asyncio was not 
> a part of Python stdlib.

Yeah, that was my guess as well. Maybe data_file() could be simplified or 
replaced by support.findfile(), but I chose the easy solution (minimize 
changes) :-)

--

___
Python tracker 

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



[issue35352] test_asyncio fails on RHEL8

2018-11-30 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

IIRC two copies exist from very early development times when asyncio was not a 
part of Python stdlib.

--

___
Python tracker 

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



[issue35352] test_asyncio fails on RHEL8

2018-11-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +10072

___
Python tracker 

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



[issue35364] Datetime “fromtimestamp()” ignores inheritance if timezone is not None

2018-11-30 Thread Adrien

New submission from Adrien :

Hello.

I created a class inheriting from "datetime.datetime".

While creating a new instance using the classmethod "fromtimestamp" it seems to 
work, except if I provide a timezone object. In such case, the returned object 
is of base type datetime.

This looks like a bug, isn't it? If not, I guess this should be mentioned 
somewhere in the documentation. Tested on Python 3.6 and 3.7, my apologies if 
this has been fixed in 3.8.

NB: I first opened a question on SO -> 
https://stackoverflow.com/questions/53561996/datetime-fromtimestamp-ignores-inheritance-if-timezone-is-not-none

--
components: Library (Lib)
files: test.py
messages: 330811
nosy: Delgan
priority: normal
severity: normal
status: open
title: Datetime “fromtimestamp()” ignores inheritance if timezone is not None
type: behavior
versions: Python 3.6, Python 3.7
Added file: https://bugs.python.org/file47960/test.py

___
Python tracker 

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



[issue33015] Fix function cast warning in thread_pthread.h

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset bc9f53f69e8207027bf2b18e3d01b30401e76ace by Victor Stinner in 
branch '2.7':
bpo-33015: Use malloc() in PyThread_start_new_thread() (GH-10829)
https://github.com/python/cpython/commit/bc9f53f69e8207027bf2b18e3d01b30401e76ace


--

___
Python tracker 

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



[issue28608] Support creating hardlink using `pathlib`

2018-11-30 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Since Path already supports symlinking, it would be reasonable to add 
hardlinking (e.g. as `Path.link_to`).  But as you said one may as well call 
`os.link(path1, path2)`.

--

___
Python tracker 

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



[issue35352] test_asyncio fails on RHEL8

2018-11-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +10071

___
Python tracker 

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



[issue35352] test_asyncio fails on RHEL8

2018-11-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10070

___
Python tracker 

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



[issue35352] test_asyncio fails on RHEL8

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b062ba77b617b0f89b7ea25d14cc77c991462ad4 by Victor Stinner 
(stratakis) in branch 'master':
bpo-35352: test_asyncio uses the certificate set from the test directory 
(GH-10826)
https://github.com/python/cpython/commit/b062ba77b617b0f89b7ea25d14cc77c991462ad4


--

___
Python tracker 

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



[issue33015] Fix function cast warning in thread_pthread.h

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote PR 10828 to make PyMem_Malloc() thread-safe in debug mode as well.. But 
I'm not sure that it's ok to push such change later in the 2.7 development 
cycle...

So I wrote PR 10829 which only modified PyThread_start_new_thread(): use 
malloc/free instead of PyMem_Malloc/PyMem_Free.

--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue33015] Fix function cast warning in thread_pthread.h

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:

Oh... test_threaded_import started to crash on Python 2.7:

$ ./python -m test  -F -v test_threaded_import
(...)
0:00:00 load avg: 1.06 [  3] test_threaded_import
Trying 20 threads ... OK.
Trying 50 threads ... OK.
Trying 20 threads ... OK.
Segmentation fault (core dumped)

The problem is that PyMem_Malloc() is not thread safe when Python is compiled 
in debug mode! In release mode, it's safe because PyMem_Malloc() is a thin 
wrapper to malloc(). But in debug mode, PyMem_Malloc() uses the debug hooks 
and... pymalloc allocator which is not thread-safe!

--

___
Python tracker 

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



[issue33015] Fix function cast warning in thread_pthread.h

2018-11-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +10069

___
Python tracker 

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



[issue33015] Fix function cast warning in thread_pthread.h

2018-11-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +10068

___
Python tracker 

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



[issue31046] ensurepip does not honour the value of $(prefix)

2018-11-30 Thread Matej Cepl


Matej Cepl  added the comment:

Per https://devguide.python.org/pullrequest/, can I ask you Xavier to prepare a 
proper pull request for this patch to the GitHub repo, please?

--
nosy: +mcepl

___
Python tracker 

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



[issue35352] test_asyncio fails on RHEL8

2018-11-30 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

Also on Fedora the same set of security policies can be set as RHEL8 by 
utilizing 'update-crypto-policies --set NEXT'

--

___
Python tracker 

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



[issue35352] test_asyncio fails on RHEL8

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:

> The strange thing is these tests are passed on our build bots.

RHEL8 has a very strict security policy by default. I'm not sure if any OS run 
on buildbot has a security policy as strict as RHEL8?

> Maybe bumping used protocol version will help to pass tests on your box.

I tried to tune the SSLContext in many different ways but it doesn't work. The 
problem comes from the .pem files.

I confirm that copying .pem files from Lib/test/ into Lib/test/test_asyncio/ 
does fix the issue.

> And by looking at 
> https://github.com/python/cpython/commit/6d8c1abb003a4cb05f1ddcf0eeddd513cd57#diff-a8e7dbb528601706db0f01d01332bb76
>  it seems that those certs are just copied from test/ within test_asyncio/. 
> So by copying over the old certs, the tests actually pass.

In this case, I don't see the point of having two copies of the same files.

PR 10826 does the right fix: remove .pem files from Lib/test/test_asyncio/ and 
reuse .pem files from Lib/test/.

--
nosy: +vstinner

___
Python tracker 

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



[issue35352] test_asyncio fails on RHEL8

2018-11-30 Thread Charalampos Stratakis


Change by Charalampos Stratakis :


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

___
Python tracker 

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



[issue35338] set union/intersection/difference could accept zero arguments

2018-11-30 Thread Mark Dickinson


Mark Dickinson  added the comment:

> set.union() without constructing the set you call union on only happens to 
> work for the set.union(a) case because `a` is already a set.

Good point. I wasn't thinking clearly about the unbound-methodness of this.

> I'm -1 on making any changes to set.union to support this misuse case.

Agreed.

--

___
Python tracker 

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



[issue35363] test_eintr: test_open() hangs randomly on x86-64 El Capitan 3.x buildbot

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:

I stopped my manual test after 71 iterations.

--

___
Python tracker 

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



[issue33015] Fix function cast warning in thread_pthread.h

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, the bug should now be fixed.

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



[issue33015] Fix function cast warning in thread_pthread.h

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 03b1200dfd03061e9ad0bff8199967bd80b9b900 by Victor Stinner in 
branch '3.6':
bpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008) (GH-10822)
https://github.com/python/cpython/commit/03b1200dfd03061e9ad0bff8199967bd80b9b900


--

___
Python tracker 

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



[issue33015] Fix function cast warning in thread_pthread.h

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8f83c2fb19c45350c2161d9e75dab4cd2bcaee28 by Victor Stinner in 
branch '2.7':
bpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008) (GH-10823)
https://github.com/python/cpython/commit/8f83c2fb19c45350c2161d9e75dab4cd2bcaee28


--

___
Python tracker 

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



[issue35358] avoid '-' in importlib.import_module and builtins.__import__

2018-11-30 Thread Guido van Rossum


Guido van Rossum  added the comment:

Do not change this. I'd rather see it documented that importlib can import any 
name as long as it doesn't contain a dot, slash or backslash.

(Clearly the fact that Django loads it is an additional argument that this 
should be supported, not forbidden.)

It's the same as for getattr etc.

--

___
Python tracker 

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



[issue35363] test_eintr: test_open() hangs randomly on x86-64 El Capitan 3.x buildbot

2018-11-30 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +pablogsal

___
Python tracker 

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



[issue35363] test_eintr: test_open() hangs randomly on x86-64 El Capitan 3.x buildbot

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:

I'm unable to reproduce the bug on macOS 10.13.6 using:

   ./python.exe -m test -F test_eintr --timeout=60


I modified the test to display immediately result into stdout:

diff --git a/Lib/test/test_eintr.py b/Lib/test/test_eintr.py
index 25f86d3..47b89d3 100644
--- a/Lib/test/test_eintr.py
+++ b/Lib/test/test_eintr.py
@@ -1,6 +1,8 @@
 import os
+import sys
 import signal
 import unittest
+import subprocess
 
 from test import support
 from test.support import script_helper
@@ -15,7 +17,9 @@ class EINTRTests(unittest.TestCase):
 # thread (for reliable signal delivery).
 tester = support.findfile("eintr_tester.py", subdir="eintrdata")
 # use -u to try to get the full output if the test hangs or crash
-script_helper.assert_python_ok("-u", tester)
+proc = subprocess.run([sys.executable, "-u", tester, "-v"])
+if proc.returncode:
+self.fail("fail")
 
 
 if __name__ == "__main__":

--

___
Python tracker 

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



[issue35363] test_eintr: test_open() hangs randomly on x86-64 El Capitan 3.x buildbot

2018-11-30 Thread STINNER Victor


New submission from STINNER Victor :

test_open() of test_eintr hangs randomly on x86-64 El Capitan 3.x buildbot. 
test_eintr failed but then passed when run again.

pythoninfo:

platform.platform: Darwin-15.6.0-x86_64-i386-64bit  # macOS 10.11 (El Capitan)


https://buildbot.python.org/all/#/builders/93/builds/1574

test_all (test.test_eintr.EINTRTests) ... FAIL

==
FAIL: test_all (test.test_eintr.EINTRTests)
--
Traceback (most recent call last):
  File 
"/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/test_eintr.py",
 line 18, in test_all
script_helper.assert_python_ok("-u", tester)
  File 
"/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/support/script_helper.py",
 line 157, in assert_python_ok
return _assert_python(True, *args, **env_vars)
  File 
"/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/support/script_helper.py",
 line 143, in _assert_python
res.fail(cmd_line)
  File 
"/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/support/script_helper.py",
 line 70, in fail
raise AssertionError("Process return code is %d\n"
AssertionError: Process return code is 1
command line: 
['/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/python.exe', '-X', 
'faulthandler', '-I', '-u', 
'/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/eintrdata/eintr_tester.py']

stdout:
---

---

stderr:
---
ss.s.ss.Timeout (0:10:00)!
Thread 0x7fff7c082000 (most recent call first):
  File 
"/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/eintrdata/eintr_tester.py",
 line 349 in python_open
  File 
"/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/eintrdata/eintr_tester.py",
 line 345 in _test_open
  File 
"/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/support/__init__.py",
 line 596 in wrapper
  File 
"/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/eintrdata/eintr_tester.py",
 line 353 in test_open
  File 
"/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/unittest/case.py",
 line 642 in run
  File 
"/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/unittest/case.py",
 line 702 in __call__
  File 
"/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/unittest/suite.py",
 line 122 in run
  File 
"/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/unittest/suite.py",
 line 84 in __call__
  File 
"/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/unittest/runner.py",
 line 176 in run
  File 
"/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/unittest/main.py",
 line 271 in runTests
  File 
"/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/unittest/main.py",
 line 101 in __init__
  File 
"/Users/buildbot/buildarea/3.x.billenstein-elcapitan/build/Lib/test/eintrdata/eintr_tester.py",
 line 527 in 
---

--

Ran 1 test in 605.488s

FAILED (failures=1)
Warning -- files was modified by test_eintr
  Before: []
  After:  ['@test_57532_tmp'] 
test test_eintr failed

--
components: Tests
messages: 330795
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_eintr: test_open() hangs randomly on x86-64 El Capitan 3.x buildbot
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



[issue35362] list inheritor with abstract content does not raise

2018-11-30 Thread vassilis Lemonidis


Change by vassilis Lemonidis :


--
title: list inheritor with abc method does not raise -> list inheritor with 
abstract content does not raise

___
Python tracker 

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



[issue33015] Fix function cast warning in thread_pthread.h

2018-11-30 Thread miss-islington


miss-islington  added the comment:


New changeset b1355352d14a0a67107aba7ec6f26f17716a by Miss Islington (bot) 
in branch '3.7':
bpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008)
https://github.com/python/cpython/commit/b1355352d14a0a67107aba7ec6f26f17716a


--
nosy: +miss-islington

___
Python tracker 

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



[issue35362] list inheritor with abc method does not raise

2018-11-30 Thread vassilis Lemonidis


Change by vassilis Lemonidis :


--
type:  -> behavior

___
Python tracker 

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



[issue35362] list inheritor with abc method does not raise

2018-11-30 Thread vassilis Lemonidis


New submission from vassilis Lemonidis :

The following does not raise:

class Test(list, metaclass=ABCMeta):
@abstractmethod
def test(self):
pass
test = Test()

There is not enough documentation to support this problem, so I believe this 
can be classified as a bug. Anyone please elaborate.

--
components: Library (Lib)
messages: 330793
nosy: vaslem
priority: normal
severity: normal
status: open
title: list inheritor with abc method does not raise
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



[issue33015] Fix function cast warning in thread_pthread.h

2018-11-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +10066

___
Python tracker 

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



[issue35338] set union/intersection/difference could accept zero arguments

2018-11-30 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

set.union() without constructing the set you call union on only happens to work 
for the set.union(a) case because `a` is already a set. union takes arbitrary 
iterables, not just sets, and you're just cheating by explicitly passing `a` as 
the expected self argument. If you'd set `a = [1, 2]` (a list, not a set), 
set.union(a) would fail, because set.union(a) was only working by accident of a 
being interpreted as self; any such use is misuse.

Point is, the zero args case isn't a unique corner case;

args = ([1, 2], ANY OTHER ITERABLES HERE)
set.union(*args)

fails too, because the first argument is interpreted as self, and must be a set 
for this to work.

SilentGhost's solution of constructing the set before union-ing via 
set().union(*args) is the correct solution; it's free of corner cases, removing 
the specialness of the first element in args (because self is passed in 
correctly), and not having any troubles with empty args.

intersection is the only interesting case here, where preconstruction of the 
empty set doesn't work, because that would render the result the empty set 
unconditionally. The solution there is set(args[0]).intersection(*args) (or 
*args[1:]), but that's obviously uglier.

I'm -1 on making any changes to set.union to support this misuse case.

--
nosy: +josh.r

___
Python tracker 

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



[issue33015] Fix function cast warning in thread_pthread.h

2018-11-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +10065

___
Python tracker 

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



[issue33015] Fix function cast warning in thread_pthread.h

2018-11-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10064

___
Python tracker 

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



[issue33015] Fix function cast warning in thread_pthread.h

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 9eea6eaf23067880f4af3a130e3f67c9812e2f30 by Victor Stinner 
(Siddhesh Poyarekar) in branch 'master':
bpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008)
https://github.com/python/cpython/commit/9eea6eaf23067880f4af3a130e3f67c9812e2f30


--

___
Python tracker 

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



[issue35352] test_asyncio fails on RHEL8

2018-11-30 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

I believe I figured out the issue, at least on the master branch.

While checking the certificates used by asyncio tests within the test_asyncio 
folder I noticed they were quite outdated when compared to the more recent 
updated ones with the test/ folder, which take into account the stronger crypto 
defaults introduced in the latest openssl versions.

And by looking at 
https://github.com/python/cpython/commit/6d8c1abb003a4cb05f1ddcf0eeddd513cd57#diff-a8e7dbb528601706db0f01d01332bb76
 it seems that those certs are just copied from test/ within test_asyncio/. So 
by copying over the old certs, the tests actually pass.

The immediate workaround would be to just copy over the certs but a better 
approach would be to just reuse the certs within the test/ folder instead of 
relying on copying them over to test_asyncio/

--

___
Python tracker 

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



[issue35358] avoid '-' in importlib.import_module and builtins.__import__

2018-11-30 Thread Eric V. Smith


Eric V. Smith  added the comment:

I dynamically load a lot of modules whose names contain hyphens, or are 
otherwise non-identifiers (like 3rdparty.py). The suggested change would break 
a lot of working code.

The only thing I can see being possible is to add a warning that no one would 
likely ever see. So I think we should take no action here.

--
nosy: +eric.smith
type:  -> enhancement
versions:  -Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue35352] test_asyncio fails on RHEL8

2018-11-30 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Maybe this is the reason.
asycio test suite uses these ssl contexts: 
https://github.com/python/cpython/blob/master/Lib/test/test_asyncio/utils.py#L72-L92

Maybe bumping used protocol version will help to pass tests on your box.
Would you try it?

--

___
Python tracker 

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



[issue35352] test_asyncio fails on RHEL8

2018-11-30 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

It seems I can reproduce it on Fedora as well by setting stronger crypto 
defaults through 'update-crypto-policies --set FUTURE'.

Repo located here: 
https://gitlab.com/redhat-crypto/fedora-crypto-policies/tree/master

The changes are many, but if I compare with RHEL8, the minimal changes that 
could affect it are:

-# DH params size: >= 1023
+# DH params size: >= 2048

-# TLS protocols: TLS >= 1.0
+# TLS protocols: TLS >= 1.2, DTLS >= 1.2

-@protocol_list = ('TLS1.3', 'TLS1.2', 'TLS1.1', 'TLS1.0', 'DTLS1.2', 
'DTLS1.0');
+@protocol_list = ('TLS1.3', 'TLS1.2', 'DTLS1.2');

- $min_tls_version = 'TLS1.0';
- min_dtls_version = 'DTLS1.0';
+ $min_tls_version = 'TLS1.2';
+ $min_dtls_version = 'DTLS1.2';

# Parameter sizes
- $min_dh_size = 1023;
+ $min_dh_size = 2048;

--

___
Python tracker 

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



[issue35350] importing "ctypes" immediately causes a segmentation fault

2018-11-30 Thread David


David  added the comment:

Another small update:

After I recompiled Python with the commented out statement, I did a small test 
if loading a shared library works.

I compiled the following test function to testib.so:

#include 

void test_func(void);

void test_func(void) {
printf("hello world\n");
}

After that I used ctypes to load this library and execute the test_func():

(gdb) file python2.7
Reading symbols from python2.7...done.
(gdb) run -c "import ctypes; lib_test = 
ctypes.cdll.LoadLibrary('/tmp/testlib.so'); lib_test.test_func();"
Starting program: /usr/bin/python2.7 -c "import ctypes; lib_test = 
ctypes.cdll.LoadLibrary('/tmp/testlib.so'); lib_test.test_func();"
warning: Unable to find libthread_db matching inferior's thread library, thread 
debugging will not be available.
hello world

Program received signal SIGSEGV, Segmentation fault.
PyCFuncPtr_call (self=, inargs=, kwds=) at /home/user/ARM_Linux/src/Python-2.7.15/Modules/_ctypes/_ctypes.c:4108
4108/home/user/ARM_Linux/src/Python-2.7.15/Modules/_ctypes/_ctypes.c: No 
such file or directory.
(gdb)

It prints the expected output, but again I get a segmentation fault, this time 
in PyCFuncPtr_call function.

--

___
Python tracker 

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



[issue33930] Segfault with deep recursion into object().__dir__

2018-11-30 Thread INADA Naoki


INADA Naoki  added the comment:

$ ./python.patched -m perf timeit --compare-to ./python.master -s 'o="foo"' 
'o.encode' --duplicate=1
python.master: . 23.1 ns +- 0.5 ns
python.patched: . 24.6 ns +- 0.5 ns

Mean +- std dev: [python.master] 23.1 ns +- 0.5 ns -> [python.patched] 24.6 ns 
+- 0.5 ns: 1.06x slower (+6%)

$ perf record ./python.patched -m perf timeit -s 'o="foo"' 'o.encode' 
--duplicate=1
Couldn't record kernel reference relocation symbol
Symbol resolution may be skewed if relocation was used (e.g. kexec).
Check /proc/kallsyms permission or run as root.
.
Mean +- std dev: 24.9 ns +- 0.7 ns
[ perf record: Woken up 9 times to write data ]
[kernel.kallsyms] with build id debb7f6ce8aad7263cc6564650a88db5c8003389 not 
found, continuing without symbols
[ perf record: Captured and wrote 2.491 MB perf.data (61787 samples) ]

$ perf report | cat
(snip)
# Total Lost Samples: 0
#
# Samples: 61K of event 'cycles:ppp'
# Event count (approx.): 52880893198
#
# Overhead  Command Shared Object 
Symbol
#   ..    
..
#
18.78%  python.patched  python.patched
[.] _PyEval_EvalFrameDefault
14.85%  python.patched  python.patched
[.] _PyObject_GenericGetAttrWithDict
 9.93%  python.patched  python.patched
[.] PyCFunction_NewEx
 8.56%  python.patched  python.patched
[.] _PyType_Lookup
 6.61%  python.patched  python.patched
[.] meth_dealloc
 4.12%  python.patched  python.patched
[.] PyParser_AddToken
 3.36%  python.patched  python.patched
[.] PyObject_GetAttr
 3.33%  python.patched  python.patched
[.] PyObject_GC_UnTrack
 3.25%  python.patched  python.patched
[.] method_get
 2.92%  python.patched  python.patched
[.] _Py_bytes_contains
 2.13%  python.patched  python.patched
[.] freechildren
 1.41%  python.patched  python.patched
[.] pymalloc_alloc.isra.6.part.7

--

___
Python tracker 

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



[issue35361] Update libffi dependency to 3.2.1?

2018-11-30 Thread STINNER Victor


New submission from STINNER Victor :

Python 2.7 and 3.6 embed a copy of libffi 3.1, whereas libffi 3.2.1 was 
released on November 12, 2014. Should we update libffi?

I'm talking about the directory Modules/_ctypes/libffi/.

It seems like Fedora 29 still uses libffi 3.1:

$ rpm -q libffi
libffi-3.1-18.fc29.x86_64

Note: Not only we vendor a copy of libffi and we also modify it :-/

Hopefully, libffi copy has been removed from Python 3.7!

--
components: Build
messages: 330784
nosy: vstinner
priority: normal
severity: normal
status: open
title: Update libffi dependency to 3.2.1?
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



[issue35360] [Windows] Update SQLite dependency

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:

First the sqlite branch should be updated in:
https://github.com/python/cpython-source-deps

Then a new tag should be created in this repository.

I tried to update cpython-source-deps, but "git push" never completed. I will 
retry next week ;-)

--

___
Python tracker 

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



[issue35347] test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:

Ok, test_socket should depend a little bit less on time now ;-)

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



[issue35347] test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 304315d251dbb4e85dd86056ba1925f25e646ca1 by Victor Stinner in 
branch 'master':
bpo-35347: Cleanup test_socket.NonBlockingTCPTests (GH-10818)
https://github.com/python/cpython/commit/304315d251dbb4e85dd86056ba1925f25e646ca1


--

___
Python tracker 

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



[issue33930] Segfault with deep recursion into object().__dir__

2018-11-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you Inada. There is a large overhead for iterating. Try to add 
--duplicate=1000.

--

___
Python tracker 

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



[issue35360] [Windows] Update SQLite dependency

2018-11-30 Thread STINNER Victor


Change by STINNER Victor :


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



[issue35360] [Windows] Update SQLite dependency

2018-11-30 Thread STINNER Victor


New submission from STINNER Victor :

Windows and macOS installers require SQLite, but they require different 
versions! Windows uses 3.21 or 3.14, but macOS uses 3.22.

I'm talking about the following line in PCbuild\get_externals.bat:

   set libraries=%libraries% sqlite-3.21.0.0


* 3.6, 3.7 and master branches:

SQLite[Windows]: 3.21.0.0
SQLite[macOS]: 3.22.0

* 2.7 branch:

SQLite[Windows]: 3.14.2.0
SQLite[macOS]: 3.22.0


Note: I wrote a script to get external dependencies:

https://github.com/vstinner/misc/blob/master/cpython/external_versions.py

--
components: Build
messages: 330779
nosy: vstinner
priority: normal
severity: normal
status: open
title: [Windows] Update SQLite dependency
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



[issue35347] test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset dab59fa56054d6c0f75ae7013337f7baaa248076 by Victor Stinner in 
branch '2.7':
bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791) (GH-10817)
https://github.com/python/cpython/commit/dab59fa56054d6c0f75ae7013337f7baaa248076


--

___
Python tracker 

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



[issue35359] [2.7][Windows] Define _CRT_SECURE_NO_WARNINGS to build Modules\zlib\

2018-11-30 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue35359] [2.7][Windows] Define _CRT_SECURE_NO_WARNINGS to build Modules\zlib\

2018-11-30 Thread STINNER Victor


New submission from STINNER Victor :

The compilation of Modules\zlib\ on Python 2.7 emits a lot of warnings: see 
AppVeyor logs above. I propose to define _CRT_SECURE_NO_WARNINGS in the 
pythoncore project to make these warnings quiet, to spot more easily new 
warnings.

Attached PR adds _CRT_SECURE_NO_WARNINGS to Python 2.7 pythoncore project.

In the master branch, the following project also set _CRT_SECURE_NO_WARNINGS:

* PCbuild/_decimal.vcxproj
* PCbuild/_elementtree.vcxproj
* PCbuild/_ssl.vcxproj
* PCbuild/pyexpat.vcxproj

Note: In the master branch, encode_current_locale() of Python/fileutils.c also 
uses wcstombs(), but no warning is emitted, whereas the C file is compiled by 
the pythoncore project which doesn't define _CRT_SECURE_NO_WARNINGS.


AppVeyor logs:

[00:01:51] ..\Modules\zlib\gzlib.c(193): warning C4996: 'wcstombs': This 
function or variable may be unsafe. Consider using wcstombs_s instead. To 
disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 
[C:\projects\cpython\PCbuild\pythoncore.vcxproj]
[00:01:51]   C:\Program Files (x86)\Microsoft Visual Studio 
9.0\VC\include\stdlib.h(534) : see declaration of 'wcstombs'
[00:01:51] ..\Modules\zlib\gzlib.c(208): warning C4996: 'wcstombs': This 
function or variable may be unsafe. Consider using wcstombs_s instead. To 
disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 
[C:\projects\cpython\PCbuild\pythoncore.vcxproj]
[00:01:51]   C:\Program Files (x86)\Microsoft Visual Studio 
9.0\VC\include\stdlib.h(534) : see declaration of 'wcstombs'
[00:01:51] ..\Modules\zlib\gzlib.c(214): warning C4996: '_snprintf': This 
function or variable may be unsafe. Consider using _snprintf_s instead. To 
disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 
[C:\projects\cpython\PCbuild\pythoncore.vcxproj]
[00:01:51]   C:\Program Files (x86)\Microsoft Visual Studio 
9.0\VC\include\stdio.h(358) : see declaration of '_snprintf'
[00:01:51] ..\Modules\zlib\gzlib.c(245): warning C4996: '_wopen': This function 
or variable may be unsafe. Consider using _wsopen_s instead. To disable 
deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 
[C:\projects\cpython\PCbuild\pythoncore.vcxproj]
[00:01:51]   C:\Program Files (x86)\Microsoft Visual Studio 
9.0\VC\include\io.h(276) : see declaration of '_wopen'
[00:01:51] ..\Modules\zlib\gzlib.c(245): warning C4996: 'open': The POSIX name 
for this item is deprecated. Instead, use the ISO C++ conformant name: _open. 
See online help for details. [C:\projects\cpython\PCbuild\pythoncore.vcxproj]
[00:01:51]   C:\Program Files (x86)\Microsoft Visual Studio 
9.0\VC\include\io.h(316) : see declaration of 'open'
[00:01:51] ..\Modules\zlib\gzlib.c(296): warning C4996: '_snprintf': This 
function or variable may be unsafe. Consider using _snprintf_s instead. To 
disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 
[C:\projects\cpython\PCbuild\pythoncore.vcxproj]
[00:01:51]   C:\Program Files (x86)\Microsoft Visual Studio 
9.0\VC\include\stdio.h(358) : see declaration of '_snprintf'
[00:01:51] ..\Modules\zlib\gzlib.c(612): warning C4996: '_snprintf': This 
function or variable may be unsafe. Consider using _snprintf_s instead. To 
disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 
[C:\projects\cpython\PCbuild\pythoncore.vcxproj]
[00:01:51]   C:\Program Files (x86)\Microsoft Visual Studio 
9.0\VC\include\stdio.h(358) : see declaration of '_snprintf'
[00:01:51]   gzread.c
[00:01:51] ..\Modules\zlib\gzread.c(35): warning C4996: 'read': The POSIX name 
for this item is deprecated. Instead, use the ISO C++ conformant name: _read. 
See online help for details. [C:\projects\cpython\PCbuild\pythoncore.vcxproj]
[00:01:51]   C:\Program Files (x86)\Microsoft Visual Studio 
9.0\VC\include\io.h(317) : see declaration of 'read'
[00:01:51] ..\Modules\zlib\gzread.c(41): warning C4996: 'strerror': This 
function or variable may be unsafe. Consider using strerror_s instead. To 
disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. 
[C:\projects\cpython\PCbuild\pythoncore.vcxproj]
[00:01:51]   C:\Program Files (x86)\Microsoft Visual Studio 
9.0\VC\include\string.h(126) : see declaration of 'strerror'
[00:01:51] ..\Modules\zlib\gzread.c(651): warning C4996: 'close': The POSIX 
name for this item is deprecated. Instead, use the ISO C++ conformant name: 
_close. See online help for details. 
[C:\projects\cpython\PCbuild\pythoncore.vcxproj]
[00:01:51]   C:\Program Files (x86)\Microsoft Visual Studio 
9.0\VC\include\io.h(306) : see declaration of 'close'
[00:01:51]   gzwrite.c
[00:01:51] ..\Modules\zlib\gzwrite.c(89): warning C4996: 'write': The POSIX 
name for this item is deprecated. Instead, use the ISO C++ conformant name: 
_write. See online help for details. 
[C:\projects\cpython\PCbuild\pythoncore.vcx

[issue33930] Segfault with deep recursion into object().__dir__

2018-11-30 Thread INADA Naoki


INADA Naoki  added the comment:

microbench:


$ ./python.patched -m perf timeit --compare-to ./python.master -s 'o="foo"' 
'o.encode'
python.master: . 29.3 ns +- 0.6 ns
python.patched: . 30.9 ns +- 1.3 ns

Mean +- std dev: [python.master] 29.3 ns +- 0.6 ns -> [python.patched] 30.9 ns 
+- 1.3 ns: 1.05x slower (+5%)



And this is perf report of python.patched:


  33.17%   _PyEval_EvalFrameDefault
  15.25%   _PyObject_GenericGetAttrWithDict
   9.63%   PyCFunction_NewEx
   8.25%   _PyType_Lookup
   6.42%   meth_dealloc
   3.50%   _Py_bytes_contains
   3.22%   PyObject_GC_UnTrack
   3.20%   method_get
   2.73%   PyObject_GetAttr
   2.55%   repeat_next
   0.88%   _Py_Dealloc
   0.81%   PyObject_GenericGetAttr
   0.78%   sre_ucs1_match
   0.50%   lookdict_unicode_nodummy

--
nosy: +inada.naoki

___
Python tracker 

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



[issue35347] test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization

2018-11-30 Thread miss-islington


miss-islington  added the comment:


New changeset af7e81f71858519de8d2bafcb38fce8cca86aa0a by Miss Islington (bot) 
in branch '3.6':
bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791)
https://github.com/python/cpython/commit/af7e81f71858519de8d2bafcb38fce8cca86aa0a


--

___
Python tracker 

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



[issue35347] test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization

2018-11-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +10062

___
Python tracker 

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



[issue35347] test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization

2018-11-30 Thread miss-islington


miss-islington  added the comment:


New changeset 365f21c2d3756a6768c5b0d479aaf5c2a568b80b by Miss Islington (bot) 
in branch '3.7':
bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791)
https://github.com/python/cpython/commit/365f21c2d3756a6768c5b0d479aaf5c2a568b80b


--
nosy: +miss-islington

___
Python tracker 

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



[issue35347] test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization

2018-11-30 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +10061

___
Python tracker 

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



[issue30167] site.main() does not work on Python 3.6 and superior if PYTHONSTARTUP is set

2018-11-30 Thread INADA Naoki


Change by INADA Naoki :


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



[issue35347] test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization

2018-11-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10060

___
Python tracker 

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



[issue35347] test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ebd5d6d6e6e4e751ba9c7534004aadfc27ba9265 by Victor Stinner in 
branch 'master':
bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791)
https://github.com/python/cpython/commit/ebd5d6d6e6e4e751ba9c7534004aadfc27ba9265


--

___
Python tracker 

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



[issue35347] test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization

2018-11-30 Thread miss-islington


Change by miss-islington :


--
pull_requests: +10059

___
Python tracker 

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



[issue35336] Bug in C locale coercion with PYTHONCOERCECLOCALE=1

2018-11-30 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



[issue35336] Bug in C locale coercion with PYTHONCOERCECLOCALE=1

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset df738d56fe798b3586ed71775df25bf127789cf6 by Victor Stinner in 
branch '3.7':
bpo-35336: Fix PYTHONCOERCECLOCALE=1 (GH-10806) (GH-10813)
https://github.com/python/cpython/commit/df738d56fe798b3586ed71775df25bf127789cf6


--

___
Python tracker 

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



[issue35336] Bug in C locale coercion with PYTHONCOERCECLOCALE=1

2018-11-30 Thread STINNER Victor


STINNER Victor  added the comment:

> PYTHONCOERCECLOCALE=1 should not force C locale coercion, Python should still 
> check if the LC_CTYPE locale is "C".

Reference:

https://docs.python.org/dev/using/cmdline.html#envvar-PYTHONCOERCECLOCALE

"If (...) the current locale reported for the LC_CTYPE category is either the 
default C locale, or else the explicitly ASCII-based POSIX locale, (...)"

--

___
Python tracker 

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



  1   2   >