[issue31822] Document that urllib.parse.{Defrag, Split, Parse}Result are namedtuples

2019-03-22 Thread Fred L. Drake, Jr.


Fred L. Drake, Jr.  added the comment:

Unfortunately, when the implementation was migrated to use 
collections.namedtuple (a benefit), the _replace method wasn't extended to 
support the additional computed addresses for these types.

That would really be useful.

--
nosy: +fdrake

___
Python tracker 

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



[issue36228] Support coercion of complex to float/int

2019-03-22 Thread Марат Нагаев

Марат Нагаев  added the comment:

ping @tim.peters

--

___
Python tracker 

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



[issue36405] Use dict unpacking in idlelib

2019-03-22 Thread Terry J. Reedy


New submission from Terry J. Reedy :

Replace 3 occurrences of 'd = d1.copy(); d.update(d2)' pattern with 'd = {**d1, 
**d2}'.  Also remove unnecessary imports and uses of __main__.

--
assignee: terry.reedy
components: IDLE
messages: 338643
nosy: terry.reedy
priority: normal
severity: normal
stage: commit review
status: open
title: Use dict unpacking in idlelib
type: enhancement
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue36403] AsyncIterator on 3.7: __aiter__ no longer honors finally blocks

2019-03-22 Thread Ask Solem


Ask Solem  added the comment:

Ah, so the extra call_soon means it needs a:

[code]
loop.run_until_complete(asyncio.sleep(0))```
[/code]

before the self.assertTrue(it.finally_executed)

to finish executing agen.close().

Why is create_task different? Does it execute an iteration of the generator 
immediately?

Seems good for this behavior to be consistent, but not sure how difficult that 
would be.

--

___
Python tracker 

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



[issue24759] Idle: require tk 8.5 and ttk widgets, and drop unneeded code.

2019-03-22 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components: +IDLE

___
Python tracker 

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



[issue25225] Idle doc: redo Syntax Colors section

2019-03-22 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components: +IDLE

___
Python tracker 

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



[issue27224] IDLE: editor versus grep line number differ

2019-03-22 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
assignee:  -> terry.reedy
components: +IDLE

___
Python tracker 

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



[issue21765] Idle: make 3.x HyperParser work with non-ascii identifiers.

2019-03-22 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
assignee:  -> terry.reedy
components: +IDLE

___
Python tracker 

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



[issue25199] Idle: add cross-references from and to macosxSupport

2019-03-22 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
components: +IDLE

___
Python tracker 

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



[issue36286] Random failure in test_idle

2019-03-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I reran test_cdfail and it did 2.7 million loops without failure.

--

___
Python tracker 

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



[issue36354] Use CreateProcessW for Python 2.7 on Windows.

2019-03-22 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

2.7 is in bug fix only mode, and even that ends at the end of this year. This 
seems more like a feature request than an actual bug; it works, but not great 
with Unicode in some cases (which describes large parts of Python 2).

It does look like Python 3.7 at least is using CreateProcessW already ( 
https://github.com/python/cpython/blob/3.7/Modules/_winapi.c#L1062 ), going 
along with the generally more Unicode-friendly vibe there.

The subprocess32 module on PyPI performed backports from Py3's subprocess to 
Py2 for POSIX systems; perhaps talk to the author (gregory.p.smith, whom I have 
nosied) about backporting similar improvements for the Windows side of the 
aisle?

--
nosy: +gregory.p.smith, josh.r

___
Python tracker 

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



[issue36301] Add _Py_PreInitialize() function

2019-03-22 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12457

___
Python tracker 

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



[issue36404] Document PendingDeprecationWarning as deprecated

2019-03-22 Thread Inada Naoki


Change by Inada Naoki :


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

___
Python tracker 

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



[issue36404] Document PendingDeprecationWarning as deprecated

2019-03-22 Thread Inada Naoki


Change by Inada Naoki :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python

___
Python tracker 

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



[issue36404] Document PendingDeprecationWarning as deprecated

2019-03-22 Thread Inada Naoki


Change by Inada Naoki :


--
nosy: inada.naoki
priority: normal
severity: normal
status: open
title: Document PendingDeprecationWarning as deprecated
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



[issue30670] pprint for dict in sorted order or insert order?

2019-03-22 Thread GUIHOT Xavier


Change by GUIHOT Xavier :


--
pull_requests: +12455

___
Python tracker 

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



[issue36401] Readonly properties should be marked as such in help()

2019-03-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> but can we do the same thing with the PyGetSetDef declaration 
> for the C Part?

The would likely take an API change.  For now, using only what is already 
exposed in Python, we can only partition data descriptors in two groups:

* Known to be readonly because __set__ is missing or fset is None
* Possibly writeable, can't really tell until __set__ is called

Example in the latter category,  

>>> t = time.localtime()
>>> hasattr(type(t).tm_sec, '__set__')
True
>>> t.tm_sec = 31
Traceback (most recent call last):
  File "", line 1, in 
 t.tm_sec = 31
AttributeError: readonly attribute

--

___
Python tracker 

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



[issue36403] AsyncIterator on 3.7: __aiter__ no longer honors finally blocks

2019-03-22 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

The attached script fails on master too. On bisecting could this be possibly 
caused due to 41e5ec377b (bpo-34769) ? Tagging Ned since it was introduced from 
3.7.1rc2 and also backported to 3.6 .

➜  cpython git:(41e5ec377b) git checkout 41e5ec377b && make -s -j4 > /dev/null
HEAD is now at 41e5ec377b bpo-34769: Thread safety for 
_asyncgen_finalizer_hook(). (GH-9716)
➜  cpython git:(41e5ec377b) ./python.exe ../backups/bpo36403.py
F.
==
FAIL: test_main (__main__.TestAsyncIteratorFinally)
--
Traceback (most recent call last):
  File "../backups/bpo36403.py", line 30, in test_main
self.assertTrue(it.finally_executed)
AssertionError: False is not true

--
Ran 2 tests in 0.002s

FAILED (failures=1)
➜  cpython git:(41e5ec377b) git checkout 41e5ec377b~1 && make -s -j4 > /dev/null
Previous HEAD position was 41e5ec377b bpo-34769: Thread safety for 
_asyncgen_finalizer_hook(). (GH-9716)
HEAD is now at 0ce31d340b bpo-32962: Fix test_gdb failure in debug build with 
-mcet -fcf-protection -O0 (GH-9656)
➜  cpython git:(0ce31d340b) ./python.exe ../backups/bpo36403.py
..
--
Ran 2 tests in 0.003s

OK

--
components: +asyncio
nosy: +asvetlov, ned.deily, twisteroid ambassador, xtreak
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



[issue36345] Deprecate Tools/scripts/serve.py in favour of python -m http.server -d

2019-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

> with your suggestions, I will move the serve.py in the documentation of 
> wsgiref and change Doc/Makefile.

I suggest to write two separated PRs for each change.

--

___
Python tracker 

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



[issue33319] `subprocess.run` documentation doesn't tell is using `stdout=PIPE` safe

2019-03-22 Thread Martin Panter

Martin Panter  added the comment:

This is a regression in the 3.7+ documentation. It previously said “To [capture 
output], pass PIPE for the ‘stdout’ and/or ‘stderr’ arguments”. This was 
removed by Bo Bayles in Issue 32102.

--
keywords: +3.7regression
nosy: +bbayles, gregory.p.smith, martin.panter
stage:  -> needs patch
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



[issue36354] Use CreateProcessW for Python 2.7 on Windows.

2019-03-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Is CreateProcessW already used in current 3.x?

--
nosy: +terry.reedy

___
Python tracker 

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



[issue36286] Random failure in test_idle

2019-03-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

#36389 appears to be a similar failure.

--

___
Python tracker 

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



[issue36339] test_ttk_guionly: test_traversal() fails randomly on AMD64 Windows8.1 Refleaks 2.7

2019-03-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

My guess is that the failure is in event_generate(key), as in #36286.  If so, 
this is a duplicate of the latter.

How often have you seen a failure?  For event_generate(''), etc, the 
failure time in my test script varies from 1000 to 100_000 tries and there have 
been no build-bot failures reported to me.

Now that I can make the failure happen, I still need to experiment with trying 
to stop it.

--
nosy: +serhiy.storchaka, terry.reedy

___
Python tracker 

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



[issue36403] AsyncIterator on 3.7: __aiter__ no longer honors finally blocks

2019-03-22 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +yselivanov

___
Python tracker 

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



[issue36322] Argument typo in dbm.ndbm.open

2019-03-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I have trouble understanding this post.  The parameter name is 'flag', not 
'flags' and there are no typos, including in ndbm.  The parameter name is 
singular because there is basically one flag with 4 possible values to indicate 
how to open.  The fact that gdbm has optional subflags does not require 
changing the name and I think it better to keep the documented API the same.

The only time 'flags' appears is in "Not all flags are valid for all versions 
of gdbm. The module constant open_flags is a string of supported flag 
characters."  Here, 'flags' refers to the multiple possible values for the 
'flag' argument, not the argument itself.

I think that this issue and the PR should be closed.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue36401] Readonly properties should be marked as such in help()

2019-03-22 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

@Raymond

+1 

but can we do the same thing with the PyGetSetDef declaration for the C Part?

--
nosy: +matrixise

___
Python tracker 

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



[issue36370] Check for PyErr_Occurred() after PyImport_GetModule().

2019-03-22 Thread Stefan Krah


Change by Stefan Krah :


--
keywords: +patch
pull_requests: +12454
stage: needs patch -> patch review

___
Python tracker 

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



[issue36322] Argument typo in dbm.ndbm.open

2019-03-22 Thread Marco Rougeth


Change by Marco Rougeth :


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

___
Python tracker 

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



[issue36401] Readonly properties should be marked as such in help()

2019-03-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

For property objects, we have to look at *fset* and *fdel* to find-out whether 
they are assignable:

>>> A.rop.fset is None
True
>>> A.wandr.fset is None
False

--

___
Python tracker 

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



[issue35155] Clarify Protocol Handlers in urllib.request Docs

2019-03-22 Thread miss-islington


miss-islington  added the comment:


New changeset 868581ee7687ad25af70c0cb9cd6a0f2077e6422 by Miss Islington (bot) 
in branch '3.7':
bpo-35155: clarify protocol handler method naming (GH-10313)
https://github.com/python/cpython/commit/868581ee7687ad25af70c0cb9cd6a0f2077e6422


--

___
Python tracker 

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



[issue36311] Flaw in Windows code page decoder for large input

2019-03-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I have 24G if all working and would be willing to try to run a test case.

--
nosy: +terry.reedy
stage:  -> test needed

___
Python tracker 

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



[issue35155] Clarify Protocol Handlers in urllib.request Docs

2019-03-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12452

___
Python tracker 

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



[issue35155] Clarify Protocol Handlers in urllib.request Docs

2019-03-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12451
stage: resolved -> patch review

___
Python tracker 

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



[issue35155] Clarify Protocol Handlers in urllib.request Docs

2019-03-22 Thread Senthil Kumaran


Senthil Kumaran  added the comment:

We could backport this to older versions too. This documentation change is 
helpful, and backporting this will help with future backport patches against 
these files.

--
status: closed -> open

___
Python tracker 

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



[issue36402] test_threading: test_threads_join_2() failed with "Fatal Python error: Py_EndInterpreter: not the last thread" on AMD64 FreeBSD CURRENT Shared 3.x

2019-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

As far as I remember, test_threads_join_2() was already unstable.

I created this issue to try to track if it's a regression or not.

If it's a regression, I would suggest to have a look at Eric Snow's recent 
commits.

At this point, I simply have no idea if the test fails exactly one in the 
lifetime of the buildbot worker, or if it started to fail frequently on this 
FreeBSD buildbot.

--
nosy: +pablogsal

___
Python tracker 

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



[issue36402] test_threading: test_threads_join_2() failed with "Fatal Python error: Py_EndInterpreter: not the last thread" on AMD64 FreeBSD CURRENT Shared 3.x

2019-03-22 Thread STINNER Victor


New submission from STINNER Victor :

https://buildbot.python.org/all/#/builders/168/builds/801

0:23:17 load avg: 5.00 [334/420/1] test_threading crashed (Exit code -6) -- 
running: test_tools (8 min 42 sec), test_multiprocessing_spawn (5 min 41 sec), 
test_zipfile (30 sec 787 ms)
Fatal Python error: Py_EndInterpreter: not the last thread

Current thread 0x000800acd000 (most recent call first):
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/support/__init__.py",
 line 2778 in run_in_subinterp
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/test/test_threading.py",
 line 917 in test_threads_join_2
  File 
"/usr/home/buildbot/python/3.x.koobs-freebsd-current/build/Lib/unittest/case.py",
 line 642 in run
  ...

The test crashed once, but then passed when run again in verbose mode 
("Re-running test 'test_threading' in verbose mode").

--
components: Tests
messages: 338622
nosy: vstinner
priority: normal
severity: normal
status: open
title: test_threading: test_threads_join_2() failed with "Fatal Python error: 
Py_EndInterpreter: not the last thread" on AMD64 FreeBSD CURRENT Shared 3.x
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



[issue36401] Readonly properties should be marked as such in help()

2019-03-22 Thread Raymond Hettinger


New submission from Raymond Hettinger :

It is common to create read-only properties with the '@property' decoration but 
the existing help() output doesn't annotate them as such.

One way to go is to annotate each one separately:

 |  --
 |  Data descriptors inherited from _IPAddressBase:
 |  
 |  compressed (read-only property) <== NEW ANNOTATION
 |  Return the shorthand version of the IP address as a string.
 |  
 |  exploded (read-only property)   <== NEW ANNOTATION
 |  Return the longhand version of the IP address as a string.
 |  
 |  reverse_pointer (read-only property)<== NEW ANNOTATION
 |  The name of the reverse DNS pointer for the IP address, e.g.:
 |  >>> ipaddress.ip_address("127.0.0.1").reverse_pointer
 |  '1.0.0.127.in-addr.arpa'
 |  >>> ipaddress.ip_address("2001:db8::1").reverse_pointer
 |  
'1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa'


Another way to go is to break the data descriptor section into two sections --- 
isolate those that define __set__ or __delete__ from those that don't.

For example, given this code:

class A:
'Variety of descriptors and method'

__slots__ = '_w', '_x'

def __init__(self, w: int, x: str):
'initializer'
self.w = w
self.x = x

@classmethod
def cm(cls, u):
'do something with u'
return cls(u * 4)

@staticmethod
def sm(v):
'do something with v'
return v * 3

@property
def rop(self):
'computed field'
return self._w * 2

@property
def wandr(self):
'managed attribute'
return self._w

@wandr.setter
def wandr(self, w):
self._w = w


Produce this help output:

Help on class A in module __main__:

class A(builtins.object)
 |  A(w: int, x: str)
 |  
 |  Variety of descriptors and method
 |  
 |  Methods defined here:
 |  
 |  __init__(self, w: int, x: str)
 |  initializer
 |  
 |  --
 |  Class methods defined here:
 |  
 |  cm(u) from builtins.type
 |  do something with u
 |  
 |  --
 |  Static methods defined here:
 |  
 |  sm(v)
 |  do something with v
 |  
 |  --
 |  Read-only descriptors defined here:<== NEW HEADING
 |  
 |  rop
 |  computed field
 |  
 |  --
 |  Mutable data descriptors defined here: <== NEW HEADING AND SECTION  
  
 |  
 |  wandr
 |  managed attribute

--
components: Library (Lib)
messages: 338621
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Readonly properties should be marked as such in help()
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue36396] Remove fgBg param of idlelib.config.GetHighlight()

2019-03-22 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue35155] Clarify Protocol Handlers in urllib.request Docs

2019-03-22 Thread Denton Liu


Change by Denton Liu :


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



[issue36396] Remove fgBg param of idlelib.config.GetHighlight()

2019-03-22 Thread miss-islington


miss-islington  added the comment:


New changeset 2d7798ad12456e137b3e3bc82a9824d0d3d45af0 by Miss Islington (bot) 
in branch '3.7':
bpo-36396: Remove fgBg param of idlelib.config.GetHighlight() (GH-12491)
https://github.com/python/cpython/commit/2d7798ad12456e137b3e3bc82a9824d0d3d45af0


--
nosy: +miss-islington

___
Python tracker 

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



[issue36396] Remove fgBg param of idlelib.config.GetHighlight()

2019-03-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset c1419578a18d787393c7ccee149e7c1fff17a99e by Terry Jan Reedy in 
branch 'master':
bpo-36396: Remove fgBg param of idlelib.config.GetHighlight() (GH-12491)
https://github.com/python/cpython/commit/c1419578a18d787393c7ccee149e7c1fff17a99e


--

___
Python tracker 

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



[issue36396] Remove fgBg param of idlelib.config.GetHighlight()

2019-03-22 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12450
stage: commit review -> patch review

___
Python tracker 

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



[issue36298] Lib/pyclbr.py crashes when the package spec cannot be determined by importlib

2019-03-22 Thread miss-islington


miss-islington  added the comment:


New changeset 5086589305ff5538709856b27314b68f06ae93db by Miss Islington (bot) 
(Brett Cannon) in branch 'master':
bpo-36298: Raise ModuleNotFoundError in pyclbr when a module can't be found 
(GH-12358)
https://github.com/python/cpython/commit/5086589305ff5538709856b27314b68f06ae93db


--
nosy: +miss-islington

___
Python tracker 

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



[issue35900] Add pickler hook for the user to customize the serialization of user defined functions and types.

2019-03-22 Thread Pierre Glaser


Change by Pierre Glaser :


--
pull_requests: +12449
stage:  -> patch review

___
Python tracker 

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



[issue35155] Clarify Protocol Handlers in urllib.request Docs

2019-03-22 Thread miss-islington


miss-islington  added the comment:


New changeset dd7c4ceed90792f711347024852d4cf883a9ab9e by Miss Islington (bot) 
(Denton Liu) in branch 'master':
bpo-35155: clarify protocol handler method naming (GH-10313)
https://github.com/python/cpython/commit/dd7c4ceed90792f711347024852d4cf883a9ab9e


--
nosy: +miss-islington

___
Python tracker 

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



[issue36326] Teach inpsect.getdoc() to read __slots__ with an optional data dictionary

2019-03-22 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
title: Build-out help() to read __slots__ with an optional data dictionary -> 
Teach inpsect.getdoc() to read __slots__ with an optional data dictionary

___
Python tracker 

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



[issue36326] Build-out help() to read __slots__ with an optional data dictionary

2019-03-22 Thread Raymond Hettinger


Change by Raymond Hettinger :


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

___
Python tracker 

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



[issue35528] [DOC] [LaTeX] Sphinx 2.0 uses GNU FreeFont as default for xelatex

2019-03-22 Thread Julien Palard


Change by Julien Palard :


--
stage:  -> patch review

___
Python tracker 

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



[issue35528] [DOC] [LaTeX] Sphinx 2.0 uses GNU FreeFont as default for xelatex

2019-03-22 Thread Julien Palard


Julien Palard  added the comment:

Thanks a lot for the heads up jfbu!

Opened a PR here: https://github.com/python/psf-salt/pull/167

--

___
Python tracker 

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



[issue30670] pprint for dict in sorted order or insert order?

2019-03-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for the 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



[issue30670] pprint for dict in sorted order or insert order?

2019-03-22 Thread Raymond Hettinger

Raymond Hettinger  added the comment:


New changeset 96831c7fcf888af187bbae8254608cccb4d6a03c by Raymond Hettinger 
(Rémi Lapeyre) in branch 'master':
bpo-30670: Add pp function to the pprint module (GH-11769)
https://github.com/python/cpython/commit/96831c7fcf888af187bbae8254608cccb4d6a03c


--

___
Python tracker 

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



[issue36085] Enable better DLL resolution

2019-03-22 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue36400] Add activate script to venv root folder

2019-03-22 Thread Brett Cannon


Brett Cannon  added the comment:

I agree with Eric.

Thanks for the idea, Ivan, but I'm closing this as an idea we won't be pursuing.

--
nosy: +brett.cannon
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue36299] array: Deprecate 'u' type in array module

2019-03-22 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-03-22 Thread STINNER Victor


STINNER Victor  added the comment:

> I don't think calling APIs like _PyDict_CheckConsistency() is super useful.

I looked a multiple old issues which contain "visit_decref". Most of them are 
really strange crashes and were closed with a message like "we don't have 
enough info to debug, sorry". So honestly, I'm not sure of what is the most 
"efficient" way to detect corrupted objects.

I guess that we need a trade-off between completeness of the checks and the 
performance.

gc.enable_object_debugger(1) simply makes Python completely unusable. Maybe 
such very bad performance makes the feature basically useless. I'm not sure at 
this point.

I tried to find an old bug which mentioned "visit_decref", tried to 
reintroduced the fixed bug, but I'm not really convinced by my experimental 
tests so far.

That being said, I *like* your idea of reusing tp_traverse. Not only it fits 
very well into the gc module (I chose to put the new feature in the gc module 
on purpose), but it's closer to the existing "visit_decref crash". If someone 
gets a crash if visit_decref() and the object debugger uses tp_traverse, object 
debugger *will* catch the same bug. The expectation is to be able to get it 
early.

--

Oh by the way, why not using lower GC thresholds? I proposed this idea, but 
there are multiple issues with that. It can hide the bug (objects destroyed in 
a different order). It can also change the behavior of the application, which 
is linked to my previous point (again, objects destroyed in a different order).

That's how Serhiy Storchaka proposed the design of gc.enable_object_debugger(): 
traverse without touching the reference counter.
https://mail.python.org/pipermail/python-dev/2018-June/153860.html

Thanks Serhiy for this nice idea ;-)

--

___
Python tracker 

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



[issue36299] array: Deprecate 'u' type in array module

2019-03-22 Thread Stefan Krah


Stefan Krah  added the comment:

The funny thing is that array() already knows this:

>>> import array
>>> a = array.array("u", "123")
>>> memoryview(a).format
'w'

--

___
Python tracker 

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



[issue36299] array: Deprecate 'u' type in array module

2019-03-22 Thread Stefan Krah


Stefan Krah  added the comment:

array() uses struct module characters except for 'u'. PEP-3118 was 
supposed to be implemented in the struct module.

If array() continues to use 'u', the only sensible thing would be
to remove (or rename) 'a', 'u' and 'w' from PEP-3118.

--

___
Python tracker 

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



[issue36299] array: Deprecate 'u' type in array module

2019-03-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

array('u') is not tied with the legacy Unicode C API. It is possible to use the 
modern wchar_t based Unicode C API for it. See issue36346.

There are benefits from getting rid of the legacy Unicode C API, but not from 
array('u').

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue36299] array: Deprecate 'u' type in array module

2019-03-22 Thread Stefan Krah


Stefan Krah  added the comment:

Just to demonstrate what the format would look like, this is working
for an array of fixed bytes:

>>> x = xnd([b"123", b"23456"], dtype="fixed_bytes(size=10)")
>>> memoryview(x).format
'10s'


So the formats in the previous message would be '10u' and '10w'.

--

___
Python tracker 

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



[issue36299] array: Deprecate 'u' type in array module

2019-03-22 Thread Stefan Krah


Stefan Krah  added the comment:

I think the problem is still whether to use 'u' == UCS2 and 'w' == UCS4 like in 
PEP-3118.

For the project I'm currently working on I'd need these for buffer exports:

>>> from xnd import *
>>> x = xnd(["abc", "xyz"], dtype="fixed_string(10, 'utf16')")
>>> y = xnd(["abc", "xyz"], dtype="fixed_string(10, 'utf32')")
>>> 
>>> memoryview(x)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: type is not supported by the buffer protocol


The use case is not an array that represents a single utf16 string, but
an array *of* fixed strings with different encodings.

So x would be exported with format 'u' and y with format 'w'.

--

___
Python tracker 

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



[issue36233] xml ElementTree quotation marks of xml version string

2019-03-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue35284] Incomplete error handling in Python/compile.c:compiler_call()

2019-03-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I wonder how did you find this bug?

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



[issue36400] Add activate script to venv root folder

2019-03-22 Thread Eric V. Smith


Eric V. Smith  added the comment:

While I think this might have been a reasonable choice when this was first 
added, I think it's too late to change. We'd have to keep the files in bin (or 
Scripts) indefinitely because there are a zillion tutorials that talk about 
them. And having them in both places just leads to confusion.

--
nosy: +eric.smith
versions:  -Python 3.5, Python 3.6, Python 3.7, Python 3.9

___
Python tracker 

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



[issue36400] Add activate script to venv root folder

2019-03-22 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +vinay.sajip

___
Python tracker 

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



[issue36400] Add activate script to venv root folder

2019-03-22 Thread Ivan Marin

New submission from Ivan Marin :

Instead of keeping the activate script of a virtualenv created with venv on the 
bin folder, move the file or create a link to the root folder of the venv file. 
Even better if there´s a way to make it easier to make shell autocomplete 
faster.

The rationale is that every time a virtualenv has to be activated, the path to 
the virtualenv has to be typed plus the bin folder and the activate script 
name. Having on the root folder of the virtualenv saves a few keystrokes, that 
compound to a lot of work when one is activating venvs all day.

--
components: Library (Lib)
messages: 338604
nosy: Ivan Marin
priority: normal
severity: normal
status: open
title: Add activate script to venv root folder
type: enhancement
versions: Python 3.5, Python 3.6, 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



[issue36389] Add gc.enable_object_debugger(): detect corrupted Python objects in the GC

2019-03-22 Thread Inada Naoki


Inada Naoki  added the comment:

I don't think calling APIs like _PyDict_CheckConsistency() is super useful.  
Can the PR find bugs like issue33803 quickly?

I think calling tp_traverse is better.


static int
check_object(PyObject *obj, void *unused)
{
_PyObject_ASSERT(obj, Py_REFCNT(obj) > 0);
return 0;
}

static void
gc_check_object(PyGC_Head *gc)
{
PyObject *op = FROM_GC(gc);
_PyObject_ASSERT(op, Py_REFCNT(obj) > 0);
_PyObject_ASSERT(op, _PyObject_GC_IS_TRACKED(op));
Py_Type(op)->tp_traverse(op, (visitproc)check_object, NULL);
}

--

___
Python tracker 

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



[issue35284] Incomplete error handling in Python/compile.c:compiler_call()

2019-03-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset bdb9c497e177cdf881892de289b9d8a2b132f138 by Serhiy Storchaka 
(Zackery Spytz) in branch '3.7':
bpo-35284: Fix the error handling in the compiler's compiler_call(). (GH-10625) 
(GH-12496)
https://github.com/python/cpython/commit/bdb9c497e177cdf881892de289b9d8a2b132f138


--

___
Python tracker 

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



[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2019-03-22 Thread Brecht Machiels


Brecht Machiels  added the comment:

In order to adapt code to this change, can we assume that a NEWLINE token with 
an empty string only occurs right before the ENDMARKER?

--
nosy: +brechtm

___
Python tracker 

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



[issue22490] Using realpath for __PYVENV_LAUNCHER__ makes Homebrew installs fragile

2019-03-22 Thread Anders Hovmöller

Anders Hovmöller  added the comment:

I just discovered this ticket again and see that it's stuck! 

I have read through the thread but it's still a bit unclear what would be 
required to test this with homebrew like Guido says is needed for this to go 
forward. Is there anyone who can explain or better yet test?

--

___
Python tracker 

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



[issue36338] urlparse of urllib returns wrong hostname

2019-03-22 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

See also issue20271 that discusses the other format http://[::1]spam where ::1 
is returned as hostname. urlparse tries to parse the hostname as IPV6 address 
when there is [ and parses till ] at [0] thus "benign.com\[attacker.com]" is 
treated as a URL where attacker.com is assumed as the IPV6 hostname. I am not 
sure of the correct behavior. FWIW at least Java and golang return 
"benign.com[attacker.com]" and Ruby raises an exception that this is a bad URL.

Java

> (.getHost (java.net.URL. "http://benign.com\\[attacker.com];))
"benign.com\\[attacker.com]"

golang: https://play.golang.org/p/q8pTo9ySLby


[0] 
https://github.com/python/cpython/blob/c5c6cdada3d41148bdeeacfe7528327b481c5d18/Lib/urllib/parse.py#L199

--
nosy: +xtreak
stage: patch review -> 

___
Python tracker 

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



[issue36299] array: Deprecate 'u' type in array module

2019-03-22 Thread Inada Naoki


Change by Inada Naoki :


--
nosy: +ncoghlan, skrah, vstinner
stage: patch review -> 
title: Deprecate 'u' type in array module -> array: Deprecate 'u' type in array 
module

___
Python tracker 

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



[issue34506] Traceback logged when SSL handshake fails

2019-03-22 Thread lilydjwg


Change by lilydjwg :


--
nosy: +lilydjwg

___
Python tracker 

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



[issue36299] Deprecate 'u' type in array module

2019-03-22 Thread Inada Naoki


Inada Naoki  added the comment:

I found converting Py_UNICODE to Py_UCS4 wad happened, and reverted.
ref: https://bugs.python.org/issue13072

--

___
Python tracker 

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



[issue36299] Deprecate 'u' type in array module

2019-03-22 Thread Inada Naoki


Change by Inada Naoki :


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

___
Python tracker 

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



[issue24565] the f_lineno getter is broken

2019-03-22 Thread daniel hahler


Change by daniel hahler :


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



[issue36233] xml ElementTree quotation marks of xml version string

2019-03-22 Thread Stefan Behnel


Stefan Behnel  added the comment:

As a work-around, you can provide your own XML declaration (or not) and pass 
"xml_declaration=False" into ElementTree.write() to prevent it from adding one. 
UTF-8 encoded XML is ok without such a declaration.

--

___
Python tracker 

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



[issue36233] xml ElementTree quotation marks of xml version string

2019-03-22 Thread Stefan Behnel


Stefan Behnel  added the comment:

I concur with Serhiy that the bug is in OpenCV (or its parser project), and 
that it is best solved there. Otherwise, we would create a dependency on a 
future/recent Python version for exporting XML to it.

--

___
Python tracker 

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



[issue36299] Deprecate 'u' type in array module

2019-03-22 Thread Inada Naoki


Inada Naoki  added the comment:

https://mail.python.org/pipermail/python-dev/2019-March/156807.html

We may able to convert 'u' to wchar_t to int32_t and un-deprecate it.

--

___
Python tracker 

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



[issue36399] multiprocessing: Queue does not work in virtualenv but works fine in main interpreter

2019-03-22 Thread Bernt Røskar Brenna

Bernt Røskar Brenna  added the comment:

I also checked using 3.8 (built from commit 
1f58f4fa6a0e3c60cee8df4a35c8dcf3903acde8), and it works there, so it looks as 
if 3.7 is the problem.

> VENV38\Scripts\python.exe --version
Python 3.8.0a2+

> VENV38\Scripts\python.exe mp_queue_example.py
main, pid=8284, executable=D:\dev\eva_v_next\VENV38\Scripts\python.exe
process_worker, pid=16396, executable=D:\dev\cpython\PCbuild\win32\python.exe
submitting...
submitting 0
submitting 1
submitting 2
Executing job 0
Executing job 1
Executing job 2

--

___
Python tracker 

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



[issue36399] multiprocessing: Queue does not work in virtualenv but works fine in main interpreter

2019-03-22 Thread Bernt Røskar Brenna

Bernt Røskar Brenna  added the comment:

Versions:

> VENV\Scripts\python.exe --version
Python 3.7.2

> VENV36\Scripts\python.exe --version
Python 3.6.8

--

___
Python tracker 

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



[issue36399] multiprocessing: Queue does not work in virtualenv but works fine in main interpreter

2019-03-22 Thread SilentGhost


Change by SilentGhost :


--
nosy: +davin, pitrou

___
Python tracker 

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



[issue36399] multiprocessing: Queue does not work in virtualenv but works fine in main interpreter

2019-03-22 Thread Bernt Røskar Brenna

Bernt Røskar Brenna  added the comment:

I just checked using 3.6. The program does NOT hang when executed from a 3.6 
virtualenv. So this is a possible regression (or something could be messed up 
on my system).

D:\dev\eva_v_next>VENV36\Scripts\python.exe mp_queue_example.py
main, pid=28956, executable=D:\dev\eva_v_next\VENV36\Scripts\python.exe
process_worker, pid=8924, executable=D:\dev\eva_v_next\VENV36\Scripts\python.exe
submitting...
submitting 0
submitting 1
submitting 2
Executing job 0
Executing job 1
Executing job 2

--

___
Python tracker 

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



[issue36399] multiprocessing: Queue does not work in virtualenv but works fine in main interpreter

2019-03-22 Thread Bernt Røskar Brenna

New submission from Bernt Røskar Brenna :

When executing mp_queue_example.py in the system interpreter:

D:\dev\eva_v_next>d:\python372\python.exe mp_queue_example.py
main, pid=892, executable=d:\python372\python.exe
process_worker, pid=12848, executable=d:\python372\python.exe
submitting...
submitting 0
submitting 1
submitting 2
Executing job 0
Executing job 1
Executing job 2

When executing mp_queue_example.py in a virtualenv:

D:\dev\eva_v_next>VENV\Scripts\python.exe mp_queue_example.py
main, pid=25888, executable=D:\dev\eva_v_next\VENV\Scripts\python.exe
process_worker, pid=28144, executable=D:\dev\eva_v_next\VENV\Scripts\python.exe
submitting...
submitting 0
submitting 1
submitting 2

## Here it hangs, Ctrl-C gives this:

Process Process-1:
Traceback (most recent call last):
  File "D:\dev\eva_v_next\mp_queue_example.py", line 13, in process_worker
inp = input_q.get_nowait()
  File "D:\python372\lib\multiprocessing\queues.py", line 126, in get_nowait
return self.get(False)
  File "D:\python372\lib\multiprocessing\queues.py", line 100, in get
raise Empty
_queue.Empty

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\python372\lib\multiprocessing\process.py", line 297, in _bootstrap
self.run()
  File "D:\python372\lib\multiprocessing\process.py", line 99, in run
self._target(*self._args, **self._kwargs)
  File "D:\dev\eva_v_next\mp_queue_example.py", line 13, in process_worker
inp = input_q.get_nowait()
KeyboardInterrupt
Traceback (most recent call last):
  File "mp_queue_example.py", line 43, in 
main_process_experiment()
  File "mp_queue_example.py", line 39, in main_process_experiment
p.join()
  File "D:\python372\lib\multiprocessing\process.py", line 140, in join
res = self._popen.wait(timeout)
  File "D:\python372\lib\multiprocessing\popen_spawn_win32.py", line 80, in wait
res = _winapi.WaitForSingleObject(int(self._handle), msecs)
KeyboardInterrupt


---

mp_queue_example.py:

import multiprocessing as mp
from queue import Empty
import os
import sys
import time


def process_worker(input_q: mp.Queue):
print(f'process_worker, pid={os.getpid()}, executable={sys.executable}')
while True:
try:
inp = input_q.get_nowait()
if inp == 'STOP':
break
execute_job(inp)
except Empty:
pass


def execute_job(input_args):
print(f'Executing job {input_args}')


def main_process_experiment():
print(f"main, pid={os.getpid()}, executable={sys.executable}")
input_q = mp.Queue()

p = mp.Process(target=process_worker, args=(input_q, ))
p.start()
time.sleep(0.5)

print('submitting...')
for i in range(3):
print(f'submitting {i}')
input_q.put(i)
input_q.put('STOP')

p.join()


if __name__ == '__main__':
main_process_experiment()

--
components: Library (Lib)
files: mp_queue_example.py
messages: 338591
nosy: Bernt.Røskar.Brenna
priority: normal
severity: normal
status: open
title: multiprocessing: Queue does not work in virtualenv but works fine in 
main interpreter
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48228/mp_queue_example.py

___
Python tracker 

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



[issue21269] Provide args and kwargs attributes on mock call objects

2019-03-22 Thread Chris Withers


Chris Withers  added the comment:


New changeset b0df45e55dc8304bac0e3cad0225472b84190964 by Chris Withers (Kumar 
Akshay) in branch 'master':
bpo-21269: Provide args and kwargs attributes on mock call objects GH11807
https://github.com/python/cpython/commit/b0df45e55dc8304bac0e3cad0225472b84190964


--

___
Python tracker 

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



[issue23984] Documentation error: Descriptors

2019-03-22 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset cb2d71b28e5cac04bbd59b8b6dbec220c4da7beb by Raymond Hettinger 
(Miss Islington (bot)) in branch '3.7':
bpo-23984: Improve descriptor documentation (GH-1034) (GH-12459)
https://github.com/python/cpython/commit/cb2d71b28e5cac04bbd59b8b6dbec220c4da7beb


--

___
Python tracker 

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



[issue35284] Incomplete error handling in Python/compile.c:compiler_call()

2019-03-22 Thread Zackery Spytz


Change by Zackery Spytz :


--
pull_requests: +12446

___
Python tracker 

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



[issue33081] multiprocessing Queue leaks a file descriptor associated with the pipe writer

2019-03-22 Thread Yongzhi Pan


Yongzhi Pan  added the comment:

On macOS with Python 3.7.2, using pitrou's code, I suspect Python does not 
delete some semaphores used by Queue.

Run these: 

import multiprocessing
import os
import threading

os.system('lsof -p {} | grep -v txt'.format(os.getpid()))
q = multiprocessing.Queue()
q.put(1)
q.get()
threading.enumerate()
os.system('lsof -p {} | grep -v txt'.format(os.getpid()))
q.close()
threading.enumerate()
os.system('lsof -p {} | grep -v txt'.format(os.getpid()))

I see:
>>> import multiprocessing
>>> import os
>>> import threading
>>> 
>>> os.system('lsof -p {} | grep -v txt'.format(os.getpid()))
COMMAND   PID USER   FD   TYPE DEVICE  SIZE/OFF NODE NAME
Python  56029  tux  cwdDIR1,496  1927156 /Users/tux/Desktop
Python  56029  tux0u   CHR   16,2 0t2867183 2393 /dev/ttys002
Python  56029  tux1u   CHR   16,2 0t2867183 2393 /dev/ttys002
Python  56029  tux2u   CHR   16,2 0t2867183 2393 /dev/ttys002
0
>>> q = multiprocessing.Queue()
>>> q.put(1)
>>> q.get()
1
>>> threading.enumerate()
[<_MainThread(MainThread, started 4570830272)>, ]
>>> os.system('lsof -p {} | grep -v txt'.format(os.getpid()))
COMMAND   PID USER   FD TYPE DEVICE  SIZE/OFF NODE NAME
Python  56029  tux  cwd  DIR1,496  1927156 
/Users/tux/Desktop
Python  56029  tux0u CHR   16,2 0t2867914 2393 
/dev/ttys002
Python  56029  tux1u CHR   16,2 0t2867914 2393 
/dev/ttys002
Python  56029  tux2u CHR   16,2 0t2867914 2393 
/dev/ttys002
Python  56029  tux3 PIPE 0x5ab56e2f13ca4abb 16384  
->0x5ab56e2f13ca5a7b
Python  56029  tux4 PIPE 0x5ab56e2f13ca5a7b 16384  
->0x5ab56e2f13ca4abb
Python  56029  tux5r  PSXSEM  0t0  
/mp-oa1x27kb
Python  56029  tux6r  PSXSEM  0t0  
/mp-khu1swie
Python  56029  tux7r  PSXSEM  0t0  
/mp-pwrgzmzz
0
>>> q.close()
>>> threading.enumerate()
[<_MainThread(MainThread, started 4570830272)>]
>>> os.system('lsof -p {} | grep -v txt'.format(os.getpid()))
COMMAND   PID USER   FD TYPE DEVICE  SIZE/OFF NODE NAME
Python  56029  tux  cwd  DIR1,496  1927156 /Users/tux/Desktop
Python  56029  tux0u CHR   16,2 0t2869010 2393 /dev/ttys002
Python  56029  tux1u CHR   16,2 0t2869010 2393 /dev/ttys002
Python  56029  tux2u CHR   16,2 0t2869010 2393 /dev/ttys002
Python  56029  tux5r  PSXSEM  0t0  /mp-oa1x27kb
Python  56029  tux6r  PSXSEM  0t0  /mp-khu1swie
Python  56029  tux7r  PSXSEM  0t0  /mp-pwrgzmzz

The three PSXSEM persists even after some time. Is this some type of leakage?

--

___
Python tracker 

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



[issue35284] Incomplete error handling in Python/compile.c:compiler_call()

2019-03-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 97f5de01adf993aee17dcd26e22ae421d013f372 by Serhiy Storchaka 
(Zackery Spytz) in branch 'master':
bpo-35284: Fix the error handling in the compiler's compiler_call(). (GH-10625)
https://github.com/python/cpython/commit/97f5de01adf993aee17dcd26e22ae421d013f372


--

___
Python tracker 

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



[issue36398] A possible crash in structseq.c's structseq_repr()

2019-03-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 93e8012f2cabd84f30b52e19fd3dc557efa9f8af by Serhiy Storchaka 
(Zackery Spytz) in branch 'master':
bpo-36398: Fix a possible crash in structseq_repr(). (GH-12492)
https://github.com/python/cpython/commit/93e8012f2cabd84f30b52e19fd3dc557efa9f8af


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue36396] Remove fgBg param of idlelib.config.GetHighlight()

2019-03-22 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

There were two uses in IDLE and a few in the tests.

--
stage: patch review -> commit review

___
Python tracker 

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