[issue29928] Add f-strings to Glossary

2017-03-28 Thread Martin Panter

Martin Panter added the comment:

When I wrote the documentation 
, I 
think I tried to avoid “f-string”, being jargon, and used more formal 
terminology from PEP 498 instead. But I agree they more than regular literals.

Serhiy do you have a link/message-id/etc of the Python-dev discussion? All I 
found with Google was 
.
 One other goal is to differentiate these from other formatted strings, such as 
from str.format and percent formatting.

* formatted strings (doesn’t differentiate from str.format, etc)
* string interpolations
* string expressions
* string comprehensions (apparently too far removed from set comprehensions)
* Maybe format(ted) string displays? (parallelling list etc displays)

--
nosy: +martin.panter

___
Python tracker 

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



[issue29928] Add f-strings to Glossary

2017-03-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I don't have a link. There were a lot of threads about this feature and I 
didn't follow them. After implementing PEP 498 there was a discussion about 
terminology.

I read discussions about coming and released Python 3.6 on StackOverflow, 
Reddit and other resources and seen a lot of misinterpretation due to using 
terms "string" and "literal".

--

___
Python tracker 

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



[issue29922] error message when __aexit__ is not async

2017-03-28 Thread Chewy

Changes by Chewy :


--
nosy: +Chewy

___
Python tracker 

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



[issue29921] datetime validation is stricter in 3.6.1 than previous versions

2017-03-28 Thread m-parry

m-parry added the comment:

>From my opening comment (with new emphasis):

"I think it's the case that **some routes via the C API** now reject out of 
range values that were previously permitted."

The pywin32 repro I gave above eventually calls 
PyDateTimeAPI->DateTime_FromDateAndTime():

http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/file/85c1c99b1cb8/win32/src/PyTime.cpp#l980

AFAICT, under Python < 3.6.1 such out of range values were tolerated there. 
Under Python 2.7, for example, the datetime that results from this call is 
somewhere in 1899.

I am not claiming that these invalid values should be tolerated forever more, 
or that this was ever the correct behaviour, but I would have expected a 
backwards incompatible change like this to happen in, say, Python 3.7, rather 
than a maintenance release. (Particularly when it breaks a library that's 
practically standard on Windows.)

--

___
Python tracker 

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



[issue29929] Idea: Make __main__ an implied package

2017-03-28 Thread Nick Coghlan

New submission from Nick Coghlan:

In just the last 24 hours, I've run across two cases where the default "the 
script directory is on sys.path" behaviour confused even experienced 
programmers:

1. a GitHub engineer thought the Python version in their Git-for-Windows bundle 
was broken because "from random import randint" failed (from a script called 
"random.py"

2. a Red Hat engineer was thoroughly confused when their systemd.py script was 
executed a second time when an unhandled exception was raised (Fedora's system 
Python is integrated with the ABRT crash reporter, and the except hook 
implementation does "from systemd import journal" while dealing with an 
unhandled exception)

This isn't a new problem, we've known for a long time that people are regularly 
confused by this, and it earned a mention as one of my "Traps for the Unwary in 
Python's Import System": 
http://python-notes.curiousefficiency.org/en/latest/python_concepts/import_traps.html#the-name-shadowing-trap

However, what's changed is that for the first time I think I see a potential 
way out of this: rather than injecting the script directory as sys.path[0], we 
could set it as "__main__.__path__ = []".

Cross-version compatible code would then be written as:

if "__path__" in globals():
from . import relative_module_name
else:
import relative_module_name

This approach would effectively be a continuation of PEP 328 (which eliminated 
implicit relative imports from within packages) and PEP 366 (which allowed 
implicit relative imports from modules executed with the '-m' switch).

--
components: Interpreter Core
messages: 290689
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: Idea: Make __main__ an implied package
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



[issue29930] asyncio.StreamWriter.drain raises an AssertionError under heavy use

2017-03-28 Thread Metathink

New submission from Metathink:

While trying to break some code in a project using asyncio, I found that under 
certain circumstances, asyncio.StreamWriter.drain raises an AssertionError.

1. There must be a lot of concurrent uses of "await writer.drain()"
2. The server on which we send data must be public, no AssertionError occurs 
while connected to 127.0.0.1

Task exception was never retrieved
future:  
exception=AssertionError()>
Traceback (most recent call last):
  File "client.py", line 12, in flooding
await writer.drain()
  File "/usr/local/lib/python3.6/asyncio/streams.py", line 333, in drain
yield from self._protocol._drain_helper()
  File "/usr/local/lib/python3.6/asyncio/streams.py", line 208, in _drain_helper
assert waiter is None or waiter.cancelled()
AssertionError

I don't know much about how the drain function is working or how networking is 
handled by the OS, but I'm assuming that I'v reached some OS limitation which 
trigger this AssertionError.

I'm not sure how I'm supposed to handle that. Am I supposed to add some 
throttling because I should not send too much data concurrently? Is this 
considered as a bug? Any explanations are welcome.

Here some minimal client and server exemples if you want to try to reproduce it:
- Server: https://pastebin.com/SED89pwB
- Client: https://pastebin.com/ikJKHxi9

Also, I don't think this is limited to python 3.6, I'v found this old issue on 
the aaugustin's websockets repo which looks the same: 
https://github.com/aaugustin/websockets/issues/16

--
components: asyncio
messages: 290690
nosy: metathink, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.StreamWriter.drain raises an AssertionError under heavy use
type: behavior
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



[issue29929] Idea: Make __main__ an implied package

2017-03-28 Thread Nick Coghlan

Nick Coghlan added the comment:

A key enabler for actually pursuing this idea would be coming up with a 
feasible way of emitting a deprecation warning for code that relied on the old 
implicit relative imports. A reasonable fast check for that would be to:

1. Start populating a private sys._main_path_entry in the sys module in 
addition to including it in both __main__.__path__ and sys.path

2. During the deprecation period, emit a warning when an import is satisfied 
from the sys._main_path_entry directory and the fully qualified module name 
*doesn't* start with "__main__."

3. After the deprecation period, stop populating sys.path[0], stop setting 
sys._main_path_entry, and stop emitting the deprecation warning

There's still plenty of details to be worked out before this idea could become 
reality (especially in terms of how it relates to module execution with the -m 
switch), but both the idea and a managed migration away from the status quo 
seem like they should be feasible.

--

___
Python tracker 

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



[issue29908] Inconsistent crashing with an access violation

2017-03-28 Thread Eryk Sun

Eryk Sun added the comment:

I can confirm that the CRT function construct_environment_block() does cause an 
access violation sometimes when no "=x:" shell variables are defined in the 
current environment. These "=x:" environment variables are the way that Windows 
emulates DOS per-drive working directories in a shell. The API itself never 
sets these variables; it only uses them if they're defined.

You should be able to avoid this bug by defining the environment variable 
"=C:". The simplest way to do this in Python is via os.chdir. For example:

import os

cwd = os.getcwd()
try:
os.chdir('C:')
finally:
os.chdir(cwd)

The implementation of os.chdir calls SetCurrentDirectoryW, which, for a 
drive-relative path such as "C:", will first look for an "=x:" environment 
variable and otherwise default to the root directory. After it changes the 
process current working directory, chdir() calls GetCurrentDirectoryW and 
SetEnvironmentVariableW to set the new value of the "=x:" variable.

--

___
Python tracker 

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



[issue29929] Eliminate implicit __main__ relative imports

2017-03-28 Thread Nick Coghlan

Nick Coghlan added the comment:

In formulating a post to import-sig about this, I realised it made more sense 
to describe it in terms of the goal (eliminating implicit __main__ relative 
imports) rather than one possible technique for achieving that goal.

--
title: Idea: Make __main__ an implied package -> Eliminate implicit __main__ 
relative imports

___
Python tracker 

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



[issue29677] clarify docs about 'round()' accepting a negative integer for ndigits

2017-03-28 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Mariatta,

Yes, thank you, I will work on a pull request to address Victor's comment.  
Since it's my first time, I hope to read through the contributing docs and get 
this done today or tomorrow.

Thank you!

--

___
Python tracker 

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



[issue29931] ipaddress.ip_interface __lt__ check seems to be broken

2017-03-28 Thread Sanjay

New submission from Sanjay:

The less than check for ip_interface behavior seems weird. I am not sure if 
this is by design. We are just comparing the network address but when network 
address is equal we should compare the ip address.
The expectation is if a < b is False then b <= a must be True
>>> import ipaddress
>>> a = ipaddress.ip_interface("1.1.1.1/24")
>>> b = ipaddress.ip_interface("1.1.1.2/24")
>>> a < b
False
>>> b <= a
False
>>> a == b
False
>>> 
This happens with both v4 and v6
The tests were passing because in ComparisonTests we were testing with prefix 
length of 32 which means the whole ip address became the network address.
I have made a fix here:
https://github.com/s-sanjay/cpython/commit/14975f58539308b7af5a1519705fb8cd95ad7951
I can add more tests and send PR but before that I wanted to confirm the 
behavior.

--
components: Library (Lib)
messages: 290695
nosy: Sanjay, ncoghlan, pmoody, xiang.zhang
priority: normal
severity: normal
status: open
title: ipaddress.ip_interface __lt__ check seems to be broken
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



[issue29928] Add f-strings to Glossary

2017-03-28 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

It's odd how 'f-string' just caught on when byte, raw and unicode strings never 
really did (at least I personally don't see many people using b-string, 
r-string and u-string respectively).

Shouldn't an entry for them be made too if 'f-string' would be added?

As for the name used by everyone, you can't blame them, f-string is a term used 
throughout PEP 498.

I guess a a new discussion might be warranted where people can decide if a new 
term should be thought of or if the negative effects of using the current 
aren't all that bad.

--
nosy: +Jim Fasarakis-Hilliard

___
Python tracker 

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



[issue29798] Handle "git worktree" in "make patchcheck"

2017-03-28 Thread Nick Coghlan

Nick Coghlan added the comment:

No, that's the bug that prompted me to reopen the issue. I just got distracted 
and never submitted the follow-up PR :(

--

___
Python tracker 

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



[issue29921] datetime validation is stricter in 3.6.1 than previous versions

2017-03-28 Thread STINNER Victor

STINNER Victor added the comment:

2017-03-28 10:17 GMT+02:00 m-parry :
> "I think it's the case that **some routes via the C API** now reject out of 
> range values that were previously permitted."
>
> The pywin32 repro I gave above eventually calls 
> PyDateTimeAPI->DateTime_FromDateAndTime():
>
> http://pywin32.hg.sourceforge.net/hgweb/pywin32/pywin32/file/85c1c99b1cb8/win32/src/PyTime.cpp#l980

You can please identify which C function is called and dump which
parameters are passed to the function?

--

___
Python tracker 

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



[issue29921] datetime validation is stricter in 3.6.1 than previous versions

2017-03-28 Thread m-parry

m-parry added the comment:

That's just a Python C API call. It looks like it eventually resolves to 
new_datetime_ex(30828, 9, 13, 3, 48, 5, 48, Py_None, 
PyDateTime_DateTimeType).

We also have some internal code that sees a similar problem from calling 
PyTime_FromTime(), that was similarly affected by this change. In one example, 
that appears to resolve to new_time_ex(24, 0, 0, 0, Py_None, 
PyDateTime_TimeType). Again, under <3.6.1, that was accepted. (And again, I am 
making no argument about the validity of this code, just with regards to 
backwards compatibility.)

--

___
Python tracker 

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



[issue29931] ipaddress.ip_interface __lt__ check seems to be broken

2017-03-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Indeed, this looks as a bug.

>>> a < b
False
>>> b > a
True

--
nosy: +serhiy.storchaka
stage:  -> needs patch

___
Python tracker 

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



[issue29932] Missing word ("be") in error message ("first argument must a type object")

2017-03-28 Thread SylvainDe

New submission from SylvainDe:

Very uninteresting issue but error message should probably be "first argument 
must BE a type object" in `array__array_reconstructor_impl` in 
Modules/arraymodule.c .

This has been introduced with ad077154d0f305ee0ba5bf41d3cb47d1d9c43e7b .

I'll handle this issue in the next day.

--
messages: 290701
nosy: SylvainDe
priority: normal
severity: normal
status: open
title: Missing word ("be") in error message ("first argument must a type 
object")
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



[issue29930] asyncio.StreamWriter.drain raises an AssertionError under heavy use

2017-03-28 Thread STINNER Victor

Changes by STINNER Victor :


Added file: http://bugs.python.org/file46761/server.py

___
Python tracker 

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



[issue29930] asyncio.StreamWriter.drain raises an AssertionError under heavy use

2017-03-28 Thread STINNER Victor

STINNER Victor added the comment:

Modified client and server to be able to reproduce the issue on a LAN.

--
nosy: +haypo
Added file: http://bugs.python.org/file46762/client.py

___
Python tracker 

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



[issue29930] asyncio.StreamWriter.drain raises an AssertionError under heavy use

2017-03-28 Thread STINNER Victor

STINNER Victor added the comment:

The bug occurs when the transport pauses writing and the client code calls 
drain() multiple times in parallel.

--

___
Python tracker 

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



[issue29930] asyncio.StreamWriter.drain raises an AssertionError under heavy use

2017-03-28 Thread STINNER Victor

STINNER Victor added the comment:

I understood that:

* code fills the write buffer of the transport until writing is paused because 
of the high water mark
* a function calls drain() which waits until the server reads until packets to 
reduce the size of the write buffer
* a second function calls drain(), but the first function is already waiting on 
drain(): bug occurs since the code doesn't support having two coroutines 
waiting on drain() in parallel

Notes:

* the minimum is to document that drain() must not be called twice in parallel. 
Right now, nothing is said about that:
https://docs.python.org/dev/library/asyncio-stream.html#asyncio.StreamWriter.drain

* we can probably design something to allow to have multiple coroutines waiting 
on the same event

--

Metathink told me that he got the bug on a much more complex code using 
websockets. Thank you Metathink for isolating the bug to a few lines of Python 
code with simpler asyncio functions!

--

___
Python tracker 

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



[issue29643] --enable-optimizations compiler flag has no effect

2017-03-28 Thread INADA Naoki

INADA Naoki added the comment:


New changeset 8cea5929f52801b0ce5928b46ef836e99a24321a by INADA Naoki (Alex 
Wang) in branch 'master':
bpo-29643: Fix check for --enable-optimizations (GH-129)
https://github.com/python/cpython/commit/8cea5929f52801b0ce5928b46ef836e99a24321a


--
nosy: +inada.naoki

___
Python tracker 

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



[issue29930] asyncio.StreamWriter.drain raises an AssertionError under heavy use

2017-03-28 Thread STINNER Victor

STINNER Victor added the comment:

Proof-of-concept of patched drain() to support multiple waiters.

I don't see any strong reason to not allow two coroutines to wait on drain() in 
parallel?

I'm too lazy to write a full patch with unit tests, doc changed, etc. I started 
with a PoC to discuss the solution.

--
keywords: +patch
Added file: http://bugs.python.org/file46763/drain_multiple_waiters.patch

___
Python tracker 

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



[issue29643] --enable-optimizations compiler flag has no effect

2017-03-28 Thread INADA Naoki

Changes by INADA Naoki :


--
pull_requests: +768

___
Python tracker 

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



[issue29643] --enable-optimizations compiler flag has no effect

2017-03-28 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +769

___
Python tracker 

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



[issue29643] --enable-optimizations compiler flag has no effect

2017-03-28 Thread INADA Naoki

Changes by INADA Naoki :


--
pull_requests: +770

___
Python tracker 

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



[issue29921] datetime validation is stricter in 3.6.1 than previous versions

2017-03-28 Thread STINNER Victor

STINNER Victor added the comment:

> Again, under <3.6.1, that was accepted. (And again, I am making no argument 
> about the validity of this code, just with regards to backwards 
> compatibility.)

You are right that I modified the C API of datetime in Python 3.6.1 to make it 
stricter and reject invalid dates.

I disagree that the "backward incompatibility" part: I consider that it's a 
bugfix, and not a behaviour change.

The datetime module was enhanced in Python 3.6 with the PEP 495 to handle 
better DST changes: a new "fold" attribute was added. Computing this attribute 
requires to handle valid dates in the [datetime.datetime.min; 
datetime.datetime.max] range. Otherwise, you get strange errors like 
OverflowError: see issue #29100.

If Python older than 3.6.1 allowed creating invalid dates, it was a bug, and 
now this bug can lead to new bugs because of the implementation of the PEP 495.

Please fix you code. I now close this issue as NOTABUG. Stricter input 
validation was a deliberate choice.

--
nosy: +belopolsky
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



[issue29100] datetime.fromtimestamp() doesn't check min/max year anymore: regression of Python 3.6

2017-03-28 Thread STINNER Victor

STINNER Victor added the comment:

m-parry reported the issue #29921 "datetime validation is stricter in 3.6.1 
than previous versions". He is right, the C API of Python 3.6.1 is now stricter 
than Python 2.7 and 3.5. The C API doesn't allow anymore to create datetime 
objects outside the [datetime.datetime.min; datetime.datetime.max] range (what 
I would call "invalid" datetime objects). I closed the bug as NOT A BUG since I 
consider that it's a deliberate design choice and not a regression.

--

___
Python tracker 

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



[issue29930] Waiting for asyncio.StreamWriter.drain() twice in parallel raises an AssertionError when the transport stopped writing

2017-03-28 Thread STINNER Victor

Changes by STINNER Victor :


--
title: asyncio.StreamWriter.drain raises an AssertionError under heavy use -> 
Waiting for asyncio.StreamWriter.drain() twice in parallel raises an 
AssertionError when the transport stopped writing

___
Python tracker 

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



[issue29921] datetime validation is stricter in 3.6.1 than previous versions

2017-03-28 Thread m-parry

m-parry added the comment:

pywin32 is not my code. It is a ubiquitous Python library on Windows that 
cannot be used under Python 3.6.1.

--

___
Python tracker 

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



[issue29932] Missing word ("be") in error message ("first argument must a type object")

2017-03-28 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

Indeed, quickly glancing over the error messages there's another small typo in 
https://github.com/python/cpython/blob/master/Modules/arraymodule.c#L2371:

"array indices must be integer" -> "array indices must be integers"

might as well fix that in your PR too (maybe also change the title to: "Fix 
small error message typos in arraymodule.c"?)

--
nosy: +Jim Fasarakis-Hilliard

___
Python tracker 

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



[issue29643] --enable-optimizations compiler flag has no effect

2017-03-28 Thread INADA Naoki

Changes by INADA Naoki :


--
pull_requests: +771

___
Python tracker 

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



[issue29933] asyncio: set_write_buffer_limits() doc doesn't specify unit of the parameters

2017-03-28 Thread STINNER Victor

New submission from STINNER Victor:

The asyncio set_write_buffer_limits() documentation doesn't specify unit of 
high and low parameters. Moreover, it would to explain better the effect of 
high and low:

* pause_writing() is called when the buffer size becomes larger or equal to high
* (if writing is pause) resume_writing() is called when the buffer size becomes 
smaller or equal to low

--
assignee: docs@python
components: Documentation, asyncio
keywords: easy
messages: 290712
nosy: docs@python, haypo, yselivanov
priority: normal
severity: normal
status: open
title: asyncio: set_write_buffer_limits() doc doesn't specify unit of the 
parameters
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



[issue29928] Add f-strings to Glossary

2017-03-28 Thread R. David Murray

R. David Murray added the comment:

"raw" and "byte" are one syllable names, and thus as easy and more meaningful 
to say than "r-string" or "b-string".  "unicode string" is more descriptive and 
not much longer, but "u-string" does occasionally get used, though mostly in a 
python3 context where you want to differentiate it from normal unadorned 
unicode strings.  If you want to replace 'f-string' in the vernacular, you need 
a one or two syllable word that is descriptive.  The only real candidate is 
"format string", and we already use that for the older types of format strings. 
 If those were to fall out of use, I'd expect "format string" to come to mean 
what f-string does now.  But by the time that happens, f-string will be more 
entrenched than it is now.  We could try for "format expression", but that is 
more syllables, and faces headwind because the f prefix obviously makes it a 
"string"-like object, and that's how we think about it: a string with 
expressions inside it, instead of as an expression itself.

In summary, I think we're stuck with f-string.  It's a term of art: a short 
expression that encapsulates a non-trivial concept for which there are no 
precise existing words.

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



[issue29933] asyncio: set_write_buffer_limits() doc doesn't specify unit of the parameters

2017-03-28 Thread STINNER Victor

STINNER Victor added the comment:

See also https://github.com/asyncio-doc/asyncio-doc/issues/17 for a more 
general documentation request on asyncio parameters (on the external asyncio 
doc).

--

___
Python tracker 

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



[issue29932] Missing word ("be") in error message ("first argument must a type object")

2017-03-28 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

..and another one here 
https://github.com/python/cpython/blob/master/Modules/arraymodule.c#L2145:

"__reduce_ex__ argument should an integer" -> ".. should be .."

--

___
Python tracker 

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



[issue29929] Eliminate implicit __main__ relative imports

2017-03-28 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue29926] time.sleep ignores _thread.interrupt_main()

2017-03-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Eryk, would the addition go before or after "trip_signal(SIGINT);"

I posted "Issue with _thread.interrupt_main (29926)" on pydev list.  Steven 
D'Aprano verified delayed response on *nix.

Martin Panter said
"Looking at the implementation, _thread.interrupt_main just calls 
PyErr_SetInterrupt. It doesn’t appear to send a signal. I played with “strace” 
and couldn’t see any evidence of a signal. I guess it just sets a flag that 
will be polled. To actually interrupt the “sleep” call, you might need to use 
“pthread_kill” or similar (at least on Unix)."

--

___
Python tracker 

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



[issue29933] asyncio: set_write_buffer_limits() doc doesn't specify unit of the parameters

2017-03-28 Thread STINNER Victor

STINNER Victor added the comment:

It would also be nice to:

* link to set_write_buffer_limits() from drain()
* link to set_write_buffer_limits() from pause_writing() / resume_writing()
* mention asyncio default values for set_write_buffer_limits(): low=16 kB, 
high=64 kB (kb? kib? i never know :-/)

--

___
Python tracker 

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



[issue19824] string.Template: Rewrite docs to emphasize i18n use case

2017-03-28 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:


New changeset 9f74deba784fc8781d13ed564f69c02ed7c331bb by Barry Warsaw in 
branch 'master':
Improve the documentation for template strings (#856)
https://github.com/python/cpython/commit/9f74deba784fc8781d13ed564f69c02ed7c331bb


--

___
Python tracker 

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



[issue20314] Potentially confusing formulation in 6.1.4. Template strings

2017-03-28 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:


New changeset 9f74deba784fc8781d13ed564f69c02ed7c331bb by Barry Warsaw in 
branch 'master':
Improve the documentation for template strings (#856)
https://github.com/python/cpython/commit/9f74deba784fc8781d13ed564f69c02ed7c331bb


--

___
Python tracker 

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



[issue12518] In string.Template it's impossible to transform delimiter in the derived class

2017-03-28 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:


New changeset 9f74deba784fc8781d13ed564f69c02ed7c331bb by Barry Warsaw in 
branch 'master':
Improve the documentation for template strings (#856)
https://github.com/python/cpython/commit/9f74deba784fc8781d13ed564f69c02ed7c331bb


--

___
Python tracker 

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



[issue12518] In string.Template it's impossible to transform delimiter in the derived class

2017-03-28 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
resolution:  -> fixed
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



[issue19824] string.Template: Rewrite docs to emphasize i18n use case

2017-03-28 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
resolution:  -> fixed
stage: needs patch -> 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



[issue20314] Potentially confusing formulation in 6.1.4. Template strings

2017-03-28 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
resolution:  -> fixed
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



[issue20314] Potentially confusing formulation in 6.1.4. Template strings

2017-03-28 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


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

___
Python tracker 

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



[issue16011] "in" should be consistent with return value of __contains__

2017-03-28 Thread R. David Murray

R. David Murray added the comment:


New changeset 0ae7c8bd614d3aa1fcaf2d71a10ff1148c80d9b5 by R. David Murray (Amit 
Kumar) in branch 'master':
bpo-16011 clarify that 'in' always returns a boolean value
https://github.com/python/cpython/commit/0ae7c8bd614d3aa1fcaf2d71a10ff1148c80d9b5


--

___
Python tracker 

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



[issue29921] datetime validation is stricter in 3.6.1 than previous versions

2017-03-28 Thread Ned Deily

Ned Deily added the comment:

FTR, there is now a pywin32 issue (opened by the OP) on this:  
https://sourceforge.net/p/pywin32/bugs/748/

--
nosy: +ned.deily

___
Python tracker 

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



[issue29928] Add f-strings to Glossary

2017-03-28 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

The abstract of PEP 498 states:
```
In this PEP, such strings will be referred to as "f-strings", taken from the 
leading character used to denote such strings, and standing for "formatted 
strings".
```

--

___
Python tracker 

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



[issue29694] race condition in pathlib mkdir with flags parents=True

2017-03-28 Thread Armin Rigo

Armin Rigo added the comment:

Changes including a test.  The test should check all combinations of 
"concurrent" creation of the directory.  It hacks around at 
pathlib._normal_accessor.mkdir (patching "os.mkdir" has no effect, as the 
built-in function was already extracted and stored inside 
pathlib._normal_accessor).

--
Added file: http://bugs.python.org/file46764/x2.diff

___
Python tracker 

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



[issue16011] "in" should be consistent with return value of __contains__

2017-03-28 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +773

___
Python tracker 

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



[issue16011] "in" should be consistent with return value of __contains__

2017-03-28 Thread Mariatta Wijaya

Changes by Mariatta Wijaya :


--
pull_requests: +772

___
Python tracker 

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



[issue10379] locale.format() input regression

2017-03-28 Thread R. David Murray

Changes by R. David Murray :


--
stage: needs patch -> backport needed

___
Python tracker 

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



[issue29934] % formatting fails to find formatting code in bytes type after a null byte

2017-03-28 Thread Mert Bora Alper

New submission from Mert Bora Alper:

Hello,

In Python 3.6.0, % formatting fails to find formatting code after a null byte 
in bytes type.

Example:
>>> "%s_\x00%s" % ("hello", "world")
'hello_\x00world'
>>> b"%s_\x00%s" % (b"hello", b"world")
Traceback (most recent call last):
  File "", line 1, in 
TypeError: not all arguments converted during bytes formatting

In contrast, the exact same code works as expected in Python 3.5:

>>> "%s_\x00%s" % ("hello", "world")
'hello_\x00world'
>>> b"%s_\x00%s" % (b"hello", b"world")
b'hello_\x00world'

I used Python 3.6.0 that I installed using pyenv 1.0.8 on Kubuntu 16.04 x86_64.

--
messages: 290724
nosy: boramalper
priority: normal
severity: normal
status: open
title: % formatting fails to find formatting code in bytes type after a null 
byte
type: behavior
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



[issue29934] % formatting fails to find formatting code in bytes type after a null byte

2017-03-28 Thread Mert Bora Alper

Changes by Mert Bora Alper :


--
components: +Interpreter Core

___
Python tracker 

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



[issue10379] locale.format() input regression

2017-03-28 Thread R. David Murray

Changes by R. David Murray :


--
stage: backport needed -> needs patch

___
Python tracker 

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



[issue16011] "in" should be consistent with return value of __contains__

2017-03-28 Thread R. David Murray

R. David Murray added the comment:

Thanks,

--
stage: patch review -> backport needed

___
Python tracker 

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



[issue29934] % formatting fails to find formatting code in bytes type after a null byte

2017-03-28 Thread Xiang Zhang

Xiang Zhang added the comment:

Yes, this is a regression in 3.6.0 and it has been fixed in #29714 for 3.6.1. 
Try the new version. :-)

--
nosy: +xiang.zhang
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> can't interpolate byte string with \x00 before replacement 
identifier

___
Python tracker 

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



[issue29934] % formatting fails to find formatting code in bytes type after a null byte

2017-03-28 Thread Xiang Zhang

Xiang Zhang added the comment:

Sorry, the fix is for 3.6.2 so 3.6.1 would still suffer from it. :-(

--

___
Python tracker 

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



[issue29926] time.sleep ignores _thread.interrupt_main()

2017-03-28 Thread Eryk Sun

Eryk Sun added the comment:

For Windows the event should be set after trip_signal(SIGINT). That way the 
flag is guaranteed to be tripped when PyErr_CheckSignals is called from the 
time module's pysleep() function. This in turn calls the default SIGINT handler 
that raises a KeyboardInterrupt.

--

___
Python tracker 

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



[issue29904] Fix a number of error message typos

2017-03-28 Thread Jim Fasarakis-Hilliard

Changes by Jim Fasarakis-Hilliard :


--
resolution:  -> fixed
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



[issue11913] sdist refuses README.rst

2017-03-28 Thread Ryan Gonzalez

Ryan Gonzalez added the comment:

FWIW, I opened a PR for this: https://github.com/python/cpython/pull/563

--
nosy: +refi64

___
Python tracker 

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



[issue29643] --enable-optimizations compiler flag has no effect

2017-03-28 Thread INADA Naoki

INADA Naoki added the comment:


New changeset f01de61a8efea8319c65365898982f929d59a895 by INADA Naoki in branch 
'3.6':
bpo-29643: Fix check for --enable-optimizations (GH-869)
https://github.com/python/cpython/commit/f01de61a8efea8319c65365898982f929d59a895


--

___
Python tracker 

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



[issue29643] --enable-optimizations compiler flag has no effect

2017-03-28 Thread INADA Naoki

INADA Naoki added the comment:


New changeset e6a49531568561fe5aaf662259ecb7b4bc2426be by INADA Naoki in branch 
'3.5':
bpo-29643: Fix check for --enable-optimizations (GH-871)
https://github.com/python/cpython/commit/e6a49531568561fe5aaf662259ecb7b4bc2426be


--

___
Python tracker 

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



[issue29930] Waiting for asyncio.StreamWriter.drain() twice in parallel raises an AssertionError when the transport stopped writing

2017-03-28 Thread Aymeric Augustin

Aymeric Augustin added the comment:

For context, websockets calls `yield from self.writer.drain()` after each write 
in order to provide backpressure.

If the output buffer fills up, calling API coroutines that write to the 
websocket connection becomes slow and hopefully the backpressure will propagate 
(in a correctly implemented application).

This is a straightforward application of the only use case described in the 
documentation.



I would find it annoying to have to serialize calls to drain() myself. It 
doesn't feel like something the "application" should care about. (websockets is 
the application from asyncio's perspective.)

I'm wondering if it could be a problem if a bunch of corountines were waiting 
on drain() and got released simultaneously. I don't think it would be a problem 
for websockets. Since my use case seems typical, there's a good chance this 
also applies to other apps.

So I'm in favor of simply allowing an arbitrary number of coroutines to wait on 
drain() in parallel, if that's feasible.

--
nosy: +aymeric.augustin

___
Python tracker 

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



[issue29104] Left bracket remains in format string result when '\' preceeds it

2017-03-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ping again.

--

___
Python tracker 

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



[issue10379] locale.format() input regression

2017-03-28 Thread R. David Murray

R. David Murray added the comment:


New changeset 1cf93a76c2cf307f2e1e514a8944864f746337ea by R. David Murray 
(Garvit Khatri) in branch 'master':
bpo-10379: add 'monetary' to format_string, deprecate format
https://github.com/python/cpython/commit/1cf93a76c2cf307f2e1e514a8944864f746337ea


--

___
Python tracker 

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



[issue10379] locale.format() input regression

2017-03-28 Thread R. David Murray

R. David Murray added the comment:

Oops.  I merged the patch without coming back here first :(.  Still getting 
used to the new workflow.

It turns out that format has a parameter, monetary, that isn't supported by 
format_string.  So what we did was add that parameter to format_string and 
deprecate format.

If there is objection to this solution I will revert the merge.

--

___
Python tracker 

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



[issue29908] Inconsistent crashing with an access violation

2017-03-28 Thread Steve Dower

Steve Dower added the comment:

Thanks for the link! I've reported it to the C Runtime team and they'll get it 
fixed. (Because this is an operating system component, the fix will come 
through normal Windows Updates and apply to any version of Python 3.5+, so I'd 
rather not build a workaround into the product for it.)

--

___
Python tracker 

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



[issue13349] Non-informative error message in index() and remove() functions

2017-03-28 Thread Jim Fasarakis-Hilliard

Changes by Jim Fasarakis-Hilliard :


--
pull_requests: +775

___
Python tracker 

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



[issue29935] list and tuple index methods should accept None parameters

2017-03-28 Thread George King

New submission from George King:

As of python3.6, passing None to the start/end parameters of `list.index` and 
`tuple.index` raises the following exception:
"slice indices must be integers or None or have an __index__ method"

This suggests that the intent is to support None as a valid input. This would 
be quite useful for the end parameter, where the sensible default is len(self) 
rather than a constant. Note also that str, bytes, and bytearray all support 
None.

I suggest that CPython be patched to support None for start/end. Otherwise, at 
the very least the exception message should be changed.

Accepting None will make the optional start/end parameters for this method more 
consistent across the types, which is especially helpful when using type 
annotations / checking.

--
messages: 290737
nosy: gwk
priority: normal
severity: normal
status: open
title: list and tuple index methods should accept None parameters

___
Python tracker 

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



[issue29677] clarify docs about 'round()' accepting a negative integer for ndigits

2017-03-28 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
pull_requests: +776

___
Python tracker 

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



[issue29936] Typo in __GNU*C*_MINOR__ guard affecting gcc 3.x

2017-03-28 Thread Niklas Fiekas

New submission from Niklas Fiekas:

The patch in http://bugs.python.org/issue16881 disables the nicer macro for gcc 
3.x due to a small typo.

The build is not failing. The guard just unnescessarily evaluates to false.

--
components: Interpreter Core
messages: 290738
nosy: niklasf
priority: normal
severity: normal
status: open
title: Typo in __GNU*C*_MINOR__ guard affecting gcc 3.x
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



[issue29936] Typo in __GNU*C*_MINOR__ guard affecting gcc 3.x

2017-03-28 Thread Niklas Fiekas

Changes by Niklas Fiekas :


--
pull_requests: +777

___
Python tracker 

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



[issue16011] "in" should be consistent with return value of __contains__

2017-03-28 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset 0957f262c5e47167efd520624557aebdc61bfda8 by Mariatta in branch 
'3.5':
bpo-16011: clarify that 'in' always returns a boolean value (GH-152) (GH-875)
https://github.com/python/cpython/commit/0957f262c5e47167efd520624557aebdc61bfda8


--
nosy: +Mariatta

___
Python tracker 

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



[issue29936] Typo in __GNU*C*_MINOR__ guard affecting gcc 3.x

2017-03-28 Thread Niklas Fiekas

Changes by Niklas Fiekas :


--
components: +Build -Interpreter Core
nosy: +Jeffrey.Armstrong, christian.heimes
type:  -> compile error

___
Python tracker 

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



[issue29935] list and tuple index methods should accept None parameters

2017-03-28 Thread Jim Fasarakis-Hilliard

Changes by Jim Fasarakis-Hilliard :


--
components: +Interpreter Core
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



[issue16011] "in" should be consistent with return value of __contains__

2017-03-28 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset c4021af50526f488c0c280e7c7eaa83ef80ae1df by Mariatta in branch 
'3.6':
bpo-16011: clarify that 'in' always returns a boolean value (GH-874)
https://github.com/python/cpython/commit/c4021af50526f488c0c280e7c7eaa83ef80ae1df


--

___
Python tracker 

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



[issue29935] list and tuple index methods should accept None parameters

2017-03-28 Thread George King

Changes by George King :


--
type:  -> enhancement

___
Python tracker 

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



[issue22049] argparse: type= doesn't honor nargs > 1

2017-03-28 Thread paul j3

Changes by paul j3 :


--
resolution:  -> not a bug
stage: needs patch -> 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



[issue29643] --enable-optimizations compiler flag has no effect

2017-03-28 Thread INADA Naoki

INADA Naoki added the comment:


New changeset 6a04ef7ceddae0930eba6cc57ba2ebfcef00abab by INADA Naoki in branch 
'2.7':
bpo-29643: Fix check for --enable-optimizations (GH-873)
https://github.com/python/cpython/commit/6a04ef7ceddae0930eba6cc57ba2ebfcef00abab


--

___
Python tracker 

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



[issue29643] --enable-optimizations compiler flag has no effect

2017-03-28 Thread INADA Naoki

Changes by INADA Naoki :


--
resolution:  -> fixed
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



[issue13349] Non-informative error message in index() and remove() functions

2017-03-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

>>> [1, 2, 3].index("'")
Traceback (most recent call last):
  File "", line 1, in 
ValueError: ""'"" not in list

Aren't too much quotes?

--

___
Python tracker 

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



[issue29926] time.sleep ignores _thread.interrupt_main()

2017-03-28 Thread Nathaniel Smith

Nathaniel Smith added the comment:

If you want to trigger the standard signal handling logic, then raise(SIGINT) 
is also an option. On unix it probably won't help because of issue 21895, but 
using raise() here + fixing 21895 by using pthread_kill in the c level signal 
handler would together give a pretty simple and robust way to pretend that the 
user hit control-C.

But... interrupt_main isn't documented to raise a SIGINT, it's documented to 
raise KeyboardInterrupt. These are very different, e.g. if the user has 
installed a custom handler or even set SIGINT to SIG_IGN or masked it. (In the 
later two cases, using pthread_kill to send a signal to the main thread *won't* 
interrupt any ongoing syscall.) This is *much* more difficult to make work 
correctly. And actually what IDLE wants is a fake control-C anyway!

So I'd suggest either redefining the semantics of interrupt_main to be "acts as 
if SIGINT was received" or else abandoning interrupt_main to its slightly-buggy 
semantics and adding a new function that does raise(SIGINT) and switching IDLE 
to use this new function. And fix issue 21895 in either case.

--
nosy: +njs

___
Python tracker 

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



[issue24251] Different behavior for argparse between 2.7.8 and 2.7.9 when adding the same arguments to the root and the sub commands

2017-03-28 Thread paul j3

Changes by paul j3 :


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



[issue13349] Non-informative error message in index() and remove() functions

2017-03-28 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

Yes, that does look like too much. My rationale for adding quotes around the 
value was in order to make it more clear in cases where the repr exceeds 100 
characters. 

Instead of:

   Traceback (most recent call last):
 File "", line 1, in 
   ValueError: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 
18, 19, 20, 21, 22, 23, 24, 25, 26, 2 not in list

Have it clearly distinguished by using "":

   Traceback (most recent call last):
 File "", line 1, in 
   ValueError: "[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 
18, 19, 20, 21, 22, 23, 24, 25, 26, 2" not in list

I'm not sure if there's a trivial way to not display so many quotes in the case 
you supplied, you're better suited to decide if this can be done somehow.

--
versions: +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



[issue29926] time.sleep ignores _thread.interrupt_main()

2017-03-28 Thread Nathaniel Smith

Nathaniel Smith added the comment:

(oh, in case it wasn't obvious: the advantage of raise() over kill() and 
pthread_kill() is that raise() works everywhere, including Windows, so it would 
avoid platform specific logic. Or if you don't like raise() for some reason 
then you can get the same effect by doing handler = PyOS_getsig(SIGINT); if 
(handler) handler(SIGINT); )

(Also, this is all assuming the python 3 logic on Windows. On Windows versions 
of python 2 I can't see any way to make time.sleep interruptible without 
significant rewriting. The problem is that on py2 the special Event used to 
signal the arrival of a control-C is a private variable that gets hooked up 
directly to Windows's low-level control-C logic, and there's effectively no way 
to get at it from outside. You might think GenerateConsoleCtrlEvent would help, 
but it is broken in too many ways for me to fit in this text box.)

--

___
Python tracker 

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



[issue23487] argparse: add_subparsers 'action' broken

2017-03-28 Thread paul j3

paul j3 added the comment:

I'm going to close this.  At most it calls for a documentation change.  But 
saying something like

   It must be compatible with argparse._SubParsersAction.

will just confuse the average user.  Any customization of this action class is 
an advanced topic, that requires familiarity with the code, not just the 
documentation.

--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue13349] Non-informative error message in index() and remove() functions

2017-03-28 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

Could use `%.100S` instead of `%.100R` but I'm not sure of the downsides that 
might entail.

--

___
Python tracker 

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



[issue13349] Non-informative error message in index() and remove() functions

2017-03-28 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Error messages should use repr(). For example str() of bytes object emits a 
warning or error.

See issue26090 for the issue with truncated reprs.

--

___
Python tracker 

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



[issue29936] Typo in __GNU*C*_MINOR__ guard affecting gcc 3.x

2017-03-28 Thread Jeffrey Armstrong

Changes by Jeffrey Armstrong :


--
nosy:  -Jeffrey.Armstrong

___
Python tracker 

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



[issue29926] time.sleep ignores _thread.interrupt_main()

2017-03-28 Thread Eryk Sun

Eryk Sun added the comment:

Nathaniel's suggestion to update the implementation to work with raise(SIGINT) 
sounds like a good idea.

Fpr Windows, GenerateConsoleCtrlEvent is definitely a non-starter. 
PyErr_SetInterrupt shouldn't depend on having an attached console. IDLE 
generally runs without one. Even if the process has a console, there's no way 
to limit GenerateConsoleCtrlEvent to just the current process. It works with 
process groups, like POSIX killpg(). Typically a process is created in the 
session's Winlogon process group unless a new group was created by calling 
CreateProcess with the flag CREATE_NEW_PROCESS_GROUP. If you call 
GenerateConsoleCtrlEvent on a process ID that's not a group ID, the console 
behaves as if you passed group ID 0, which broadcasts to all processes attached 
to the console.

--

___
Python tracker 

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



[issue29935] list and tuple index methods should accept None parameters

2017-03-28 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue29937] argparse mutex group should allow mandatory parameters

2017-03-28 Thread Mark Nolan

New submission from Mark Nolan:

I see elsewhere, and from use, that a mutex group will not support mandatory 
positional parameters.

TBH, I don't understand why this should be any different from any other option, 
but if it must, then I think it should follow the 'required' parameter of the 
mutex.

So, it should be possible to have a mutex group where one option must be chosen 
and that option must have positional parameters.

(My first post here. Not sure of any other way to discuss with the argparse 
development group. Point me somewhere else if appropriate).

--
components: Library (Lib)
messages: 290750
nosy: Mark Nolan
priority: normal
severity: normal
status: open
title: argparse mutex group should allow mandatory parameters
type: enhancement
versions: Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue29926] time.sleep ignores _thread.interrupt_main()

2017-03-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Even is IDLE is started from a console, the user execution process is not 
attached to one.

What I want, from an IDLE perspective, is for ^C in IDLE's shell to work as 
well as it does in a terminal.  That means either fixing _thread.interrupt_main 
to always do what it usually does (from a user perspective), or to be given 
something else to use in .interrupt_the_server() that does so.

The current workaround for stopping runaway code in interactive mode, 
restarting the shell with cntl-F6 or the menu entry Shell => Restart Shell, is 
a) obscure and not known to most beginners, and b) does too much in that it 
throws away the workspace.  It is much like closing a terminal Window with [X], 
and restarting the terminal and python, instead of using ^C.

Viktor, I am nosying you because of your posts to #21895.  Do you have any 
comments on this issue?

--

___
Python tracker 

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



[issue29931] ipaddress.ip_interface __lt__ check seems to be broken

2017-03-28 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +778

___
Python tracker 

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



[issue19791] test_pathlib should use can_symlink or skip_unless_symlink from test.support

2017-03-28 Thread Brett Cannon

Brett Cannon added the comment:


New changeset ec1f5df46ed37aa3e839d20298c4b361a9a74bc4 by Brett Cannon 
(Vajrasky Kok) in branch 'master':
bpo-19791: Use functions from test support to check the symlink support. 
(GH-822)
https://github.com/python/cpython/commit/ec1f5df46ed37aa3e839d20298c4b361a9a74bc4


--
nosy: +brett.cannon

___
Python tracker 

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



[issue19791] test_pathlib should use can_symlink or skip_unless_symlink from test.support

2017-03-28 Thread Brett Cannon

Changes by Brett Cannon :


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



[issue11566] hypot define in pyconfig.h clashes with g++'s cmath

2017-03-28 Thread Matthew McCormick

Changes by Matthew McCormick :


--
pull_requests: +780

___
Python tracker 

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



[issue29928] Add f-strings to Glossary

2017-03-28 Thread Brett Cannon

Brett Cannon added the comment:

I think we're getting bogged down in a larger scope than this issue is about. 
All we should be discussing in this issue is whether adding an entry in the 
glossary for "f-string" as it's already being used in the community is bad 
(which I don't think it is since it's seeing use "in the wild"). No one is 
suggesting we change all the documentation to start using the shorthand/slang 
term, nor to introduce entries for other types of string literals where the 
community has not started using such terms (e.g. r-strings for raw strings). 
Heck, the docs already use "f-string" internally as a link target, i.e. 
https://docs.python.org/3/reference/lexical_analysis.html#f-strings (notice the 
intra-page link target).

IOW this is just making it easier for someone who comes across the term 
"f-string" to know what it means when they see it on e.g. Twitter, not trying 
to come up with a more accurate shorthand.

--
nosy: +brett.cannon

___
Python tracker 

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



  1   2   >