[issue38105] hash collision when hash(x) == -2 causes many calls to __eq__

2019-09-11 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

[Tim Peters]
> I don't believe it's worth a single cycle, overall, to avoid it.

That makes complete sense.  Marking this one as closed.

Guido, thank for the high quality, reproducible report.

hongweipeng, thank you for the casual analysis.

--
nosy: +rhettinger
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue38119] resource tracker destroys shared memory segments when other processes should still have valid access

2019-09-11 Thread Vinay Sharma


Vinay Sharma  added the comment:

Hi Davin,
This PR would fix the issues mentioned by you, by not prematurely unlinking the 
shared memory segment. And, therefore it would make shared memory useful in a 
lot of use cases.

But, this would still not make Unix's implementation consistent with Windows.
Windows uses a reference counting mechanism to count the number of processes 
using a shared memory segment. When all of them are done using it, Windows 
simply unlinks and frees the memory allocated to the shared memory segment.

I know that you already know this. I am commenting to find out, that what would 
be the next steps to fix the above inconsistency. You could see my last 
comment(msg351445) in issue37754, where I have listed some ways to implement 
the above reference counting mechanism. 

If you could have a look and see which one would be the best way, I would be 
happy to make a PR for it.

--

___
Python tracker 

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



[issue38112] Compileall improvements

2019-09-11 Thread Lumír Balhar

Change by Lumír Balhar :


--
keywords: +patch
pull_requests: +15638
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/16012

___
Python tracker 

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



[issue38105] hash collision when hash(x) == -2 causes many calls to __eq__

2019-09-11 Thread Tim Peters


Tim Peters  added the comment:

Note that you can contrive similar cases with positive hash codes too.  For 
example, force both hash codes to 2**60 - 2.
 
The salient points are that 0 * 5 is congruent to 0 mod any power of 2, while 
-2 * 5 = -10 is congruent to -2 mod 8, so they're fixed points of the `i = 5*i 
+ 1 + perturb` iteration _given that_ perturb is congruent to -1 (so cancels 
out the +1) until enough shifts have been done to get 0 bits into the lowermost 
bits retained by the mask (in which case perturb is no longer congruent to -1, 
and so no longer cancels out the +1).  Since PERTURB_SHIFT is 5, on a 64-bit 
box it can take 13 shifts before `perturb` is entirely cleared.  As internal 
comments note, it's only _then_ that the recurrence is guaranteed to visit 
every slot exactly once.

I don't care.  It would be nice if it could guarantee to visit every slot 
exactly once from the start - which it _would_ do if we didn't use `perturb` at 
all.  But using `perturb` is extremely valuable for avoiding quadratic-time 
behavior in large tables in bad real cases.  The drawback is that it can stick 
in a fixed point for 13 shifts on a 64-bit box (7 shifts on a 32-bit box).  But 
that's the worst it can do, and it's rare.

I don't believe it's worth a single cycle, overall, to avoid it.

--
nosy: +tim.peters

___
Python tracker 

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



[issue38128] IDLE undo calls get_saved() when set to None

2019-09-11 Thread Zackery Spytz


Zackery Spytz  added the comment:

This seems like a duplicate of bpo-35263.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue38128] IDLE undo calls get_saved() when set to None

2019-09-11 Thread Raymond Hettinger


New submission from Raymond Hettinger :

Terry, I don't know if these exception reports are useful to you.  If not, feel 
free to close this.  I run IDLE in day long sessions and only see these 
tracebacks when I'm exiting, so I don't know the proximate trigger event.


Exception in Tkinter callback
Traceback (most recent call last):
  File 
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/tkinter/__init__.py",
 line 1883, in __call__
return self.func(*args)
  File 
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/idlelib/multicall.py",
 line 176, in handler
r = l[i](event)
  File 
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/idlelib/filelist.py",
 line 54, in close_all_callback
reply = edit.close()
  File 
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/idlelib/pyshell.py",
 line 1008, in close
return EditorWindow.close(self)
  File 
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/idlelib/editor.py",
 line 1077, in close
reply = self.maybesave()
  File 
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/idlelib/outwin.py",
 line 94, in maybesave
return 'yes' if self.get_saved() else 'no'
  File 
"/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/idlelib/editor.py",
 line 1010, in get_saved
return self.undo.get_saved()
AttributeError: 'NoneType' object has no attribute 'get_saved'

--
assignee: terry.reedy
components: IDLE
messages: 352047
nosy: rhettinger, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE undo calls get_saved() when set to None
type: behavior
versions: Python 3.8

___
Python tracker 

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



[issue38105] hash collision when hash(x) == -2 causes many calls to __eq__

2019-09-11 Thread hongweipeng


hongweipeng  added the comment:

More than -2, -1 -4 -8 -16 and -32 will cause many calls to __eq__.In 
`set_add_entry` use

```
perturb >>= PERTURB_SHIFT;
i = (i * 5 + 1 + perturb) & mask;
```
get the next index.In the example,mask is 7,perturb is -2. If i = 6, after 
execution, the value of i has not changed.We can do one more verification like:
```
do {
perturb >>= PERTURB_SHIFT;
} while (i == ((i * 5 + 1 + perturb) & mask));
i = (i * 5 + 1 + perturb) & mask;
```
Of course this requires tests.

--
nosy: +hongweipeng

___
Python tracker 

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



[issue36876] Global C variables are a problem.

2019-09-11 Thread Chih-Hsuan Yen


Change by Chih-Hsuan Yen :


--
nosy: +yan12125

___
Python tracker 

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



[issue38127] A fatal error when running test_ctypes

2019-09-11 Thread Zackery Spytz


Change by Zackery Spytz :


--
keywords: +patch
pull_requests: +15637
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/16011

___
Python tracker 

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



[issue38127] A fatal error when running test_ctypes

2019-09-11 Thread Zackery Spytz


New submission from Zackery Spytz :

When running test_ctypes, I encountered a fatal error.

./python -m test test_ctypes
Run tests sequentially
0:00:00 load avg: 0.13 [1/1] test_ctypes
Fatal Python error: a function returned a result with an error set
MemoryError

The above exception was the direct cause of the following exception:

SystemError:  returned a result with an error set

Current thread 0x7f80d7417140 (most recent call first):
  File "/home/lubuntu2/cpython/Lib/ctypes/test/test_as_parameter.py", line 41 
in test_pointers
  File "/home/lubuntu2/cpython/Lib/unittest/case.py", line 616 in 
_callTestMethod
  File "/home/lubuntu2/cpython/Lib/unittest/case.py", line 659 in run
  File "/home/lubuntu2/cpython/Lib/unittest/case.py", line 719 in __call__
  File "/home/lubuntu2/cpython/Lib/unittest/suite.py", line 122 in run
  File "/home/lubuntu2/cpython/Lib/unittest/suite.py", line 84 in __call__
  File "/home/lubuntu2/cpython/Lib/unittest/suite.py", line 122 in run
  File "/home/lubuntu2/cpython/Lib/unittest/suite.py", line 84 in __call__
  File "/home/lubuntu2/cpython/Lib/unittest/suite.py", line 122 in run
  File "/home/lubuntu2/cpython/Lib/unittest/suite.py", line 84 in __call__
  File "/home/lubuntu2/cpython/Lib/unittest/suite.py", line 122 in run
  File "/home/lubuntu2/cpython/Lib/unittest/suite.py", line 84 in __call__
  File "/home/lubuntu2/cpython/Lib/unittest/suite.py", line 122 in run
  File "/home/lubuntu2/cpython/Lib/unittest/suite.py", line 84 in __call__
  File "/home/lubuntu2/cpython/Lib/test/support/testresult.py", line 162 in run
  File "/home/lubuntu2/cpython/Lib/test/support/__init__.py", line 1996 in 
_run_suite
  File "/home/lubuntu2/cpython/Lib/test/support/__init__.py", line 2092 in 
run_unittest
  File "/home/lubuntu2/cpython/Lib/test/libregrtest/runtest.py", line 209 in 
_test_module
  File "/home/lubuntu2/cpython/Lib/test/libregrtest/runtest.py", line 234 in 
_runtest_inner2
  File "/home/lubuntu2/cpython/Lib/test/libregrtest/runtest.py", line 270 in 
_runtest_inner
  File "/home/lubuntu2/cpython/Lib/test/libregrtest/runtest.py", line 153 in 
_runtest
  File "/home/lubuntu2/cpython/Lib/test/libregrtest/runtest.py", line 193 in 
runtest
  File "/home/lubuntu2/cpython/Lib/test/libregrtest/main.py", line 409 in 
run_tests_sequential
  File "/home/lubuntu2/cpython/Lib/test/libregrtest/main.py", line 507 in 
run_tests
  File "/home/lubuntu2/cpython/Lib/test/libregrtest/main.py", line 674 in _main
  File "/home/lubuntu2/cpython/Lib/test/libregrtest/main.py", line 628 in main
  File "/home/lubuntu2/cpython/Lib/test/libregrtest/main.py", line 695 in main
  File "/home/lubuntu2/cpython/Lib/test/__main__.py", line 2 in 
  File "/home/lubuntu2/cpython/Lib/runpy.py", line 85 in _run_code
  File "/home/lubuntu2/cpython/Lib/runpy.py", line 192 in _run_module_as_main
Aborted (core dumped)



It seems that this is because the PyObject_IsSubclass() call in 
PyCPointerType_from_param() is not checked for failure.

--
components: Extension Modules, ctypes
messages: 352045
nosy: ZackerySpytz
priority: normal
severity: normal
status: open
title: A fatal error when running test_ctypes
type: crash
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue38081] Different behavior of os.path.realpath('nul') in 3.7 and 3.8

2019-09-11 Thread Eryk Sun


Eryk Sun  added the comment:

In addition to ERROR_INVALID_FUNCTION (1), ERROR_INVALID_PARAMETER (87),  and 
ERROR_NOT_SUPPORTED (50) for an unsupported device, and ERROR_BAD_NET_NAME (67) 
for a missing server or share, it should also allow common permission errors:

ERROR_ACCESS_DENIED (5)
C:/Users/someone_else
C:/Temp/deleted_but_still_linked_file
E:/locked_volume

ERROR_NOT_READY (21)
D:/no_media

ERROR_SHARING_VIOLATION (32)
C:/pagefile.sys

--

___
Python tracker 

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



[issue38120] DeprecationWarning in test_random due to invalid seed arguments

2019-09-11 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Okay.  This looks good to go.

I don't remember why the original test repeated some of the seeds -- that would 
normally only be done if caching was present.

--
assignee: rhettinger -> xtreak

___
Python tracker 

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



[issue38096] Clean up the "struct sequence" / "named tuple" docs

2019-09-11 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
pull_requests: +15636
pull_request: https://github.com/python/cpython/pull/16010

___
Python tracker 

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



[issue38096] Clean up the "struct sequence" / "named tuple" docs

2019-09-11 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Tim, I'll make the fix-ups in a separate PR.  There wasn't a clear workflow for 
reverting, adding fixes, re-applying, and backporting.

--

___
Python tracker 

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



[issue38096] Clean up the "struct sequence" / "named tuple" docs

2019-09-11 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 2bb6bf0c8cf863c057027b10751c0fb74189871f by Raymond Hettinger 
(Paul Ganssle) in branch '3.8':
bpo-38096: Clean up the "struct sequence" / "named tuple" docs (GH-15895) 
(GH-15961)
https://github.com/python/cpython/commit/2bb6bf0c8cf863c057027b10751c0fb74189871f


--

___
Python tracker 

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



[issue38096] Clean up the "struct sequence" / "named tuple" docs

2019-09-11 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset b7a310d865347eabc60d387dbec82ee408315050 by Raymond Hettinger 
(Paul Ganssle) in branch '3.7':
bpo-38096: Clean up the "struct sequence" / "named tuple" docs (GH-15895) 
(GH-15962)
https://github.com/python/cpython/commit/b7a310d865347eabc60d387dbec82ee408315050


--

___
Python tracker 

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



[issue29988] with statements are not ensuring that __exit__ is called if __enter__ succeeds

2019-09-11 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Is there a chance this will get resolved for 3.8?  This is an important 
guarantee.

--

___
Python tracker 

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



[issue38126] mailcap top level wildcard support

2019-09-11 Thread pacien


New submission from pacien :

given ~/.mailcap containing:
*/*; xdg-open "%s"

>>> mailcap.findmatch(mailcap.getcaps(), 'application/pdf', 
>>> filename='thing.pdf')
returns: (None, None)
instead of: ('xdg-open "thing.pdf"', {'view': 'xdg-open "%s"', 'lineno': 0})

---

While top-level wildcards aren't defined in RFC1524, most other tools and 
programs (including mutt for example) handle them properly.

Entries of the form of "*; someprogram" or "*/*; someprogram" are useful for 
fallbacks when no other more precise type can be found.

--
components: email
messages: 352038
nosy: barry, pacien, r.david.murray
priority: normal
severity: normal
status: open
title: mailcap top level wildcard support
type: behavior

___
Python tracker 

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



[issue38125] Can' build document in Sphinx v2.2.0

2019-09-11 Thread Ammar Askar


Ammar Askar  added the comment:

When did you try this? For reference, Doc/conf.py on master currently has 
`master_doc = 'contents'` and I performed a successful build with Sphinx 2.2.0 
a few days ago.

--
nosy: +ammar2

___
Python tracker 

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



[issue38124] off-by-one error in PyState_AddModule

2019-09-11 Thread miss-islington


miss-islington  added the comment:


New changeset a5a7102636de82e0687af7131357762337d49c7c by Miss Islington (bot) 
in branch '3.8':
closes bpo-38124: Fix bounds check in PyState_AddModule. (GH-16007)
https://github.com/python/cpython/commit/a5a7102636de82e0687af7131357762337d49c7c


--

___
Python tracker 

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



[issue38124] off-by-one error in PyState_AddModule

2019-09-11 Thread miss-islington


miss-islington  added the comment:


New changeset 8892a1d685e4898b28961308b3c1447fe9ad3269 by Miss Islington (bot) 
in branch '3.7':
closes bpo-38124: Fix bounds check in PyState_AddModule. (GH-16007)
https://github.com/python/cpython/commit/8892a1d685e4898b28961308b3c1447fe9ad3269


--
nosy: +miss-islington

___
Python tracker 

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



[issue38125] Can' build document in Sphinx v2.2.0

2019-09-11 Thread Windson Yang


New submission from Windson Yang :

I got two errors when I try to build python document with

make venv
make html

The first one is 

> Since v2.0, Sphinx uses "index" as master_doc by default. Please add 
> "master_doc = 'contents'" to your conf.py.

After fixing this one, the second one is 

> /Users/windson/learn/cpython/Doc/library/email.message.rst:4:duplicate object 
> description of email.message, other instance in 
> library/email.compat32-message, use :noindex: for one of them

--
assignee: docs@python
components: Documentation
messages: 352034
nosy: Windson Yang, docs@python
priority: normal
severity: normal
status: open
title: Can' build document in Sphinx v2.2.0
type: crash
versions: Python 3.9

___
Python tracker 

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



[issue38124] off-by-one error in PyState_AddModule

2019-09-11 Thread Benjamin Peterson


Benjamin Peterson  added the comment:


New changeset 39de95b746c990e6a2fe9af5fad01747f58b2e5f by Benjamin Peterson in 
branch 'master':
closes bpo-38124: Fix bounds check in PyState_AddModule. (GH-16007)
https://github.com/python/cpython/commit/39de95b746c990e6a2fe9af5fad01747f58b2e5f


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



[issue38124] off-by-one error in PyState_AddModule

2019-09-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15634
pull_request: https://github.com/python/cpython/pull/16008

___
Python tracker 

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



[issue38124] off-by-one error in PyState_AddModule

2019-09-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15635
pull_request: https://github.com/python/cpython/pull/16009

___
Python tracker 

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



[issue36876] Global C variables are a problem.

2019-09-11 Thread David Bolen


David Bolen  added the comment:

The new test_check_c_globals.ActualChecks test is failing with an "unexpected 
success" on the bolen-ubuntu buildbot (under Ubuntu 18.04.3).  I can reproduce 
the failure in a manually built tree.

--
nosy: +db3l

___
Python tracker 

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



[issue38124] off-by-one error in PyState_AddModule

2019-09-11 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
keywords: +patch
pull_requests: +15633
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/16007

___
Python tracker 

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



[issue38124] off-by-one error in PyState_AddModule

2019-09-11 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
title: off-by-one error in PyState_GetModule -> off-by-one error in 
PyState_AddModule

___
Python tracker 

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



[issue38124] off-by-one error in PyState_GetModule

2019-09-11 Thread Benjamin Peterson


New submission from Benjamin Peterson :

https://github.com/python/cpython/blob/3f4db4a0bab073b768fae958e93288bd5d24eadd/Python/pystate.c#L707
 should be using > not >=.

--
components: Interpreter Core
messages: 352031
nosy: benjamin.peterson
priority: normal
severity: normal
status: open
title: off-by-one error in PyState_GetModule
type: behavior
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue37941] python -m and runpy.run_module set different __name__ by default

2019-09-11 Thread Nick Coghlan


Nick Coghlan  added the comment:

There is one, it just isn't public: runpy._run_module_as_main.

It's a private API that the -m switch implementation calls, and was introduced 
after the original runpy.run_module was found not to offer everything the 
switch needed.

It isn't possible to fully emulate -m from Python code though, as the lifecycle 
of the real main module is intertwined with the lifecycle of the underlying 
interpreter.

So if folks really want to try to do this, the source code is there to look at, 
but we're not giving the false impression that it's easy to do correctly with 
no unintended consequences.

--

___
Python tracker 

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



[issue30076] Opcode names BUILD_MAP_UNPACK_WITH_CALL and BUILD_TUPLE_UNPACK_WITH_CALL are too long

2019-09-11 Thread Nick Coghlan


Nick Coghlan  added the comment:

So we'd be going with a naming convention where "VAR" corresponds to the star 
syntax, and whether it means packing or unpacking, or refers to arguments or 
parameters is context dependent?

I could definitely support that, given that the ambiguity already exists at the 
Python syntax level.

--

___
Python tracker 

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



[issue37645] Replace PyEval_GetFuncName/PyEval_GetFuncDesc

2019-09-11 Thread Petr Viktorin


Petr Viktorin  added the comment:

My bad, I didn't publish the comments. They should be there now.

--

___
Python tracker 

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



[issue38120] DeprecationWarning in test_random due to invalid seed arguments

2019-09-11 Thread STINNER Victor


STINNER Victor  added the comment:

I confirm that test_random currently fails using -Werror:

$ ./python -W error -m test  -v test_random

==
ERROR: test_seed_when_randomness_source_not_found 
(test.test_random.MersenneTwister_TestBasicOps)
--
Traceback (most recent call last):
  File "/home/vstinner/python/master/Lib/unittest/mock.py", line 1319, in 
patched
return func(*newargs, **newkeywargs)
  File "/home/vstinner/python/master/Lib/test/test_random.py", line 60, in 
test_seed_when_randomness_source_not_found
self.test_seedargs()
  File "/home/vstinner/python/master/Lib/test/test_random.py", line 46, in 
test_seedargs
self.gen.seed(arg)
  File "/home/vstinner/python/master/Lib/random.py", line 156, in seed
_warn('Seeding based on hashing is deprecated\n'
DeprecationWarning: Seeding based on hashing is deprecated
since Python 3.9 and will be removed in a subsequent version. The only 
supported seed types are: None, int, float, str, bytes, and bytearray.

==
ERROR: test_seedargs (test.test_random.MersenneTwister_TestBasicOps)
--
Traceback (most recent call last):
  File "/home/vstinner/python/master/Lib/test/test_random.py", line 46, in 
test_seedargs
self.gen.seed(arg)
  File "/home/vstinner/python/master/Lib/random.py", line 156, in seed
_warn('Seeding based on hashing is deprecated\n'
DeprecationWarning: Seeding based on hashing is deprecated
since Python 3.9 and will be removed in a subsequent version. The only 
supported seed types are: None, int, float, str, bytes, and bytearray.


I also confirm that PR 15987 fix the issue.

--

___
Python tracker 

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



[issue9938] Add optional keyword argument exit_on_error to argparse.ArgumentParser

2019-09-11 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
title: Add optional kwargs to argparse -> Add optional keyword argument 
exit_on_error to argparse.ArgumentParser

___
Python tracker 

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



[issue29988] with statements are not ensuring that __exit__ is called if __enter__ succeeds

2019-09-11 Thread Nick Coghlan


Nick Coghlan  added the comment:

There is also the draft test case at https://github.com/ncoghlan/cpython/pull/2

That needs updating to account for the eval loop changes since I last worked on 
it, though. (I think that conflict may also be keeping the bots from running, 
even after I updated the issue title to use the modern convention)

--

___
Python tracker 

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



[issue38106] Race in PyThread_release_lock - can lead to memory corruption and deadlock

2019-09-11 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

imho posix made a mistake in allowing signal/broadcast outside the mutex.  
Otherwise an implementation could rely on the mutex for internal state 
manipulation.  I have my own fast condition variable lib implemented using 
semaphores and it is simple to do if one requires the mutex to be held for the 
signal event.

Condition variables semantics are otherwise quite brilliant. For example, 
allowing for spurious wakeups to occur allows, again, for much simpler 
implementation.

--

___
Python tracker 

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



[issue35795] test_pkgutil test_zipapp fail in AMD64 Windows7 SP1 3.x and AMD64 Windows7 SP1 3.7 buildbots

2019-09-11 Thread STINNER Victor


STINNER Victor  added the comment:

> Have we seen this recently? Should we just close this?

I'm fine with closing an issue which was a failure on a buildbot which was not 
seen in the last 3 months. I close the issue as out of date.


Moreover, since January, I enhanced regrtest to ensure that temporary 
directories created by child processes are removed, especially when they crash. 
See bpo-36915:

ommit 3c93153f7db5dd9b06f229e61978fd9199b3c097
Author: Victor Stinner 
Date:   Tue May 14 15:49:16 2019 +0200

bpo-36915: regrtest always remove tempdir of worker processes (GH-13312)

When using multiprocessing (-jN option), worker processes now create
their temporary directory inside the temporary directory of the
main process. So the main process is able to remove temporary
directories of worker processes even if they crash or when they are
killed by regrtest on KeyboardInterrupt (CTRL+c).

Rework also how multiprocessing arguments are parsed in main.py.

It's not perfect yet, but it's better than previously :-) See bpo-37531 for a 
follow-up issue.

--
resolution:  -> out of date
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



[issue34155] [CVE-2019-16056] email.utils.parseaddr mistakenly parse an email

2019-09-11 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +15632
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/16006

___
Python tracker 

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



[issue37945] test_locale failing

2019-09-11 Thread Tim Lyons


Change by Tim Lyons :


--
nosy: +guy.linton

___
Python tracker 

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



[issue36274] http.client cannot send non-ASCII request lines

2019-09-11 Thread Tim Burke


Tim Burke  added the comment:

Fair enough. Seems kinda related to https://bugs.python.org/issue30458 -- looks 
like it was a fun one ;-)

I think either approach would work for me; my existing work-around doesn't 
preclude either, particularly since I want it purely for testing purposes.

For a bit of context, I work on a large-ish project (few hundred kloc if you 
include tests) that recently finished porting from python 2.7 to 3.6 & 3.7. As 
part of that process I discovered https://bugs.python.org/issue33973 and worked 
around it in https://github.com/openstack/swift/commit/93b49c5. That was a 
prerequisite for running tests under py2 against a server running py3, but this 
bug complicated us running the *tests* under py3 as well. I eventually landed 
on https://github.com/openstack/swift/commit/c0ae48b as a work-around.

I could probably take another stab at a fix if you like, though I'm not 
entirely sure when I'll get to it at the moment.

--

___
Python tracker 

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



[issue36871] Misleading error from unittest.mock's assert_has_calls

2019-09-11 Thread Samuel Freilich


Samuel Freilich  added the comment:

Sure, but the bug in error-handling should still be fixed. Currently, if 
_call_matcher returns an exception, that's ignored by assert_has_calls, and the 
error message generated as a result is extremely misleading!

--

___
Python tracker 

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



[issue38120] DeprecationWarning in test_random due to invalid seed arguments

2019-09-11 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Sure, I think these were not caught since deprecation warnings are not shown as 
part of CI as failure. I just caught them at the sprint running with -Wall.

--

___
Python tracker 

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



[issue36871] Misleading error from unittest.mock's assert_has_calls

2019-09-11 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

It was a conscious decision over not to do the proposed change in the issue. 
There are other issues over signature difference during construction of mock 
and in the call_matcher over presence/absence of self. It needs a more careful 
fix.

--

___
Python tracker 

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



[issue37645] Replace PyEval_GetFuncName/PyEval_GetFuncDesc

2019-09-11 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> I left some comments on the PR.

I don't see anything. Either I'm doing something wrong or GitHub is messed up.

--

___
Python tracker 

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



[issue37967] Beta GPG signature check failing

2019-09-11 Thread mattip


mattip  added the comment:

> If you use pubkeys.txt from https://www.python.org/static/files/pubkeys.txt, 
> then GPG verification gives you no additional security

I am confused. If the pubkeys.txt on python.org has no benefit, why does it 
exist? What is considered best practices for people wanting to verify the 
download from https://www.python.org/ftp ?

--

___
Python tracker 

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



[issue36871] Misleading error from unittest.mock's assert_has_calls

2019-09-11 Thread Samuel Freilich


Change by Samuel Freilich :


--
pull_requests: +15630
pull_request: https://github.com/python/cpython/pull/16005

___
Python tracker 

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



[issue38116] Make select module PEP-384 compatible

2019-09-11 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

Why do you describe these issues (this one, #38069, #38071-#38076, maybe more) 
as making the module PEP 384 compatible? There is no reason to make the 
built-in modules stick to the limited API, and it doesn't look like you're 
doing that in any event (among other things, pretty sure Argument Clinic 
generated code isn't limited API compatible yet, though that might be 
changing?).

Seems like the main (only?) change you're making is to convert all static types 
to dynamic types. Which is fine, if it's necessary for PEP 554, but it seems 
only loosely related to PEP 384 (which defined mechanisms for "statically" 
defining dynamic heap types, but that wasn't the main thrust).

--
nosy: +josh.r

___
Python tracker 

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



[issue36871] Misleading error from unittest.mock's assert_has_calls

2019-09-11 Thread Samuel Freilich


Samuel Freilich  added the comment:

This is still not totally fixed. This solves the underlying error with method 
specs, but not the bug that was causing the error-swallowing in 
assert_has_calls:

https://github.com/python/cpython/blob/ee536b2020b1f0baad1286dbd4345e13870324af/Lib/unittest/mock.py#L2216

expected = [self._call_matcher(c) for c in calls]
cause = expected if isinstance(expected, Exception) else None

isinstance(expected, Exception) is never true, because expected is always a 
list. It should instead be:

cause = next((e for e in expected if isinstance(e, Exception)), None)

--
nosy: +sfreilich

___
Python tracker 

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



[issue2771] Test issue

2019-09-11 Thread Ezio Melotti


Ezio Melotti  added the comment:

test comment

--

___
Python tracker 

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



[issue38120] DeprecationWarning in test_random due to invalid seed arguments

2019-09-11 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for doing this.

If you don't mind, let's hold off one day so I can take a closer look at this 
when I get home tonight.

--
assignee:  -> rhettinger

___
Python tracker 

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



[issue38103] Duplicate label "examples" in the Docs

2019-09-11 Thread Ezio Melotti


Change by Ezio Melotti :


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



[issue37879] Segfaults in C heap type subclasses

2019-09-11 Thread Petr Viktorin


Change by Petr Viktorin :


--
pull_requests: +15629
pull_request: https://github.com/python/cpython/pull/16004

___
Python tracker 

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



[issue36876] Global C variables are a problem.

2019-09-11 Thread Eric Snow


Eric Snow  added the comment:


New changeset ee536b2020b1f0baad1286dbd4345e13870324af by Eric Snow in branch 
'master':
bpo-36876: Add a tool that identifies unsupported global C variables. (#15877)
https://github.com/python/cpython/commit/ee536b2020b1f0baad1286dbd4345e13870324af


--

___
Python tracker 

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



[issue38096] Clean up the "struct sequence" / "named tuple" docs

2019-09-11 Thread Tim Peters


Tim Peters  added the comment:

Paul, please heed what Raymond said:  it's not good to merge another core dev's 
PR unless they ask you to.  Besides what Raymond said, a core dev may well 
check in incomplete work for any number of reasons (e.g., to see how the 
automated test runs turn out).  When I do that, I add a "DO NOT MERGE" label 
just to be sure, but that really shouldn't be necessary.

Raymond, I added a review anyway, despite that it's already been merged.  One 
comment suggests repairing an obvious trivial typo.

--

___
Python tracker 

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



[issue38123] Unable to find Python3.8.0b4 on Ubuntu 19004 desktop

2019-09-11 Thread Christian Heimes


Christian Heimes  added the comment:

Please try a new shell or refresh the PATH look cache with "hash -r".

--
nosy: +christian.heimes

___
Python tracker 

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



[issue38083] Minor improvements in asdl_c.py and Python-ast.c

2019-09-11 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Agree. The third item is actually a bug fix, but it is unlikely that such bug 
can be exposed in real code.

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



[issue38115] Invalid bytecode offsets in co_lnotab

2019-09-11 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38123] Unable to find Python3.8.0b4 on Ubuntu 19004 desktop

2019-09-11 Thread Jonathan Gossage


New submission from Jonathan Gossage :

I installed Python 3.8.0b4 manually on Ubuntu 19.04 desktop. After the 
installation that appeared to run OK, I was unable to find python3.8, even 
though it had been installed in /usr/local/bin and that directory was on the 
path. I got the result:

jgossage@jgossage-XPS-8700:~$ python3.8 --version
bash: /usr/bin/python3.8: No such file or directory

There was no sign of Python in /etc/alternatives so, I assume that Linux 
alternatives were not part of the problem. I had no problem finding other files 
such as pip3.8.

--
components: Installation
messages: 352009
nosy: Jonathan.Gossage
priority: normal
severity: normal
status: open
title: Unable to find Python3.8.0b4 on Ubuntu 19004 desktop
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



[issue37409] relative import without parent succeeds with builtins.__import__

2019-09-11 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
pull_requests: +15628
pull_request: https://github.com/python/cpython/pull/16003

___
Python tracker 

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



[issue12707] Deprecate addinfourl getters

2019-09-11 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
versions: +Python 3.9 -Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue38109] Missing constants in Lib/stat.py

2019-09-11 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy: +pitrou, vstinner

___
Python tracker 

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



[issue36270] DOC: Add link to sys.exc_info for "Reference Manual"

2019-09-11 Thread miss-islington


miss-islington  added the comment:


New changeset f79a022d762edc749d0fecdc50c567d2bb910c53 by Miss Islington (bot) 
in branch '3.8':
bpo-36270: Doc: add link to traceback object reference (GH-13119)
https://github.com/python/cpython/commit/f79a022d762edc749d0fecdc50c567d2bb910c53


--
nosy: +miss-islington

___
Python tracker 

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



[issue38099] __dict__ attribute is incorrectly stated to be read-only

2019-09-11 Thread Reed

Reed  added the comment:

Thank you for the clarification. I didn't realize the section only referred to 
types, but it makes sense now that I read the documentation more carefully.

The documentation is still incorrect for certain attributes (e.g. __bases__ and 
__name__) as they can be mutated. For example:

class A: pass
A.__name__ = 'AA'

class B(A): pass
class C(B): pass
C.__bases__ = (A,)

Also, this documentation is incorrectly linked to by other parts of the 
documentation. For example, in 
https://docs.python.org/3/reference/datamodel.html#the-standard-type-hierarchy, 
there is the sentence:

"Special attributes: __dict__ is the attribute dictionary; __class__ is the 
instance’s class."

__dict__ and __class__ link to the documentation about types, and yet that 
sentence is referring to all instances of any class (such as `A()`), not just 
type objects (such as `A`).

In terms of concrete improves, I would suggest:
* Adding a section somewhere describing __dict__ and __class__ for all 
instances, not just types. Or change the original section to refer to all 
instances.

Assuming the original section is not changed to refer to all instances:
* In the sentence "The implementation adds a few special read-only 
attributes to several object types", replace "object types" with "types" or 
"instances whose class subclasses from `type`" 
* Replace `instance.class` with `class.class`. The phrase `instance` is 
confusing, as it then describes `class.__bases__`, which does explicitly use 
the word "class" to indicate it only applies to classes.

--

___
Python tracker 

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



[issue38116] Make select module PEP-384 compatible

2019-09-11 Thread Christian Heimes


Change by Christian Heimes :


--
nosy: +christian.heimes
type:  -> enhancement

___
Python tracker 

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



[issue34001] LibreSSL does not tolerate setting minimum_version greater than maximum_version

2019-09-11 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:


New changeset d6ac67f48f5079efc3fa4be3316a9578edb56e0d by Stéphane Wirtel (Miss 
Islington (bot)) in branch '3.8':
bpo-34001: Fix test_ssl with LibreSSL (GH-13783) (#15997)
https://github.com/python/cpython/commit/d6ac67f48f5079efc3fa4be3316a9578edb56e0d


--
nosy: +matrixise

___
Python tracker 

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



[issue36270] DOC: Add link to sys.exc_info for "Reference Manual"

2019-09-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15627
pull_request: https://github.com/python/cpython/pull/16002

___
Python tracker 

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



[issue36270] DOC: Add link to sys.exc_info for "Reference Manual"

2019-09-11 Thread Julien Palard

Julien Palard  added the comment:


New changeset 9936371af298d465095ae70bc9c2943b4b16eac4 by Julien Palard (Björn 
Meier) in branch 'master':
bpo-36270: Doc: add link to traceback object reference (GH-13119)
https://github.com/python/cpython/commit/9936371af298d465095ae70bc9c2943b4b16eac4


--
nosy: +mdk

___
Python tracker 

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



[issue34634] New asyncio streams API

2019-09-11 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
resolution:  -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder:  -> Merge StreamWriter and StreamReader into just asyncio.Stream

___
Python tracker 

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



[issue37409] relative import without parent succeeds with builtins.__import__

2019-09-11 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

The test is same as below and given that __spec__ an __name__ are passed as 
None where ImportWarning is raised in Lib/importlib/_bootstrap.py 1074 . can we 
just use self.assertWarns(ImportWarning) in the test?


>>> __import__('', {'__package__': None, '__spec__': None, '__name__': 
>>> '__main__'}, locals={}, fromlist=('foo',), level=1)
:1: ImportWarning: can't resolve package from __spec__ or __package__, 
falling back on __name__ and __path__
Traceback (most recent call last):
  File "", line 1, in 
ImportError: attempted relative import with no known parent package

--

___
Python tracker 

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



[issue34634] New asyncio streams API

2019-09-11 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Yes, please do

--

___
Python tracker 

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



[issue26360] Deadlock in thread.join on Python 2.7/Mac OS X 10.9, 10.10

2019-09-11 Thread Kirill Smelkov


Kirill Smelkov  added the comment:

Maybe issue38106 related.

--
nosy: +navytux

___
Python tracker 

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



[issue37652] Multiprocessing shared_memory ValueError on race with ShareableList

2019-09-11 Thread Davin Potts


Davin Potts  added the comment:

Apologies, one of the quotes in my previous response should have been 
attributed to @mental.

I think @pierreglaser phrased it very nicely:
> shared_memory is a low level python module. Precautions should be made when 
> handling concurrently the shared_memory objects using synchronization 
> primitives for example. I'm not sure this should be done internally in the 
> SharedMemory class -- especially, we don't want to slow down concurrent READ 
> access.


Per the further suggestion:
> +1 For a documentation addition.

I can take a crack at adding something more along the lines of this discussion, 
but I would very much welcome suggestions (@bjs, @mental, @pierreglaser)...

--

___
Python tracker 

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



[issue38122] AsyncMock force always creating an AsyncMock for child mocks

2019-09-11 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Sorry, is there an example of this use case. I went through the issue but have 
trouble understanding it since there are different suggestions. I guess child 
mock is always an AsyncMock irrespective of sync/async as I understand. We 
already had some reports over detecting async while patching to return 
AsyncMock and also had to document it to the users along with covering 
different ways of async functions.


from unittest.mock import AsyncMock


class Foo:

def foo(self):
pass

async def bar(self):
pass

m = AsyncMock(Foo)
f = m()
print(m.foo)
print(m.bar)


$ python3.8 /tmp/bar.py


sys:1: RuntimeWarning: coroutine 'AsyncMockMixin._mock_call' was never awaited

--

___
Python tracker 

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



[issue33983] unify types for lib2to3.pytree.Base.children

2019-09-11 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

Isn't children annotated as List in typeshed?

--

___
Python tracker 

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



[issue37652] Multiprocessing shared_memory ValueError on race with ShareableList

2019-09-11 Thread Davin Potts


Davin Potts  added the comment:

Short responses to questions/comments from @bjs, followed by hopefully helpful 
further comments:

> Are you supposed to ever use a raw SharedMemory buffer directly?

Yes.


> What atomicity guarantees are there for ShareableList operations and 
> read/write to the SharedMemory buffer?

None.


> I've had a fix spinning for about a day now, it introduced a 
> `multiprocessing.Lock` and it was simply wrapped around any struct packing 
> and unpacking calls.

That sounds like a nice general-purpose fix for situations where it is 
impossible to plan ahead to know when one or more processes will need to modify 
the ShareableList/SharedMemory.buf.  When it is possible to design code to 
ensure, because of the execution flow through the code, no two 
processes/threads will attempt to modify and access/modify the same location in 
memory at the same time, locks become unnecessary.  Locks are great tools but 
they generally result in slower executing code.


> What are the use cases for SharedMemory and ShareableList?

Speed.  If we don't care about speed, we can use distributed shared memory 
through the SyncManager -- this keeps one copy of a dict/list/whatever in the 
process memory space of a single process and all other processes may modify or 
access it through two-sided communication with that "owner" process.  If we do 
care about speed, we use SharedMemory and ShareableList and other things 
created on top of SharedMemory -- this effectively gives us fast, communal 
memory access where we avoid the cost of communication except for when we truly 
need to synchronize (where multiprocessing.Lock can help).

Reduced memory footprint.  If I have a "very large" amount of data consuming a 
significant percentage of the available memory on my system, I can make it 
available to multiple processes without duplication.  This provides processes 
with fast access to that data, as fast as if each were accessing data in its 
own process memory space.  It is one thing to imagine using this in 
parallel-executing code, but this can be just as useful in the Python 
interactive shell.  One such scenario:  after starting a time-consuming, 
non-parallel calculation in one Python shell, it is possible to open a new 
Python shell in another window and attach to the data through shared memory to 
continue work while the calculation runs in the first window.

--

___
Python tracker 

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



[issue38117] Update to OpenSSL 1.1.1d, 1.1.0l, 1.0.2t

2019-09-11 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Thank you for your contribution Christian ;-)

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



[issue37698] Update doc of PyBuffer_ToContiguous

2019-09-11 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Thank you for your contribution

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue38117] Update to OpenSSL 1.1.1d, 1.1.0l, 1.0.2t

2019-09-11 Thread miss-islington

miss-islington  added the comment:


New changeset cec68c31e8507159534b6eec3fb5d801cd3dbf8c by Miss Islington (bot) 
(Stéphane Wirtel) in branch '3.7':
[3.7] bpo-38117: Test with OpenSSL 1.1.1d (GH-15983) (GH-15994)
https://github.com/python/cpython/commit/cec68c31e8507159534b6eec3fb5d801cd3dbf8c


--

___
Python tracker 

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



[issue37698] Update doc of PyBuffer_ToContiguous

2019-09-11 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:


New changeset 965e53a9deb1c7f02c68dee119eae94c3be8af15 by Stéphane Wirtel in 
branch '3.8':
[3.8] bpo-37698: Update doc of PyBuffer_ToContiguous (GH-14992) (GH-15999)
https://github.com/python/cpython/commit/965e53a9deb1c7f02c68dee119eae94c3be8af15


--

___
Python tracker 

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



[issue37698] Update doc of PyBuffer_ToContiguous

2019-09-11 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:


New changeset c62da14776d12276ed8f6ecbc74c0db8243b4260 by Stéphane Wirtel (Miss 
Islington (bot)) in branch '3.7':
bpo-37698: Update doc of PyBuffer_ToContiguous (GH-14992) (GH-15998)
https://github.com/python/cpython/commit/c62da14776d12276ed8f6ecbc74c0db8243b4260


--
nosy: +matrixise

___
Python tracker 

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



[issue37698] Update doc of PyBuffer_ToContiguous

2019-09-11 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
pull_requests: +15626
pull_request: https://github.com/python/cpython/pull/15999

___
Python tracker 

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



[issue37698] Update doc of PyBuffer_ToContiguous

2019-09-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15625
pull_request: https://github.com/python/cpython/pull/15998

___
Python tracker 

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



[issue37698] Update doc of PyBuffer_ToContiguous

2019-09-11 Thread miss-islington


miss-islington  added the comment:


New changeset 15f5a7527b87e11fcf23069c147fd4cb7d42cfb0 by Miss Islington (bot) 
(Hai Shi) in branch 'master':
bpo-37698: Update doc of PyBuffer_ToContiguous (GH-14992)
https://github.com/python/cpython/commit/15f5a7527b87e11fcf23069c147fd4cb7d42cfb0


--
nosy: +miss-islington

___
Python tracker 

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



[issue34001] LibreSSL does not tolerate setting minimum_version greater than maximum_version

2019-09-11 Thread Thomas Wouters


Thomas Wouters  added the comment:


New changeset c9bc49c5f6e26a7c958307c2ac338951a7534d9a by T. Wouters (Christian 
Heimes) in branch 'master':
bpo-34001: Fix test_ssl with LibreSSL (GH-13783)
https://github.com/python/cpython/commit/c9bc49c5f6e26a7c958307c2ac338951a7534d9a


--
nosy: +twouters

___
Python tracker 

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



[issue38122] AsyncMock force always creating an AsyncMock for child mocks

2019-09-11 Thread Lisa Roach


New submission from Lisa Roach :

This idea has been brought up in person before and also discussed on AsyncTest: 
https://github.com/Martiusweb/asynctest/issues/100


It could be useful if someone has a lot of attributes that are also async that 
need to be mocked. 

It could probably be done with a flag that gets passed on to _get_child_mock 
and overrides the if statement to always return an AsyncMock.


Looking mostly for if people think this is a good idea/bad idea and help see 
around any corners that may be there.

--
assignee: lisroach
components: Library (Lib)
messages: 351991
nosy: cjw296, ezio.melotti, lisroach, michael.foord, xtreak
priority: low
severity: normal
status: open
title: AsyncMock force always creating an AsyncMock for child mocks
type: behavior

___
Python tracker 

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



[issue34001] LibreSSL does not tolerate setting minimum_version greater than maximum_version

2019-09-11 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15624
pull_request: https://github.com/python/cpython/pull/15997

___
Python tracker 

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



[issue35264] SSL Module build fails with OpenSSL 1.1.0 for Python 2.7

2019-09-11 Thread miss-islington


miss-islington  added the comment:


New changeset 0d63669e52dd7e95708ec14e9e3e07d7dc9cd913 by Miss Islington (bot) 
(Alexandru Ardelean) in branch '2.7':
[2.7] bpo-35264: Modules/_ssl.c: fix build with OpenSSL 1.1.0 (GH-10570)
https://github.com/python/cpython/commit/0d63669e52dd7e95708ec14e9e3e07d7dc9cd913


--
nosy: +miss-islington

___
Python tracker 

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



[issue28724] Add method send_io, recv_io to the socket module.

2019-09-11 Thread STINNER Victor


STINNER Victor  added the comment:

Thanks Shinya Okano for the original patch.

Well done Joannah! Thanks for your tenacity :-) This PR has 100 comments and 27 
commits which shows the complexity of the feature.

Honestly, I'm not 100% happy with current documentation, but I chose to merge 
the PR anyway. Please leave this issue open until the documentation is 
completed to mention corner cases like partial send (similar to sock.send vs 
sock.sendall).

--

___
Python tracker 

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



[issue38113] Remove statics from ast.c

2019-09-11 Thread Eric Snow


Change by Eric Snow :


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



[issue38113] Remove statics from ast.c

2019-09-11 Thread Eric Snow


Eric Snow  added the comment:


New changeset ac46eb4ad6662cf6d771b20d8963658b2186c48c by Eric Snow (Dino 
Viehland) in branch 'master':
bpo-38113: Update the Python-ast.c generator to PEP384 (gh-15957)
https://github.com/python/cpython/commit/ac46eb4ad6662cf6d771b20d8963658b2186c48c


--

___
Python tracker 

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



[issue38117] Update to OpenSSL 1.1.1d, 1.1.0l, 1.0.2t

2019-09-11 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
pull_requests: +15623
pull_request: https://github.com/python/cpython/pull/15994

___
Python tracker 

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



[issue28724] Add method send_io, recv_io to the socket module.

2019-09-11 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8d120f75fb8c8731464b5f7531d74cdbb897d924 by Victor Stinner 
(Joannah Nanjekye) in branch 'master':
bpo-28724: Add methods send_fds and recv_fds to the socket module (GH-12889)
https://github.com/python/cpython/commit/8d120f75fb8c8731464b5f7531d74cdbb897d924


--

___
Python tracker 

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



[issue37750] PyBuffer_FromContiguous not documented

2019-09-11 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Thank you for your contribution

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



[issue37750] PyBuffer_FromContiguous not documented

2019-09-11 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:


New changeset c112faff158a05c1e71f9e1957364ed756efbcde by Stéphane Wirtel (Miss 
Islington (bot)) in branch '3.7':
bpo-37750: Add doc of PyBuffer_FromContiguous (GH-15988) (GH-15991)
https://github.com/python/cpython/commit/c112faff158a05c1e71f9e1957364ed756efbcde


--

___
Python tracker 

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



[issue37750] PyBuffer_FromContiguous not documented

2019-09-11 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:


New changeset 4cab7eb9e1f4afc44bac4889de034e031d462e7a by Stéphane Wirtel (Miss 
Islington (bot)) in branch '3.8':
bpo-37750: Add doc of PyBuffer_FromContiguous (GH-15988) (GH-15990)
https://github.com/python/cpython/commit/4cab7eb9e1f4afc44bac4889de034e031d462e7a


--
nosy: +matrixise

___
Python tracker 

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



[issue38117] Update to OpenSSL 1.1.1d, 1.1.0l, 1.0.2t

2019-09-11 Thread miss-islington


miss-islington  added the comment:


New changeset 0b7f3706e6a4d72f7e9988cebc4826ad2c4c4753 by Miss Islington (bot) 
in branch '3.8':
bpo-38117: Test with OpenSSL 1.1.1d (GH-15983)
https://github.com/python/cpython/commit/0b7f3706e6a4d72f7e9988cebc4826ad2c4c4753


--
nosy: +miss-islington

___
Python tracker 

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



[issue35282] Add a return value to lib2to3.refactor.refactor_file and refactor_dir

2019-09-11 Thread Zachary Ware


Change by Zachary Ware :


--
nosy: +benjamin.peterson, zach.ware
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue38121] Synchronize importlib.metadata with importlib_metadata 0.22

2019-09-11 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
keywords: +patch
pull_requests: +15622
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15993

___
Python tracker 

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



[issue36161] Use thread-safe functions instead of unsafe ones (crypt, ttyname)

2019-09-11 Thread Christian Heimes


Christian Heimes  added the comment:

Does it make sense to modify crypt at all? PEP 594 is going to deprecate and 
remove crypt soon.

--
nosy: +christian.heimes

___
Python tracker 

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



[issue34709] Suggestion: make getuser.getpass() also look at SUDO_USER environment variable

2019-09-11 Thread Zachary Ware


Zachary Ware  added the comment:

I agree with Steven in that I'm not quite sure this is a good change, but I 
also see that it would be useful in some cases.  Perhaps either a 
`check_sudo_user=False` keyword-only parameter, or a `vars_to_check=()` parameter would be better?

Adding Gregory P. Smith as the last person to have added their name to 
getpass.py :)

--
nosy: +gregory.p.smith, zach.ware

___
Python tracker 

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



  1   2   3   4   5   >