[issue34037] asyncio: BaseEventLoop.close() shutdowns the executor without waiting causing leak of dangling threads

2019-09-08 Thread Kyle Stanley


Kyle Stanley  added the comment:

I've opened PR-15735 which applies the same functionality as Victor's PR-13786, 
but adds the public getter and setter methods (for both AbstractEventLoop and 
BaseEventLoop) as requested by Andrew. 

Since this is still causing intermittent CI failures from test_asyncio, I think 
it's important to implement these changes in some form in the near future.

--
priority: normal -> high

___
Python tracker 

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



[issue38015] inline function generates slightly inefficient machine code

2019-09-08 Thread Greg Price


Greg Price  added the comment:

(Just to help keep discussions together: some earlier discussion was on 
GH-15216 .)

Because is_small_int / IS_SMALL_INT is so small, there's not much cost in the 
source code to making it a macro (as GH-15710 did).

But I think it'd be a mistake to go a lot farther than that and convert 
significantly larger chunks of code like get_small_int to macros (as GH-15718 
would), unless the payoff were really commensurate.  It'd be better to focus 
optimization efforts where profiling shows a lot of time is really being spent.

--

___
Python tracker 

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



[issue38060] precedence (relational, logical operator)not working with single value

2019-09-08 Thread Tim Peters


Tim Peters  added the comment:

I'm sorry you're not satisfied with the answer, but I'm a bona fide expert on 
this and you're not going to get anyone to agree with your confusion here ;-)

But the bug tracker is not the right place for tutorials.  Please take this up 
on, e.g., the Python mailing list instead.  There is no bug here.

One hint:  in

EXPR1 or EXPR2

bool(EXPR1) is _always_ evaluated first.  It makes no difference at all to this 
whether EXPR1 is "x < y" or "1 + 2 + 3" or "9".  Trying to make a special case 
out of "a numerical value" is entirely in your own head:  the language does 
nothing of the sort.

   9 or (ANYTHING_AT_ALL)

always results in 9, for the same reason

   4+5 or (ANYTHING_AT_ALL)

always results in 9.  Whether the left-hand expression evaluating to 9 is a 
literal or a complex expression is irrelevant.

In the same way, e.g.,

   x = 9
and
   x = 4+6

both bind x to 9.  A numeric literal is just as much "an expression" as any 
other kind of expression.  "Single value" has nothing to do with this.

--

___
Python tracker 

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



[issue38060] precedence (relational, logical operator)not working with single value

2019-09-08 Thread Sangeeta M Chauhan


Sangeeta M Chauhan  added the comment:

i am not satisfied ..with your answer . as in the following expression   9
or 7 > "str" precedence must be given to relational operator . why is is
executing logical operator first??
if we write  4>9 or 7> "str" it works correct but if we replace first
condition(4>9) with a numeric value it is not giving correct output

On Mon, Sep 9, 2019 at 9:25 AM Tim Peters  wrote:

>
> Tim Peters  added the comment:
>
> It's working fine.  What do you expect?  For example,
>
> 9 or 7 > "str"
>
> groups as
>
> 9 or (7 > "str")
>
> 9 is evaluated for "truthiness" first, and since it's not 0 it's
> considered to be true.  That's enough to determine the result of "or", so
> (7 > "str") isn't evaluated at all.  9 is the result.
>
> This is all working as designed and as documented, so I'm closing this
> report.
>
> --
> nosy: +tim.peters
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--
title: precedence (relational,logical operator)not working with single value -> 
precedence (relational, logical operator)not working with single value

___
Python tracker 

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



[issue34037] asyncio: BaseEventLoop.close() shutdowns the executor without waiting causing leak of dangling threads

2019-09-08 Thread Kyle Stanley


Change by Kyle Stanley :


--
pull_requests: +15390
pull_request: https://github.com/python/cpython/pull/15735

___
Python tracker 

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



[issue38060] precedence (relational, logical operator)not working with single value

2019-09-08 Thread Tim Peters


Tim Peters  added the comment:

It's working fine.  What do you expect?  For example,

9 or 7 > "str"

groups as

9 or (7 > "str")

9 is evaluated for "truthiness" first, and since it's not 0 it's considered to 
be true.  That's enough to determine the result of "or", so (7 > "str") isn't 
evaluated at all.  9 is the result.

This is all working as designed and as documented, so I'm closing this report.

--
nosy: +tim.peters
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



[issue38060] precedence (relational, logical operator)not working with single value

2019-09-08 Thread Sangeeta M Chauhan


New submission from Sangeeta M Chauhan :

precendence betweeen relational and logical operators not working properly if 
expression contains single values instead of sub expressions. . Please see 
attached file

--
components: Interpreter Core
files: pythonBug.py
messages: 351344
nosy: sangeetamchauhan
priority: normal
severity: normal
status: open
title: precedence (relational,logical operator)not working with single value
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file48600/pythonBug.py

___
Python tracker 

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



[issue37790] subprocess.Popen() is extremely slow

2019-09-08 Thread Nick Henderson


Nick Henderson  added the comment:

We have recently bumped into a similar problem. Using FreeBSD, subprocess calls 
were taking more than 10 times the usual time to execute after migrating to 
python3.6. After some digging, the default for 'close_fds' was changed to 
'True'. On linux, this actually made things faster, but for unix, much slower. 
Passing 'close_fds=False' solved this for us.

--
nosy: +nickhendo

___
Python tracker 

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



[issue16649] Add a PyCF_DISPLAY_EXPRESSION_RESULTS flag

2019-09-08 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue27718] help('signal') incomplete (e.g: signal.signal not visible)

2019-09-08 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue21024] PyTypeObject tp_doc is char* instead of const char*

2019-09-08 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

tp_doc is now const char*. So this should be closed.

--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue36018] Add a Normal Distribution class to the statistics module

2019-09-08 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset cc1bdf91d53b1a4751be84ef607e24e69a327a9b by Raymond Hettinger in 
branch '3.8':
[3.8] bpo-36018: Address more reviewer feedback (GH-15733) (GH-15734)
https://github.com/python/cpython/commit/cc1bdf91d53b1a4751be84ef607e24e69a327a9b


--

___
Python tracker 

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



[issue36018] Add a Normal Distribution class to the statistics module

2019-09-08 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
pull_requests: +15389
pull_request: https://github.com/python/cpython/pull/15734

___
Python tracker 

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



[issue36018] Add a Normal Distribution class to the statistics module

2019-09-08 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 4db25d5c39e369f4b55eab52dc8f87f390233892 by Raymond Hettinger in 
branch 'master':
bpo-36018: Address more reviewer feedback (GH-15733)
https://github.com/python/cpython/commit/4db25d5c39e369f4b55eab52dc8f87f390233892


--

___
Python tracker 

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



[issue36018] Add a Normal Distribution class to the statistics module

2019-09-08 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
pull_requests: +15388
pull_request: https://github.com/python/cpython/pull/15733

___
Python tracker 

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



[issue24416] Have date.isocalendar() return a structseq instance

2019-09-08 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

[Paul Ganssle]
> "grab a single component" use is overwhelmingly the common case,
> I think it's worth it in the end.

Dong-hee Na, you can now go ahead with the patch.  

The relevant function is date_isocalendar() located in Modules/_datetime.c.  
Model the structseq code after the PyFloat_GetInfo() function in 
Objects/floatobject.h.

When you have a PR with a doc update and tests, please request my review and I 
help you wrap it up.

Ask questions here if you get stuck.  Good luck!

--

___
Python tracker 

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



[issue37970] urllib.parse docstrings incomplete

2019-09-08 Thread sushma


sushma  added the comment:

got it - thanks for the detailed explanation! I'll go ahead and create a PR soon

--

___
Python tracker 

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



[issue38052] Include sspipe Module with Core Python

2019-09-08 Thread Juan Telleria


Juan Telleria  added the comment:

There was a positive response from package mantainers for this issue :)

See: https://github.com/sspipe/sspipe/issues/4

>> is the module mature and stable?
I am using this module in my own projects for a while and it satisfies my own 
requirements. However, I think if we want to propose it as a PEP, we should 
plan for a 1.0.0 release with some improvements on the API and documentation 
and tests.

>> does it have an FOSS licence compatible with Python, and if not, are the 
>> authors willing to re-licence it?
I am willing to re-licence it.

>> are the authors willing to donate the module to Python?
Yes

>> are the authors happy to change their release schedule to match Python?
Yes

>> are they happy to adhere to Python's policy on backwards compatibility and 
>> new functionality?
Yes

>> are you (or the authors) willing to write a PEP proposing to add this module 
>> to the standard library? https://www.python.org/dev/peps/
Yes, with your contribution.

>> can you find a Core Developer willing to sponsor this PEP? (You can probably 
>> ask on the Python-Dev or Python-Ideas mailing lists, or the Python Discuss, 
>> or face-to-face in person at a sprint, etc.)
We may try.

I will request support for this project in Python-Dev and Pytgon-Ideas during 
this week by sending an e-mail.

Thank you also Steven for your bullet points to complete!

Juan

--

___
Python tracker 

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



[issue38059] Using sys.exit() over exit() in inspect.py

2019-09-08 Thread signing_agreement


New submission from signing_agreement :

The change is arguably trivial, but given that this is a code change in a 
commonly-used module, I was asked to create an issue and a NEWS entry for it.

--
components: Library (Lib)
messages: 351336
nosy: signing_agreement
priority: normal
pull_requests: 15387
severity: normal
status: open
title: Using sys.exit() over exit() in inspect.py
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



[issue24416] Have date.isocalendar() return a structseq instance

2019-09-08 Thread Paul Ganssle

Paul Ganssle  added the comment:

I have compiled both versions with optimizations on, looks like the gap gets a 
bit smaller (percentage-wise) after that:

   benchmark|  master (ns)  |  PR 15633 (ns)  |  Δ (%)
+---+-+--
call only (datetime)| 73 (±3)   | 92.3 (±7)   |   26
constructor + call (datetime)   |228 (±9)   | 260 (±16)   |   14
timedelta + call (datetime) |108 (±5)   | 128 (±9)|   18

If this were something fundamental like a performance regression in building a 
tuple or constructing a dictionary or something I'd be concerned, but this just 
reinforces my feeling that, on balance, this is worth it, and that we are 
probably not going to need a "fast path" version of this.

--

___
Python tracker 

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



[issue38057] Docs: source code don't can be translate

2019-09-08 Thread Adorilson Bezerra


Adorilson Bezerra  added the comment:

I'm not using the Sphinx itself. I'm just a translator.

--

___
Python tracker 

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



[issue38057] Docs: source code don't can be translate

2019-09-08 Thread Ammar Askar


Ammar Askar  added the comment:

What version of Sphinx are you using? As far as I know, Sphinx supports 
internationalization for autodoc, so this should be possible.

--
nosy: +ammar2

___
Python tracker 

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



[issue38021] pep425 tag for AIX is inadequate

2019-09-08 Thread Michael Felt


Michael Felt  added the comment:

When testing the PR with --with-pydebug I started getting the following error:

root@x066:[/data/prj/python/git/pr-test]./python '-X' 'tracemalloc' -m test 
test_venv
Run tests sequentially
0:00:00 [1/1] test_venv
test test_venv failed -- Traceback (most recent call last):
  File "/data/prj/python/git/pr-test/Lib/test/test_venv.py", line 501, in 
test_with_pip
self.do_test_with_pip(False)
  File "/data/prj/python/git/pr-test/Lib/test/test_venv.py", line 459, in 
do_test_with_pip
self.assertEqual(err, "")
AssertionError: '/data/prj/python/git/pr-test/Lib/_aix_sup[277 chars]t,\n' != ''
- /data/prj/python/git/pr-test/Lib/_aix_support.py:47: ResourceWarning: 
unclosed file <_io.TextIOWrapper name=4 encoding='ISO8859-1'>
-   return aix_pep425()
- Object allocated at (most recent call last):
-   File "/data/prj/python/git/pr-test/Lib/subprocess.py", lineno 837
- self.stdout = io.TextIOWrapper(self.stdout,


test_venv failed in 34 sec 401 ms

== Tests result: FAILURE ==

1 test failed:
test_venv

Total duration: 34 sec 485 ms
Tests result: FAILURE

+++ capturing some debug output:
root@x066:[/data/prj/python/git/pr-test]cat /tmp/test_venv.debug
env:/tmp/tmppcl06489/bin/python '-X', 'tracemalloc', '-W', 
'ignore::DeprecationWarning', '-I', -m pip --version
err:/data/prj/python/git/pr-test/Lib/_aix_support.py:47: ResourceWarning: 
unclosed file <_io.TextIOWrapper name=4 encoding='ISO8859-1'>
  return aix_pep425()
Object allocated at (most recent call last):
  File "/data/prj/python/git/pr-test/Lib/subprocess.py", lineno 837
self.stdout = io.TextIOWrapper(self.stdout,

out:pip 19.2.1 from /tmp/tmppcl06489/lib/python3.9/site-packages/pip (python 
3.9)
+++

I thought -
p = Popen()

p.wait()

that the call p.wait() was waiting for the process to complete (and close 
files).
Apparently, that is not the case.

Note: changing p.wait() to p.wait is not the solution: the message changes to:
AssertionError: '/data/prj/python/git/pr-test/Lib/subproce[609 chars]t,\n' != ''
- /data/prj/python/git/pr-test/Lib/subprocess.py:933: ResourceWarning: 
subprocess 11337774 is still running
-   _warn("subprocess %s is still running" % self.pid,
- Object allocated at (most recent call last):
-   File "/data/prj/python/git/pr-test/Lib/_aix_support.py", lineno 35
- p = Popen(["/usr/bin/lslpp", "-Lqc", "bos.mp64"],
- /data/prj/python/git/pr-test/Lib/_aix_support.py:47: ResourceWarning: 
unclosed file <_io.TextIOWrapper name=4 encoding='ISO8859-1'>
-   return aix_pep425()
- Object allocated at (most recent call last):
-   File "/data/prj/python/git/pr-test/Lib/subprocess.py", lineno 837
- self.stdout = io.TextIOWrapper(self.stdout,

root@x066:[/data/prj/python/git/pr-test]cat /tmp/test_venv.debug
env:/tmp/tmp8wpnz193/bin/python '-X', 'tracemalloc', '-W', 
'ignore::DeprecationWarning', '-I', -m pip --version
err:/data/prj/python/git/pr-test/Lib/subprocess.py:933: ResourceWarning: 
subprocess 11337774 is still running
  _warn("subprocess %s is still running" % self.pid,
Object allocated at (most recent call last):
  File "/data/prj/python/git/pr-test/Lib/_aix_support.py", lineno 35
p = Popen(["/usr/bin/lslpp", "-Lqc", "bos.mp64"],
/data/prj/python/git/pr-test/Lib/_aix_support.py:47: ResourceWarning: unclosed 
file <_io.TextIOWrapper name=4 encoding='ISO8859-1'>
  return aix_pep425()
Object allocated at (most recent call last):
  File "/data/prj/python/git/pr-test/Lib/subprocess.py", lineno 837
self.stdout = io.TextIOWrapper(self.stdout,

out:pip 19.2.1 from /tmp/tmp8wpnz193/lib/python3.9/site-packages/pip (python 
3.9)

I was able to resolve the issue by changing Popen() to run():

oot@x066:[/data/prj/python/git/pr-test]diff -u 
/data/prj/python/git/pr-test/Lib/_aix_support.py /tmp/_aix_support.py
--- /data/prj/python/git/pr-test/Lib/_aix_support.py2019-09-08 
16:24:51.0 +
+++ /tmp/_aix_support.py2019-09-08 16:17:14.0 +
@@ -1,7 +1,7 @@
  """Shared AIX support functions."""

  import sys
- from subprocess import Popen, PIPE, DEVNULL
+ from subprocess import run
  from sysconfig import get_config_var as get_var

  _is_32bit = sys.maxsize == 2147483647
@@ -32,10 +32,9 @@
  The pep425 platform tag for AIX becomes:
  AIX.VRTL.YYWW.SZ, e.g., AIX.6107.1415.32
  """
- p = Popen(["/usr/bin/lslpp", "-Lqc", "bos.mp64"],
-   universal_newlines=True, stdout=PIPE, stderr=DEVNULL)
- _lslppLqc = p.stdout.read().strip().split(":")
- p.wait
+ p = run(["/usr/bin/lslpp", "-Lqc", "bos.mp64"],
+ capture_output=True, text=True)
+ _lslppLqc = p.stdout.strip().split(":")

  (lpp, vrmf, bd) = list(_lslppLqc[index] for index in [0, 2, -1])
  assert lpp == "bos.mp64", "%s != %s" % (lpp, "bos.mp64")

Don't know if this is a bug in Popen(), or just an error in my use of Popen(). 
Happy that using run() solves it!

--

___
Python tracker 

[issue38058] Tutorial: 4.2. for Statements

2019-09-08 Thread Kevin


Change by Kevin :


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



[issue38058] Tutorial: 4.2. for Statements

2019-09-08 Thread Kevin


New submission from Kevin :

>>> # Measure some strings:
... words = ['cat', 'window', 'defenestrate']
>>> for w in words:
... print(w, len(w))
...
cat 3
window 6
defenestrate 12


If you need to modify the sequence you are iterating over while inside the loop 
(for example to duplicate selected items), it is recommended that you first 
make a copy. Iterating over a sequence does not implicitly make a copy. The 
slice notation makes this especially convenient:


>> for w in words[:]:  # Loop over a slice copy of the entire list.
... if len(w) > 6:
... words.insert(0, w)
...
>>> words
['defenestrate', 'cat', 'window', 'defenestrate']

words is a tuple and is immutable

--
assignee: docs@python
components: Documentation
messages: 351331
nosy: Derangedn00b, docs@python
priority: normal
severity: normal
status: open
title: Tutorial: 4.2. for Statements
type: compile error
versions: Python 3.7

___
Python tracker 

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



[issue38057] Docs: source code don't can be translate

2019-09-08 Thread Adorilson Bezerra

New submission from Adorilson Bezerra :

The source code examples in documentation doesn't can be translated because it 
doesn't included in po files (and after in transifex).

It would be wonderful if we can to translate the code:

class MyClass:
"""A simple example class"""
i = 12345

def f(self):
return 'hello world'

to:

class MinhaClasse:
"""Um exemplo simples de classe"""
i = 12345
def f(self):
return 'olá, mundo'

--
assignee: docs@python
components: Documentation
messages: 351330
nosy: adorilson, docs@python
priority: normal
severity: normal
status: open
title: Docs: source code don't can be translate
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



[issue38056] Add examples for common text encoding Error Handlers

2019-09-08 Thread Ma Lin


Change by Ma Lin :


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

___
Python tracker 

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



[issue38056] Add examples for common text encoding Error Handlers

2019-09-08 Thread Ma Lin

New submission from Ma Lin :

Text descriptions about `Error Handlers` are not very friendly to novices.
https://docs.python.org/3/library/codecs.html#error-handlers

For example:

'xmlcharrefreplace'
Replace with the appropriate XML character reference (only for encoding).  
Implemented in :func:`xmlcharrefreplace_errors`. 

'backslashreplace'
Replace with backslashed escape sequences. Implemented in 
:func:`backslashreplace_errors`.

'namereplace'
Replace with ``\N{...}`` escape sequences (only for encoding).  Implemented 
in :func:`namereplace_errors`.

Novices may not know what these are.
Giving some examples may help the reader to understand more intuitively.
The effect picture is attached.

I picked two characters:
ß  https://www.compart.com/en/unicode/U+00DF
♬ https://www.compart.com/en/unicode/U+266C

--
assignee: docs@python
components: Documentation
files: effect.png
messages: 351329
nosy: Ma Lin, docs@python
priority: normal
severity: normal
status: open
title: Add examples for common text encoding Error Handlers
versions: Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file48599/effect.png

___
Python tracker 

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



[issue38055] Starting multiprocessing.Process causes FileNotFoundError

2019-09-08 Thread Donny Brown


New submission from Donny Brown :

Starting multiprocessing.Process causes FileNotFoundError in certain case:

```
import multiprocessing as mp
import time

def demo(f):
print(f)

def main():
cxt=mp.get_context('spawn')
f=cxt.Value('i', 0)
p=cxt.Process(target=demo, args=[f])
p.start()

return p

if __name__ == "__main__":
p=main()
p.join()
```

In this example, 'f' is supposed to stay in memory since it is referred by 
p._args. However, starting the process raises FileNotFoundError once there is 
not explicit reference to the arguments passed to the new process in the 
original process.

--
components: Interpreter Core
files: test.py
messages: 351328
nosy: Donny Brown, davin, pitrou
priority: normal
severity: normal
status: open
title: Starting multiprocessing.Process causes FileNotFoundError
versions: Python 3.7
Added file: https://bugs.python.org/file48598/test.py

___
Python tracker 

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



[issue38054] enhance pdb.set_trace() to run when the specified condition is true

2019-09-08 Thread Alexander Ulyanov


Change by Alexander Ulyanov :


--
type:  -> enhancement

___
Python tracker 

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



[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2019-09-08 Thread Ryan Hiebert


Change by Ryan Hiebert :


--
nosy: +ryanhiebert

___
Python tracker 

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



[issue24416] Have date.isocalendar() return a structseq instance

2019-09-08 Thread Paul Ganssle

Paul Ganssle  added the comment:

I haven't had time to try this with an optimized build, I have done a few more 
benchmarks using a standard build, I'm seeing almost a 50% regression on 
isocalendar() calls, but the picture is a little rosier if you consider the 
fact that you need to construct a `date` or `datetime` object in the first 
place and anyone concerned with performance will likely be making exactly one 
`isocalendar()` call per datetime object. The common case is that they 
construct the datetime with a datetime literal or something equivalent. The 
"worst case scenario" is that they construct a single "seed" datetime and then 
construct many new datetimes with faster operations like adding a timedelta.

I have compared the following cases:

call only: -s 'import datetime; dt = datetime.datetime(2019, 1, 1)' 
'dt.isocalendar()'
constructor + call: -s 'import datetime' 'dt = datetime.datetime(2019, 1, 1); 
dt.isocalendar()'
timedelta + call: -s 'import datetime; dt = datetime.datetime(2019, 1, 1); td = 
timedelta(days=1)' '(dt + td).isocalendar()'


The results are summarized below, the most likely real practical impact on 
performance-sensitive "hot loops" would be a 29% performance regression *if* 
isocalendar() is the bottleneck:


   benchmark|  master (ns)  |  PR 15633 (ns)  |  Δ (%)
+---+-+--
call only (datetime)|349 (±14)  | 511 (±22)   |   46
constructor + call (datetime)   |989 (±48)  |1130 (±50)   |   14
timedelta + call (datetime) |550 (±14)  | 711 (±22)   |   29


The numbers for `datetime.date` are basically similar:

   benchmark|  master (ns)  |  PR 15633 (ns)  |  Δ (%)
+---+-+--
call only (date)|360 (±18)  | 530 (±41)   |   47
constructor + call (date)   |824 (±17)  | 975 (±29)   |   18
timedelta + call (datetime) |534 (±20)  | 685 (±24)   |   28


This is a bit disheartening, but I think the fact that these performance 
sensitive situations are rare and the "grab a single component" use is 
overwhelmingly the common case, I think it's worth it in the end.

If there are significant complaints about the performance regression, we may be 
able to create a variant method similar to the way that `chain` has 
`chain.from_iterables`, something like `dt.isocalendar.as_tuple()` for the 
performance-sensitive folks. That said, that's very YAGNI, we should not do 
that unless someone comes forward with a real use case that will be adversely 
affected here.

--

___
Python tracker 

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



[issue38054] enhance pdb.set_trace() to run when the specified condition is true

2019-09-08 Thread Alexander Ulyanov


Change by Alexander Ulyanov :


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

___
Python tracker 

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



[issue38005] Coercing strings and non-integer numbers to interpreter ID and channel ID

2019-09-08 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
type: behavior -> crash

___
Python tracker 

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



[issue38005] Coercing strings and non-integer numbers to interpreter ID and channel ID

2019-09-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There is more serious issue: InterpreterID and ChannelID are declared as int 
subclasses, but actually they have incompatible structure, so using them as int 
causes a crash. For example, the following code is crashed:

float(int(id)) == id

--

___
Python tracker 

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



[issue36946] Possible signed integer overflow in slice handling

2019-09-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you Zackery and HongWeipeng 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



[issue38054] enhance pdb.set_trace() to run when the specified condition is true

2019-09-08 Thread Alexander Ulyanov


New submission from Alexander Ulyanov :

Through out my experience with python debugger, I often found myself creating 
if-statements around set_trace() instructions. This patch introduces a key-word 
argument that allows to pass in a boolean or a condition that evaluates to 
boolean to control whether pdb.set_trace() command needs to be executed.

--
messages: 351324
nosy: alex-ulnv
priority: normal
severity: normal
status: open
title: enhance pdb.set_trace() to run when the specified condition is true
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



[issue36946] Possible signed integer overflow in slice handling

2019-09-08 Thread miss-islington


miss-islington  added the comment:


New changeset 021e5db20bc19d678a5b94247a5cdcf689eff006 by Miss Islington (bot) 
in branch '3.7':
bpo-36946:Fix possible signed integer overflow when handling slices. (GH-15639)
https://github.com/python/cpython/commit/021e5db20bc19d678a5b94247a5cdcf689eff006


--

___
Python tracker 

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



[issue38005] Coercing strings and non-integer numbers to interpreter ID and channel ID

2019-09-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I have doubts about accepting floats and bytes objects in all function that 
accept InterpreterID or ChannelID. Is it intentional? There are tests for 
strings.

--

___
Python tracker 

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



[issue36946] Possible signed integer overflow in slice handling

2019-09-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15383
pull_request: https://github.com/python/cpython/pull/15729

___
Python tracker 

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



[issue36946] Possible signed integer overflow in slice handling

2019-09-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 3c87a667bb367ace1de6bd1577fdb4f66947da52 by Serhiy Storchaka 
(HongWeipeng) in branch 'master':
bpo-36946:Fix possible signed integer overflow when handling slices. (GH-15639)
https://github.com/python/cpython/commit/3c87a667bb367ace1de6bd1577fdb4f66947da52


--

___
Python tracker 

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



[issue38007] Regression: name of PyType_Spec::slots conflicts with Qt macro

2019-09-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This is a major breaking change. It may need changing the Python version to 4.0.

I suggest you to not use global macros without prefixes and undefine the 
conflicting one before using the Python C API.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38053] Update plistlib documentation

2019-09-08 Thread hai shi


hai shi  added the comment:

>* Remove notes about the new API being added in 3.4 since 3.4 is no longer 
>supported
  Related bpo in issue14455

--
nosy: +shihai1991

___
Python tracker 

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



[issue38038] Remove urllib.parse._splittype from xmlrpc.client

2019-09-08 Thread Dong-hee Na


Change by Dong-hee Na :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue38038] Remove urllib.parse._splittype from xmlrpc.client

2019-09-08 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 9c4c459ac66c86a4511c8fec1997e8760e15ec17 by Serhiy Storchaka 
(Dong-hee Na) in branch 'master':
bpo-38038: Remove urllib.parse._splittype from xmlrpc.client. (GH-15703)
https://github.com/python/cpython/commit/9c4c459ac66c86a4511c8fec1997e8760e15ec17


--

___
Python tracker 

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



[issue38048] unususal behavior

2019-09-08 Thread Gaurav Kumar Pandit


Gaurav Kumar Pandit  added the comment:

Oh thanks.May I know the typo error

Sent from Mail for Windows 10

From: Zachary Ware
Sent: 08 September 2019 02:24 AM
To: grvkmrpan...@gmail.com
Subject: [issue38048] unususal behavior

Zachary Ware  added the comment:

To reiterate, there is no bug in Python here.  The code that you attached here 
has a typo that turns this example into an infinite loop, and the Windows 
Command Prompt will happily take any input and echo it, even though Python is 
not actually consuming any of it.

--

___
Python tracker 

___

--

___
Python tracker 

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