[issue31969] re.groups() is not checking the arguments

2017-11-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

No, it should not throw error that there is no any optional match.

It is not easy to check if there is optional match. For example, the pattern 
'(a)|(b)' contains optional matches, while the group in the pattern '()?' 
always matches.

--

___
Python tracker 

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



[issue24132] Direct sub-classing of pathlib.Path

2017-11-08 Thread Paul Moore

Paul Moore  added the comment:

@elguavas the problem is, no-one has proposed a patch. There's not likely to be 
much movement on this until someone provides one.

--

___
Python tracker 

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



[issue31811] async and await missing from keyword list in lexical analysis doc

2017-11-08 Thread Tom Floyer

Change by Tom Floyer :


--
pull_requests:  -4095

___
Python tracker 

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



[issue31764] sqlite3.Cursor.close() crashes in case the Cursor object is uninitialized

2017-11-08 Thread Oren Milman

Change by Oren Milman :


--
pull_requests: +4288

___
Python tracker 

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



[issue31972] Inherited docstrings for pathlib classes are confusing

2017-11-08 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue31975] Add a default filter for DeprecationWarning in __main__

2017-11-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Thus the following will start emitting DeprecationWarning by default again 
> (as they did in 2.6 and earlier):
> - experiments at the REPL

This is backwards.  If there's one place where you *don't* want stderr polluted 
with warnings (or any kind of logging), it's an interactive prompt.

More generally, I think this entire proposal is unsound, and needs a PEP 
written to make its case clearly.

--
nosy: +pitrou

___
Python tracker 

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



[issue31764] sqlite3.Cursor.close() crashes in case the Cursor object is uninitialized

2017-11-08 Thread Oren Milman

Oren Milman  added the comment:

I opened #4333 for 2.7, but it is quite straightforward.. Am i missing 
something?

--

___
Python tracker 

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



[issue31971] idle_test: failures on x86 Windows7 3.x

2017-11-08 Thread STINNER Victor

STINNER Victor  added the comment:

> I am completely puzzled at the sudden failure on one machine.

The "x86 Windows7 3.x" buildbot worker is very slow. So this bug is probably a 
race condition which is hard to trigger on a fast machine.

--

___
Python tracker 

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



[issue31764] sqlite3.Cursor.close() crashes in case the Cursor object is uninitialized

2017-11-08 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset cd66d6d632b4a8190e97f265ee163f11b5ae38e6 by Victor Stinner (Oren 
Milman) in branch '2.7':
bpo-31764: Prevent a crash in sqlite3.Cursor.close() in case the Cursor object 
is uninitialized (GH-4333)
https://github.com/python/cpython/commit/cd66d6d632b4a8190e97f265ee163f11b5ae38e6


--

___
Python tracker 

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



[issue31764] sqlite3.Cursor.close() crashes in case the Cursor object is uninitialized

2017-11-08 Thread STINNER Victor

STINNER Victor  added the comment:

Thank you for the backport Oren, I already merged it into Python 2.7.

Thanks Oren Milman for your bug report *and* for your bug fix!


> I opened #4333 for 2.7, but it is quite straightforward.. Am i missing 
> something?

Sorry, I had to say that "git cherry-pick" failed on 2.7. I didn't check why ;-)

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



[issue31853] Use super().method instead of socket.method in SSLSocket

2017-11-08 Thread Berker Peksag

Change by Berker Peksag :


--
nosy: +earonesty

___
Python tracker 

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



[issue31978] make it simpler to round fractions

2017-11-08 Thread Wolfgang Maier

New submission from Wolfgang Maier :

Hi,

because of floating point inaccuracies it is suboptimal to use round(int1/int2) 
for rounding of a fraction.
fractions.Fraction, OTOH, offers exact rounding through its implementation of 
__round__, but using it requires users to create a fractions.Fraction instance 
from two ints first.
The algorithm used by Fraction.__round__ is, essentially, the same as the one 
used in the pure-Python version of the datetime._divide_and_round module 
(which, in turn, is taken from a comment by Mark Dickinson in 
Objects/longobject.c).

My suggestion is to promote this algorithm to an exposed function in the 
fractions module (actually, it may make sense to have it in the math module 
instead - compare the case of the gcd function, which started out in fractions, 
but is now in transition to math) so that it can be used by Fraction.__round__, 
but also any other code.

Attached is a patch demonstrating the idea. In addition, to the above benefit, 
it turns out to actually speed up Fraction.__round__ substantially, when 
ndigits is not None because it then avoids the generation of temporary Fraction 
instances, and, in my hands at least, it even makes the general (ndigits=None) 
case slightly faster (apparently the copied datetime._divide_and_round code is 
more efficient than the original in Fraction.__round__).

There is one slight additional tweak in the patch: in the case of ndigits < 0, 
it returns an int, not a Fraction (see test_fractions modification to make it 
pass).
I think this is actually a mistake in the current Fraction.__round__, which 
already promotes the result to int in the general case. This change speeds up 
round to the next ndigits power of ten by ~ a factor of 5 in my hands because 
no new Fraction needs to be instantiated anymore.

A full PR could include having pure-Python datetime import the function from 
fractions instead of rolling its own, but I'd first like to hear whether you 
think this should go into math instead.

--
components: Library (Lib)
files: fractions_divround.patch
keywords: patch
messages: 305817
nosy: mark.dickinson, wolma
priority: normal
severity: normal
status: open
title: make it simpler to round fractions
type: enhancement
versions: Python 3.7, Python 3.8
Added file: https://bugs.python.org/file47254/fractions_divround.patch

___
Python tracker 

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



[issue31978] make it simpler to round fractions

2017-11-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

See also _divide_and_round() in Lib/datetime.py, _div_nearest() in 
Lib/_pydecimal.py and _PyLong_DivmodNear() in Objects/longobject.c.

--
nosy: +belopolsky, facundobatista, rhettinger, serhiy.storchaka, skrah, 
stutzbach
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



[issue21862] cProfile command-line should accept "-m module_name" as an alternative to script path

2017-11-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

This is done.  Thank you Sanyam!

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



[issue21862] cProfile command-line should accept "-m module_name" as an alternative to script path

2017-11-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:


New changeset 7973e279a21999f134aff92dd6d344ec4591fae9 by Antoine Pitrou 
(Sanyam Khurana) in branch 'master':
bpo-21862: Add -m option to cProfile for profiling modules (#4297)
https://github.com/python/cpython/commit/7973e279a21999f134aff92dd6d344ec4591fae9


--

___
Python tracker 

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



[issue28180] Implementation of the PEP 538: coerce C locale to C.utf-8

2017-11-08 Thread Xavier de Gaye

Change by Xavier de Gaye :


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

___
Python tracker 

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



[issue31910] test_socket.test_create_connection() failed with EADDRNOTAVAIL (err 99)

2017-11-08 Thread Berker Peksag

Berker Peksag  added the comment:

I don't see this failure on Travis for a while now. Can this issue be closed?

--
nosy: +berker.peksag
type:  -> behavior

___
Python tracker 

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



[issue21862] cProfile command-line should accept "-m module_name" as an alternative to script path

2017-11-08 Thread Sanyam Khurana

Sanyam Khurana  added the comment:

Thanks a lot Antoine and Nick :)

--

___
Python tracker 

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



[issue23078] unittest.mock patch autospec doesn't work on staticmethods

2017-11-08 Thread Germano

Germano  added the comment:

Hi,

I hit this problem wile mocking one static method and found this fix.
Tested it and works for me.
However, I did not find it pushed anywhere: no Python 3.x and no mock for 2.7.

Is there any reason why it is not pushed anywhere, yet?

--
nosy: +germanop

___
Python tracker 

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



[issue31979] Simplify converting non-ASCII strings to int, float and complex

2017-11-08 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

This issue is inspired by the tweet 
https://twitter.com/dabeaz/status/925787482515533830

>>> a = 'n'
>>> b = 'ñ'
>>> sys.getsizeof(a)
   50
>>> sys.getsizeof(b)
   74
>>> float(b)
   Traceback (most recent call last):
  File "", line 1, in 
   ValueError: could not convert string to float: 'ñ'
>>> sys.getsizeof(b)
   77

See also a discussion on Python-list 
(https://mail.python.org/pipermail/python-list/2017-November/728149.html) and 
Stack Overflow 
(https://stackoverflow.com/questions/47062184/why-does-the-size-of-this-python-string-change-on-a-failed-int-conversion).


When convert a non-ASCII string which don't contain non-ASCII decimal digits 
and spaces, this will fail, but will change the size of the input string due to 
creating an internal UTF-8 representation.

This can look surprising for beginners, but there is nothing wrong here. There 
are many cases in which an internal UTF-8 representation is created implicitly.

But looking on the code I have found that it is too complicated. Parsers to 
int, float and complex call _PyUnicode_TransformDecimalAndSpaceToASCII() which 
transforms non-ASCII decimal digits and spaces to ASCII. This functions uses 
the general function fixup() which takes a transformation function, creates a 
new string object, apply the transformation. It checks if the transformation 
produces a string with larger maximal character code than the original string 
and creates a new string object and repeat the transformation in that case. 
Finally, if the resulting string is equal to the original string, destroy the 
resulting string and returns the original string. In the past fixup() was used 
for implementing methods like upper(). But now 
_PyUnicode_TransformDecimalAndSpaceToASCII() is only the user of fixup(), and 
it doesn't need all complicated logic of fixup(). For example, this 
transformation never produces wider strings.

The proposed PR simplifies the code by getting rid of fixup() and 
fix_decimal_and_space_to_ascii(). The semantic of 
_PyUnicode_TransformDecimalAndSpaceToASCII() has been changed. It now always 
produces ASCII string (this also simplifies caller places). If non-ASCII 
characters which is not a decimal digit and is not a space is encountered, the 
rest of the string is replaced with '?' which will cause an error in parsers.

The only visible behavior change (except not changing the size of the original 
string) is changing the exception raised by float() and complex() when the 
string contains lone surrogates from UnicodeEncodeError to ValueError (the same 
as for other malformed strings). int() already contained a special case for 
this and raised a ValueError.

Unpatched:

>>> int('\ud800')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: invalid literal for int() with base 10: '\ud800'
>>> float('\ud800')
Traceback (most recent call last):
  File "", line 1, in 
UnicodeEncodeError: 'utf-8' codec can't encode character '\ud800' in position 
0: surrogates not allowed
>>> complex('\ud800')
Traceback (most recent call last):
  File "", line 1, in 
UnicodeEncodeError: 'utf-8' codec can't encode character '\ud800' in position 
0: surrogates not allowed

Patched:

>>> int('\ud800')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: invalid literal for int() with base 10: '\ud800'
>>> float('\ud800')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: could not convert string to float: '\ud800'
>>> complex('\ud800')
Traceback (most recent call last):
  File "", line 1, in 
ValueError: complex() arg is a malformed string

This PR saves around 80 lines of code.

--
assignee: serhiy.storchaka
components: Unicode
messages: 305824
nosy: ezio.melotti, haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Simplify converting non-ASCII strings to int, float and complex
type: enhancement
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



[issue31979] Simplify converting non-ASCII strings to int, float and complex

2017-11-08 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue31338] Use abort() for code we never expect to hit

2017-11-08 Thread Petr Viktorin

Change by Petr Viktorin :


--
pull_requests: +4291

___
Python tracker 

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



[issue31980] Special case log(x, 2), log(x, 10) and pow(2, x)

2017-11-08 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

C99 provides functions log2(), log10() and exp2(). Is it worth to special case 
math.log(), math.pow() and built-in pow() for using these functions? log2(x) 
can be more accurate than log(x)/log(2).

There are math.log2() and math.log10(), but not math.exp2().

--
components: Extension Modules
messages: 305825
nosy: mark.dickinson, rhettinger, serhiy.storchaka, stutzbach
priority: normal
severity: normal
status: open
title: Special case log(x, 2), log(x, 10) and pow(2, x)
type: enhancement
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



[issue31981] os.mkdirs does not exist on 2.7.5+

2017-11-08 Thread Mikey D

New submission from Mikey D :

https://docs.python.org/2/library/os.html

os.mkdirs('/tmp/folder')
AttributeError: 'module' object has no attribute 'mkdirs''

os.makedirs('/tmp/folder')
os.path.isdir('/tmp/folder')
True

--
assignee: docs@python
components: Documentation
messages: 305826
nosy: Mikey D, docs@python
priority: normal
severity: normal
status: open
title: os.mkdirs does not exist on 2.7.5+
versions: Python 2.7

___
Python tracker 

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



[issue24132] Direct sub-classing of pathlib.Path

2017-11-08 Thread Christophe BAL

Christophe BAL  added the comment:

For the moment, you can take a look at this little script that acheives 
subclassing of Path : 
https://github.com/bc-python/mistool/blob/master/mistool/os_use.py 
(search for class Path).

Le 08/11/2017 à 09:55, Paul Moore a écrit :
> Paul Moore  added the comment:
>
> @elguavas the problem is, no-one has proposed a patch. There's not likely to 
> be much movement on this until someone provides one.
>
> --
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue24132] Direct sub-classing of pathlib.Path

2017-11-08 Thread Christophe BAL

Christophe BAL  added the comment:

Mistyping : /search for class PPath/ with two P.

Le 08/11/2017 à 13:59, Christophe BAL a écrit :
> Christophe BAL  added the comment:
>
> For the moment, you can take a look at this little script that acheives
> subclassing of Path :
> https://github.com/bc-python/mistool/blob/master/mistool/os_use.py
> (search for class Path).
>
> Le 08/11/2017 à 09:55, Paul Moore a écrit :
>> Paul Moore  added the comment:
>>
>> @elguavas the problem is, no-one has proposed a patch. There's not likely to 
>> be much movement on this until someone provides one.
>>
>> --
>>
>> ___
>> Python tracker 
>> 
>> ___
> --
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue31981] os.mkdirs does not exist on 2.7.5+

2017-11-08 Thread Mikey D

Mikey D  added the comment:

Bah, I need more coffee... sorry! I though I saw "mkdirs" on that
page. Please close.

On Wed, Nov 8, 2017 at 8:03 AM, Serhiy Storchaka  wrote:
>
> Serhiy Storchaka  added the comment:
>
> Yes, os.mkdirs does not exist. What is your issue Mikey?
>
> --
> nosy: +serhiy.storchaka
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue31981] os.mkdirs does not exist on 2.7.5+

2017-11-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Yes, os.mkdirs does not exist. What is your issue Mikey?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31981] os.mkdirs does not exist on 2.7.5+

2017-11-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

No problem. ;)

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



[issue31981] os.mkdirs does not exist on 2.7.5+

2017-11-08 Thread Mikey D

Mikey D  added the comment:

Forgot to add, python 2.7.5
python-2.7.5-48.el7.x86_64 (RHEL 7.3)

On Wed, Nov 8, 2017 at 7:59 AM, Mikey D  wrote:
>
> New submission from Mikey D :
>
> https://docs.python.org/2/library/os.html
>
> os.mkdirs('/tmp/folder')
> AttributeError: 'module' object has no attribute 'mkdirs''
>
> os.makedirs('/tmp/folder')
> os.path.isdir('/tmp/folder')
> True
>
> --
> assignee: docs@python
> components: Documentation
> messages: 305826
> nosy: Mikey D, docs@python
> priority: normal
> severity: normal
> status: open
> title: os.mkdirs does not exist on 2.7.5+
> versions: Python 2.7
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue31338] Use abort() for code we never expect to hit

2017-11-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 8bf288e2c5330148e4bd07d9c2f1ccd05ced5a86 by Serhiy Storchaka 
(Petr Viktorin) in branch 'master':
Docs: Mention that Py_UNREACHABLE was added in 3.7 (#4337)
https://github.com/python/cpython/commit/8bf288e2c5330148e4bd07d9c2f1ccd05ced5a86


--

___
Python tracker 

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



[issue31970] asyncio debug mode is very slow

2017-11-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> I've a few ideas how to add 0-copy support to protocols.

I'd be interesting to hear about them.  The main challenge IMHO is to find a 
way to allow a readinto()-like functionality.

--

___
Python tracker 

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



[issue7938] makesetup interprets macros -DA=B as a Make variable definition

2017-11-08 Thread Michael Evans

Change by Michael Evans :


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

___
Python tracker 

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



[issue31975] Add a default filter for DeprecationWarning in __main__

2017-11-08 Thread R. David Murray

R. David Murray  added the comment:

>From the linked email:

> That way ad hoc scripts and the REPL will get warnings by default,
> while zipapps and packages can avoid warnings by keeping their
> __main__.py simple, and importing a CLI helper function from another
> module. Entry point wrapper scripts will implicitly have the same
> effect for installed packages.

But a lot of non-ad-hoc scripts consist of a single __main__ module, and this 
will produce warnings in those.  Weren't those kind of scripts one of the 
motivators for not enabling deprecation warnings by default?  I seem to 
remember that's where they annoyed me most, but it has been a long time 
(thankfully).

When we had warnings by default we got lots of complaints.  Since we turned 
them off and turned them back on in unittest (and other test packages followed 
suit), we have not had complaints that I remember hearing before this thread, 
except about them not appearing at the REPL.  Are there real-world (as opposed 
to theoretical) instances of the current policy causing real problems?

--
nosy: +r.david.murray

___
Python tracker 

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



[issue31338] Use abort() for code we never expect to hit

2017-11-08 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4293

___
Python tracker 

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



[issue31970] asyncio debug mode is very slow

2017-11-08 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

>> I've a few ideas how to add 0-copy support to protocols.

> I'd be interesting to hear about them.  The main challenge IMHO is to find a 
> way to allow a readinto()-like functionality.

Exposing sendfile() should be straightforward. I started implementing it years 
ago but I gave up pretty soon because asyncio had no solid test framework for 
testing an actual data transfer between two sockets and that basically 
represented a blocker. Basically back then all recv() / send() related tests 
were mocks. Not sure about the current situation but if that has changed I 
would be happy to contribute a PR (I was the one who contributed 
socket.sendfile()).

As for a readinto()-like functionality: the only thing I'm aware of is splice() 
syscall but it's Linux only. It must be noted that also sendfile() is UNIX 
only. Windows achieve the same via TransmitFile.

--

___
Python tracker 

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



[issue31970] asyncio debug mode is very slow

2017-11-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Le 08/11/2017 à 14:40, Giampaolo Rodola' a écrit :
> Exposing sendfile() should be straightforward.

sendfile() is not useful for data that's read from (or written to) memory.

> As for a readinto()-like functionality: the only thing I'm aware of is 
> splice() syscall but it's Linux only.

This is not the abstraction level we are talking about.  The problem is
the Protocol API imposes copies by default (data_received() gives you an
arbitrarily-sized bytes object that doesn't match how your protocol
chunks data).

--

___
Python tracker 

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



[issue31970] asyncio debug mode is very slow

2017-11-08 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Sorry. It looks like I completely misunderstood. =)

--

___
Python tracker 

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



[issue31970] asyncio debug mode is very slow

2017-11-08 Thread STINNER Victor

STINNER Victor  added the comment:

> The problem is the Protocol API imposes copies by default (...)

IMHO performance is a good motivation to enhance the asyncio API ;-) The tricky 
part is to keep the backward compatibility.

--

___
Python tracker 

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



[issue31970] asyncio debug mode is very slow

2017-11-08 Thread Yury Selivanov

Yury Selivanov  added the comment:

> IMHO performance is a good motivation to enhance the asyncio API ;-) The 
> tricky part is to keep the backward compatibility.

Let's stop the discussion in this ticket :)

--

___
Python tracker 

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



[issue31970] asyncio debug mode is very slow

2017-11-08 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

In any case, I think this is better discussed on async-sig (where I already 
started a discussion thread some weeks ago -- see """APIs for high-bandwidth 
large I/O?""").

--

___
Python tracker 

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



[issue31910] test_socket.test_create_connection() failed with EADDRNOTAVAIL (err 99)

2017-11-08 Thread STINNER Victor

STINNER Victor  added the comment:

> I don't see this failure on Travis for a while now. Can this issue be closed?

Since the failure occurred randomly, we cannot make sure that the bug is really 
fixed. Usually in this case, I close the issue, but reopen it if the bug comes 
back.

So yes, I close the issue right now.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue31978] make it simpler to round fractions

2017-11-08 Thread Mark Dickinson

Mark Dickinson  added the comment:

> There is one slight additional tweak in the patch: in the case of ndigits < 
> 0, it returns an int, not a Fraction (see test_fractions modification to make 
> it pass).

This would be a backwards incompatible change, potentially breaking existing 
code, so we'd need to think carefully before making it. It's definitely not a 
"slight tweak" :-).

I'd prefer that this change is not made at all: in general, it's not a great 
idea to have a return _type_ that changes depending on the _values_ of an 
argument (though as always, there are exceptions). The general rule is that 
two-argument `round` returns something of the same type as its first argument: 
I don't think there's a really compelling reason to change this for the 
Fraction type. So -1 on this change from me.

--

___
Python tracker 

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



[issue31978] make it simpler to round fractions

2017-11-08 Thread Mark Dickinson

Mark Dickinson  added the comment:

On the main proposal: rounding an integer division to the nearest integer does 
seem to be a somewhat common need, and one that's not entirely trivial to code 
up and get right first time. (Unlike floor or ceiling of a quotient, which can 
be simply spelled as `n // d` or `-(-n // d)` respectively.) As Serhiy points 
out, it already turns up in multiple guises in the C source. The questions for 
me would be:

1. Is it actually a common enough need that we should add it?
2. If answer to (1) is yes, where should we add it? A method on the `int` type 
is one possible option, beyond the ones already mentioned.
3. There are actually three related operations here: (a) round a quotient to 
the nearest integer; (b) get the remainder of that rounding (the integer 
version of math.remainder), and (c) both (a) and (b) together. Which of those 
three should be implemented? (i.e., do we want the round-to-nearest analogs of 
div, mod, divmod, all three, or some nontrivial subset)?

--

___
Python tracker 

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



[issue31338] Use abort() for code we never expect to hit

2017-11-08 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 54cc0c0789af8ff2396cb19095b7ab269f2bc06c by Victor Stinner in 
branch 'master':
bpo-31338: C API intro: add missing versionadded (#4339)
https://github.com/python/cpython/commit/54cc0c0789af8ff2396cb19095b7ab269f2bc06c


--

___
Python tracker 

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



[issue31978] make it simpler to round fractions

2017-11-08 Thread Wolfgang Maier

Wolfgang Maier  added the comment:

ok, I agree with you that the returned type should not change with the value of 
an argument. I simply didn't think one vs two argument versions here, but in 
terms of three different code branches where one returns int already.
Maybe 'slight' was the wrong wording - think of it as 'easy to revert' then :)

--

___
Python tracker 

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



[issue27987] obmalloc's 8-byte alignment causes undefined behavior

2017-11-08 Thread STINNER Victor

STINNER Victor  added the comment:

alignment.patch: +long double dummy;  /* force worst-case alignment */

Would it be possible to use max_align_t mentioned by Stefan, at least when this 
type is available?

What is the impact of the patch on objects size?

--

___
Python tracker 

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



[issue28997] test_readline.test_nonascii fails on Android

2017-11-08 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

PEP 538 is implemented now in the master branch.

Closing this issue as out of date for the following reasons:

a) PR 4334 adds locale coercion for Android to the implementation of PEP 538 
(and test_nonascii succeeds with this PR).

b) With the current implementation of PEP 538 and without PR 4334 (thus lacking 
locale coercion on Android), test_nonascii also does not fail on Android.

Conclusion:
Because of b) the reason that test_nonascii was failing is not a problem of 
environment variables since locale coercion is missing.
The readline library does indeed look up the "LANG" and "LC_ALL" locale 
environment variables first and if one is set the library uses it to set 
LC_CTYPE [1]. But when none of these environment variables is found, then 
readline gets the locale by calling setlocale (LC_CTYPE, (char *)NULL). In the 
current implementation of PEP 538 test_nonascii succeeds now in b) because 
setlocale(LC_ALL, "C.UTF-8") is called now by Python upon starting up when 
__ANDROID__ is defined.

[1] search for _rl_init_eightbit () and _rl_get_locale_var in 
git.savannah.gnu.org/cgit/readline.git/tree/nls.c

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



[issue31884] [Windows] subprocess set priority on windows

2017-11-08 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset b5d9e0811463f3b28ba355a9e0bee7f1682854e3 by Victor Stinner 
(James) in branch 'master':
bpo-31884 subprocess: add Windows constants for process priority (#4150)
https://github.com/python/cpython/commit/b5d9e0811463f3b28ba355a9e0bee7f1682854e3


--

___
Python tracker 

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



[issue28180] Implementation of the PEP 538: coerce C locale to C.utf-8

2017-11-08 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

PR 4334 added: fix the implementation of PEP 538 on Android.

The current implementation of PEP 538 fixes issue 28997 without the locale 
coercion for Android added by PR 4334, see msg305848.

--

___
Python tracker 

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



[issue31978] make it simpler to round fractions

2017-11-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I thought about adding a public function in the math module when worked on one 
of that functions. But there are not many cases for it in the stdlib (datetime, 
fractions, decimal, and maybe it's all). I don't know whether there is a common 
enough need in third-party code. But there is a parallel with math.remainder().

If add this function, I would implement it in C and add in the math module. It 
already contains integer specific functions factorial() and gcd(). There was a 
proposition to add as_integer_ratio() (which will work with arbitrary 
rationals). All together they will create a small integer mathematics domain in 
the math module. Or can be extracted in a special module. Later it can be 
extended by adding functions for binomial coefficients and the number of 
permutations and generators of prime and Fibonacci numbers.

--

___
Python tracker 

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



[issue31980] Special case log(x, 2), log(x, 10) and pow(2, x)

2017-11-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

There is also a GNU extension pow10().

--

___
Python tracker 

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



[issue31934] Failure to build out of source from a not clean source

2017-11-08 Thread Xavier de Gaye

Xavier de Gaye  added the comment:


New changeset 0de92859caf25e65fc968d4bb68626e9ba21b851 by xdegaye in branch 
'master':
bpo-31934: Abort when building out of a not clean source tree (GH-4255)
https://github.com/python/cpython/commit/0de92859caf25e65fc968d4bb68626e9ba21b851


--

___
Python tracker 

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



[issue31896] In function define class inherit ctypes.structure, and using ctypes.pointer leak memory

2017-11-08 Thread Berker Peksag

Berker Peksag  added the comment:

I agree with Terry. Your code calls hi() in an infinite loop (why timespec is 
defined in hi()?), we don't know how clock_gettime(3) is implemented etc. (it 
should cleanup its own memory if it calls malloc()) etc. Please use python-list 
or StackOverflow for usage questions.

--
nosy: +berker.peksag
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



[issue31896] In function define class inherit ctypes.structure, and using ctypes.pointer leak memory

2017-11-08 Thread Berker Peksag

Berker Peksag  added the comment:

See also issue 12998.

--

___
Python tracker 

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



[issue11253] Document ctypes.wintypes constants

2017-11-08 Thread Berker Peksag

Change by Berker Peksag :


--
stage:  -> needs patch
title: autodocument first appearance of ctypes.wintypes constants -> Document 
ctypes.wintypes constants
type:  -> enhancement
versions: +Python 3.6, Python 3.7 -Python 3.3

___
Python tracker 

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



[issue31824] Missing default argument detail in documentation of StreamReaderWriter

2017-11-08 Thread Berker Peksag

Berker Peksag  added the comment:

Thanks for the PR, Pablo. I think we can make the same change to StreamRecoder 
documentation too: 
https://docs.python.org/3/library/codecs.html#codecs.StreamRecoder

--
nosy: +pablogsal

___
Python tracker 

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



[issue31934] Failure to build out of source from a not clean source

2017-11-08 Thread Xavier de Gaye

Change by Xavier de Gaye :


--
pull_requests: +4294

___
Python tracker 

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



[issue31884] [Windows] subprocess set priority on windows

2017-11-08 Thread STINNER Victor

Change by STINNER Victor :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue14119] Ability to adjust queue size in Executors

2017-11-08 Thread Michael Hrivnak

Michael Hrivnak  added the comment:

My project also has a use case for this, very similar to the others described. 
Here's what we want:

with ThreadPoolExecutor(queue_size=500) as executor:
  for item in parse_a_long_list_of_work(somefile.xml):
executor.submit(Job(item))

I do not want to parse the entire list of work items and load them into memory 
at once. It is preferable for the main thread running the above code to block 
on submit() when the queue size is above some threshold.

It's a classic case of the producer and consumer operating at different speeds. 
In the past, a Queue object has been the way to connect such a producer and 
consumer. The various Executor classes do not provide an easy way to consume 
from a provided Queue object, so giving them that capability would be a 
reasonable alternative to having the submit() method block.

--
nosy: +mhrivnak

___
Python tracker 

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



[issue31955] distutils C compiler: set_executables() incorrectly parse values with spaces

2017-11-08 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 849482955f70eb1adc47a20dcbce3b4add47d864 by Victor Stinner 
(Mazay0) in branch '2.7':
bpo-31955: Fix distutils CCompiler.set_executable() for Unicode (GH-4316)
https://github.com/python/cpython/commit/849482955f70eb1adc47a20dcbce3b4add47d864


--

___
Python tracker 

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



[issue31901] atexit callbacks only called for current subinterpreter

2017-11-08 Thread Petr Viktorin

Petr Viktorin  added the comment:

When you destroy a subinterpreter before Py_Finalize is called, Python can't 
start calling its atexit callbacks – they no longer have a subinterpreter to 
run in.

Therefore I think callbacks for a particular subinterpreter should be called 
when (and only when) that subinterpreter is destroyed. Regardless of whether 
it's the main one or not.

--

___
Python tracker 

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



[issue31955] distutils C compiler: set_executables() incorrectly parse values with spaces

2017-11-08 Thread STINNER Victor

STINNER Victor  added the comment:

Thank you Dee Mee for your bug report and your bug fix!

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



[issue26179] Python C-API "unused-parameter" warnings

2017-11-08 Thread Petr Viktorin

Change by Petr Viktorin :


--
pull_requests: +4297

___
Python tracker 

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



[issue29179] Py_UNUSED is not documented

2017-11-08 Thread Petr Viktorin

Petr Viktorin  added the comment:

Since the macro has a public name and is used in the wild outside CPython, I'll 
go ahead and submit a pull request documenting it.

--

___
Python tracker 

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



[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2017-11-08 Thread Petr Viktorin

Change by Petr Viktorin :


--
pull_requests: +4296

___
Python tracker 

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



[issue29179] Py_UNUSED is not documented

2017-11-08 Thread Petr Viktorin

Change by Petr Viktorin :


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

___
Python tracker 

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



[issue31934] Failure to build out of source from a not clean source

2017-11-08 Thread Xavier de Gaye

Change by Xavier de Gaye :


--
pull_requests: +4298

___
Python tracker 

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



[issue31934] Failure to build out of source from a not clean source

2017-11-08 Thread Xavier de Gaye

Xavier de Gaye  added the comment:


New changeset 0c4785bf39b4e86dea3a70b651e5d5db2f2cf017 by xdegaye in branch 
'3.6':
[3.6] bpo-31934: Abort when building out of a not clean source tree (GH-4255). 
(#4340)
https://github.com/python/cpython/commit/0c4785bf39b4e86dea3a70b651e5d5db2f2cf017


--

___
Python tracker 

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



[issue31879] Launcher fails on custom command starting with "python"

2017-11-08 Thread Robert

Robert  added the comment:

I am still waiting for a OK (or denial) of my proposed Modification.

I want to avoid that I start coding and when I am finished the PSF denies my 
PullRequest.

Is anybody out there who can decide this or at least lead a discussion?

--

___
Python tracker 

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



[issue31934] Failure to build out of source from a not clean source

2017-11-08 Thread STINNER Victor

STINNER Victor  added the comment:

I tested manually the commit 0c4785bf39b4e86dea3a70b651e5d5db2f2cf017 merged 
into Python 3.6: it works as expected ;-)

--

___
Python tracker 

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



[issue26179] Python C-API "unused-parameter" warnings

2017-11-08 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 2138163621196a186975796afb2b0a6aa335231d by Victor Stinner (Petr 
Viktorin) in branch 'master':
bpo-29179: Document the Py_UNUSED macro (#4341)
https://github.com/python/cpython/commit/2138163621196a186975796afb2b0a6aa335231d


--

___
Python tracker 

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



[issue29179] Py_UNUSED is not documented

2017-11-08 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 2138163621196a186975796afb2b0a6aa335231d by Victor Stinner (Petr 
Viktorin) in branch 'master':
bpo-29179: Document the Py_UNUSED macro (#4341)
https://github.com/python/cpython/commit/2138163621196a186975796afb2b0a6aa335231d


--
nosy: +haypo

___
Python tracker 

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



[issue19976] Argument Clinic: generate second arg for METH_NOARGS

2017-11-08 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 2138163621196a186975796afb2b0a6aa335231d by Victor Stinner (Petr 
Viktorin) in branch 'master':
bpo-29179: Document the Py_UNUSED macro (#4341)
https://github.com/python/cpython/commit/2138163621196a186975796afb2b0a6aa335231d


--

___
Python tracker 

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



[issue29179] Py_UNUSED is not documented

2017-11-08 Thread STINNER Victor

Change by STINNER Victor :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue29179] Py_UNUSED is not documented

2017-11-08 Thread STINNER Victor

STINNER Victor  added the comment:

Thank you Petr for your PR! I merged it.

--

___
Python tracker 

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



[issue31904] Python should support VxWorks RTOS

2017-11-08 Thread Brian Kuhl

Brian Kuhl  added the comment:

I'm quite happy to take on maintainer role for Python on VxWorks, so I think we 
can get that one solved. 

Enabling a build bot for cross compile of propitiatory OS presents a number of 
legal licensing issues that outside my control. And I'll discuss it internally 
at Wind River. However I think it is in line with where our customers want us 
to go, so well worth pursuing. 

I'll keep this pull request active and up to date, till the broader issues you 
have raised can be resolved.  

I'll post a proposal on the mailing list after I consulted within Wind River.

Many thanks for your interest and support.

--

___
Python tracker 

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



[issue31934] Failure to build out of source from a not clean source

2017-11-08 Thread STINNER Victor

STINNER Victor  added the comment:

> I also tested the 2.7 and 3.6 PRs before submitting them.

Oh, I don't trust anyone, including myself :-) Since there is no automated, I 
chose to ("double") test manually your PRs.

--

___
Python tracker 

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



[issue31879] Launcher fails on custom command starting with "python"

2017-11-08 Thread Paul Moore

Paul Moore  added the comment:

Personally I don't see the value (in general, I don't see much use for the 
whole custom command idea - making the launcher into a generalised shebang 
processor was never really a core feature). But I'm not going to say no if 
others find it useful. Call me -0 on the proposal.

--

___
Python tracker 

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



[issue21423] concurrent.futures.ThreadPoolExecutor/ProcessPoolExecutor should accept an initializer argument

2017-11-08 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

What is the best way to silence logging in subprocesses?

--
nosy: +vinay.sajip

___
Python tracker 

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



[issue31934] Failure to build out of source from a not clean source

2017-11-08 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

I also tested the 2.7 and 3.6 PRs before submitting them.
Thanks for testing and for your reviews Victor :-)

--

___
Python tracker 

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



[issue31934] Failure to build out of source from a not clean source

2017-11-08 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Oh I understand, there is no practical way to test that feature except manually.

--

___
Python tracker 

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



[issue31934] Failure to build out of source from a not clean source

2017-11-08 Thread Xavier de Gaye

Xavier de Gaye  added the comment:


New changeset fbdd3eeba3e526e162f2eb54d224cf36ed8cfea1 by xdegaye in branch 
'2.7':
[2.7] bpo-31934: Abort when building out of a not clean source tree (GH-4255). 
(#4342)
https://github.com/python/cpython/commit/fbdd3eeba3e526e162f2eb54d224cf36ed8cfea1


--

___
Python tracker 

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



[issue31982] 8.3. collections — Container datatypes

2017-11-08 Thread Sasha Kacanski

New submission from Sasha Kacanski :

Hi,
In ChainMap example
c = ChainMap()# Create root context
d = c.new_child() # Create nested child context
e = c.new_child() # Child of c, independent from d
e.maps[0] # Current context dictionary -- like Python's locals()
e.maps[-1]# Root context -- like Python's globals()
e.parents # Enclosing context chain -- like Python's nonlocals

d['x']# Get first key in the chain of contexts
d['x'] = 1# Set value in current context

d['x'] - will raise key does not exist error 

so simple fix is to flip last two lines...

I know, possibly anal but look love Python and would like to help new folks to 
not get confused if they play with example in cPython shell...

--best

--
assignee: docs@python
components: Documentation
messages: 305876
nosy: Sasha Kacanski, docs@python
priority: normal
severity: normal
status: open
title: 8.3. collections — Container datatypes
versions: Python 3.6

___
Python tracker 

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



[issue21790] Change blocksize in http.client to the value of resource.getpagesize

2017-11-08 Thread Berker Peksag

Change by Berker Peksag :


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



[issue31983] Officially add Py_SETREF and Py_XSETREF

2017-11-08 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

Private macros Py_SETREF and Py_XSETREF were introduced in 3.6 and backported 
to all maintained versions for fixing bugs (see issue20440 and issue26200). 
They are helpful and used not only for the primary purpose, but also for 
simplifying the code. Their names don't start from underscore because I planned 
to make them public and didn't want massive renaming and backporting conflicts. 
Now I think it is a time to add them officially to the stable C API.

--
assignee: docs@python
components: Documentation, Interpreter Core
messages: 305878
nosy: docs@python, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Officially add Py_SETREF and Py_XSETREF
type: enhancement
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



[issue31983] Officially add Py_SETREF and Py_XSETREF

2017-11-08 Thread STINNER Victor

Change by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue31934] Failure to build out of source from a not clean source

2017-11-08 Thread STINNER Victor

Change by STINNER Victor :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue31904] Python should support VxWorks RTOS

2017-11-08 Thread R. David Murray

R. David Murray  added the comment:

I'm not sure what licensing issues you are talking about, but setting up a 
buildbot shouldn't normally run into any.  As long as you have a license to the 
run the OS, the fact that you are using it to receive jobs from our build 
master and run them shouldn't be a problem.  You can keep the whole thing 
behind a firewall in a DMZ: the slave makes outbound connections to pick up its 
jobs.

On the other hand, the logistics of setting up a cross compile buildbot might 
be a bit complex, I've never done that.  You might need specific support from 
our build master.  In any case, the python-buldbots mailing list is the place 
to talk if you want to/can pursue this.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue31978] make it simpler to round fractions

2017-11-08 Thread Mark Dickinson

Mark Dickinson  added the comment:

> I don't know whether there is a common enough need in third-party code.

Me neither. But one thing to look for would be people doing `round(a / b)`, 
which is almost certainly giving the wrong result in corner cases. OTOH, even 
those uses may well be in code that doesn't actually care about getting the 
wrong result in those corner cases, or that doesn't exercise the corner cases. 
(E.g., if both `a` and `b` are not-too-large integers, `round(a / b)` is still 
"safe" in that it will give the same result as if a non-lossy integer division 
is used.)

--

___
Python tracker 

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



[issue31879] Launcher fails on custom command starting with "python"

2017-11-08 Thread Robert

Robert  added the comment:

Of course I do not know the initial ideas/philosophy of the launcher.

But the current implementation supports these custom commands (for whatever 
reason). Thus I'd say they should work "properly". My view of "properly" is 
that the implementation matches the documentation which is currently definitely 
not the case.

Of course one could add an extra passus to the docs like: "custom command names 
must not start with 'python'". But why include a special case (and make it less 
intuitive) without need?

By the way: We have a use case for this custom commands and I could image 
others had, too. Or how came that they were included?

--

___
Python tracker 

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



[issue31984] startswith and endswith leak implementation details

2017-11-08 Thread Ronan Lamy

New submission from Ronan Lamy :

One would think that u.startswith(v, start, end) would be equivalent to 
u[start: end].startswith(v), but one would be wrong. And the same goes for 
endswith(). Here is the actual spec (for bytes, but str and bytearray are the 
same), in the form of passing pytest+hypothesis tests:


from hypothesis import strategies as st, given

def adjust_indices(u, start, end):
if end < 0:
end = max(end + len(u), 0)
else:
end = min(end, len(u))
if start < 0:
start = max(start + len(u), 0)
return start, end

@given(st.binary(), st.binary(), st.integers(), st.integers())
def test_startswith_3(u, v, start, end):
if v:
expected = u[start:end].startswith(v)
else:
start0, end0 = adjust_indices(u, start, end)
expected = start0 <= len(u) and start0 <= end0
assert u.startswith(v, start, end) is expected

@given(st.binary(), st.binary(), st.integers(), st.integers())
def test_endswith_3(u, v, start, end):
if v:
expected = u[start:end].endswith(v)
else:
start0, end0 = adjust_indices(u, start, end)
expected = start0 <= len(u) and start0 <= end0
assert u.endswith(v, start, end) is expected

Fixing this behaviour to work in the "obvious" way would be simple: just add a 
check for len(v) == 0 and always return True in that case.

--
messages: 305881
nosy: Ronan.Lamy
priority: normal
severity: normal
status: open
title: startswith and endswith leak implementation details
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue31810] Travis CI, buildbots: run "make smelly" to check if CPython leaks symbols

2017-11-08 Thread Tom Floyer

Change by Tom Floyer :


--
pull_requests: +4299

___
Python tracker 

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



[issue31810] Travis CI, buildbots: run "make smelly" to check if CPython leaks symbols

2017-11-08 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests:  -4299

___
Python tracker 

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



[issue31984] startswith and endswith leak implementation details

2017-11-08 Thread R. David Murray

R. David Murray  added the comment:

Can you please give examples of what you think the problem is?

--
nosy: +r.david.murray

___
Python tracker 

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



[issue31810] Travis CI, buildbots: run "make smelly" to check if CPython leaks symbols

2017-11-08 Thread Tom Floyer

Change by Tom Floyer :


--
pull_requests: +4300

___
Python tracker 

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



[issue31810] Travis CI, buildbots: run "make smelly" to check if CPython leaks symbols

2017-11-08 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset bf9d317626eebcf79bd0756b4dd43df82d5cc186 by Yury Selivanov (Tom 
Floyer) in branch 'master':
bpo-31810: added missing keywords to docs. (#4140)
https://github.com/python/cpython/commit/bf9d317626eebcf79bd0756b4dd43df82d5cc186


--
nosy: +yselivanov

___
Python tracker 

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



[issue31811] async and await missing from keyword list in lexical analysis doc

2017-11-08 Thread Yury Selivanov

Change by Yury Selivanov :


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



[issue31969] re.groups() is not checking the arguments

2017-11-08 Thread Matthew Barnett

Matthew Barnett  added the comment:

@Narendra: The argument, if provided, is merely a default. Checking whether it 
_could_ be used would not be straightforward, and raising an exception if it 
would never be used would have little, if any, benefit.

It's not a bug, and it's not worth changing.

--
status: open -> closed

___
Python tracker 

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



[issue31811] async and await missing from keyword list in lexical analysis doc

2017-11-08 Thread STINNER Victor

STINNER Victor  added the comment:

The final commit uses the wrong bpo number:

New changeset bf9d317626eebcf79bd0756b4dd43df82d5cc186 by Yury Selivanov (Tom 
Floyer) in branch 'master':
bpo-31810: added missing keywords to docs. (#4140)
https://github.com/python/cpython/commit/bf9d317626eebcf79bd0756b4dd43df82d5cc186

--
nosy: +haypo

___
Python tracker 

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



  1   2   >