[issue27078] Make f'' strings faster than .format: BUILD_STRING opcode?

2016-07-15 Thread Antti Haapala

Antti Haapala added the comment:

Serhiy suggested this in Rietveld:

> For additional optimization we can pack all constant strings, parsed formats 
> and
> flags in one constant object and use the single LOAD_CONST. But this requires
> much larger changes (perhaps including changing the marshal format), and the
> benefit may be small. Maybe we'll get to it eventually, if this approach 
> proves
> efficient enough.

I was thinking about this and got an idea on how to do this too, without 
changes to marshal. Essentially, let TOS be a tuple of 

(flags, str1, str2, str3, str4, str5, str6, str7, str8, str9...)

flags would be n bytes for n-part format string; each byte would tell whether:

- the next component is a constant string (bit 0 = 0) from the tuple
- the next component is an interpolated value (bit 0 = 1)
   - and whether it has !s, !r, !a or default conversions (bits 1-2)
   - and whether it has extra argument to format() or not (bit 3) (argument is 
the next string from the tuple)

thus that tuple for

a, b = 'Hello', 'World!'
f'{a!s} {b:10}!'

would be

(b'\x03\x00\x05\x00', ' ', '10', '!')

and the opcodes would be

LOAD_FAST (b)
LOAD_FAST (a)
LOAD_CONST (0) (the tuple)
BUILD_FORMAT_STRING 3

--

___
Python tracker 

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



[issue27515] Dotted name re-import does not rebind after deletion

2016-07-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Decorator: as I tried to say in msg270456, the two examples are artificial 
tests stripped to the bare minimum.  So is use of email and charset, other than 
the fact that it exists in 2.7 as well as current 3.x.

The real situation where this issue came up for me is the subprocess that IDLE 
uses to execute user code, separate as much as possible from IDLE code.  
idlelib.run imports tkinter.  It them imports a few other idlelib modules that 
collectively import at least tkinter.font, tkinter.messagebox, and 
tkinter.simpledialog.  These indirect imports change the tkinter module.  
Consequently, when users submit code such as

import tkinter as tk
root = tk.Tk()
myfont = tk.font.Font(...)  # tk.font should raise NameError

it runs.  But when they try to run their 'correct' program directly with 
Python, they get the NameError and must add, for instance, 'import tk.font'.  
IDLE should help people write standard python code, not python with a few 
custom augmentations.

My first attempt to fix this was to have run execute 'del tkinter.font', 
etcetera after the indirect imports are done.  Then users would get the 
NameError they should.  But currently, they would continue getting the 
NameError even after adding the needed import. This is because the first font 
import in *their* code is the second or later font import in the process.  My 
second example is a condensed version of this failure.

--

___
Python tracker 

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



[issue27487] -m switch regression in Python 3.5.2 (under rare circumstances)

2016-07-15 Thread Nick Coghlan

Nick Coghlan added the comment:

No changes to 2.7 - the import system logic there is fairly different, since 
it's still using the old pre-importlib implementation.

For the "package.__main__" case, you're right that we don't want to emit the 
warning for "-m package", but we *do* want to emit the warning if 
package.__init__ imports package.__main__ for some reason.

And that's an excellent point about "finding spec" being implementer focused 
jargon - would "finding module specification" be clearer?

I'd still like to have a link between the error message and the fact the 
function is called "find_spec", and the official expansion of the abbreviation 
is "module specification" (hence _ModuleSpec).

--

___
Python tracker 

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



[issue27515] Dotted name re-import does not rebind after deletion

2016-07-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Guido: I am aware that 'import tkinter.font' can create 0, 1, or 2 new modules 
and 0, 1, or 2 new name bindings, one in the *importing* module and one in the 
*imported* module. You are correct that point 2 in the doc only talks about the 
importing module, making my paraphrase not correct for dotted names.  For the 
latter, the doc says.

"If the module being imported is not a top level module, then the name of the 
top level package that contains the module is bound in the local namespace as a 
reference to the top level package. The imported module must be accessed using 
its full qualified name rather than directly."

To me, this implies that the top level and intermediate packages will be 
modified as needed so that the 'full qualified name' works.

--

___
Python tracker 

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



[issue27515] Dotted name re-import does not rebind after deletion

2016-07-15 Thread Nick Coghlan

Nick Coghlan added the comment:

To fully remove an imported submodule, you also need to purge it from the 
sys.modules cache:

>>> import email.charset; email.charset

>>> import sys
>>> del email.charset; del sys.modules["email.charset"]
>>> import email.charset; email.charset


The reason we don't provide utilities in importlib to purge modules that way is 
because not all modules support being forcibly reloaded like this, and unlike 
imp.reload(), the errors happen at the point of importing it again later, not 
at the point where you purge it.

However, if you can figure out precisely which "tk" submodules IDLE implicitly 
imports, you can do one of three things for each one:

1. Change IDLE to avoid importing it in the subprocess where user code runs;
2. Test it supports reloading, and do "del tk.; del 
sys.modules['tk.']" in the IDLE subprocess after you're finished 
with it; or
3. Change tk.__init__ to implicitly import that submodule (such that code that 
only imports "tk" will still be able to access it)

--

___
Python tracker 

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



[issue15988] Inconsistency in overflow error messages of integer argument

2016-07-15 Thread Oren Milman

Oren Milman added the comment:

I would be happy to write a patch for this issue, if you don't mind.

Terry, as you were the one to commit the patch for #21559, I guess you are OK 
with keeping the OverflowError.
Also, I agree that the error message for '_testcapi.getargs_b(-1)' (and for 
similar cases) could be improved. IMHO, the wording in PyLong_AsLong is quite 
clear, and also fits here, e.g. 'Python int too small to convert to C unsigned 
byte' for '_testcapi.getargs_b(-1)'.

ISTM that implementing the patch by doing the following is quite 
straightforward:
- replacing PyLong_AsLong with PyLong_AsLongAndOverflow (as Serhiy suggested) 
in cases 'b', 'h' and 'i', in convertsimple in getargs.c
- changing some error messages in convertsimple
- changing PyLong_AsLong and _PyLong_AsInt so that they too would give more 
helpful error messages (according to the long-lived suggestions of '/* XXX: 
could be cute and give a different message for overflow == -1 */')

Serhiy, what did you mean by 'Unify an integer overflow error messages in 
different functions.'?

--
nosy: +Oren Milman

___
Python tracker 

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



[issue27518] small typo error in Grammar/Grammar

2016-07-15 Thread Stéphane Wirtel

New submission from Stéphane Wirtel:

Here is a small patch for the Grammar/Grammar file, there is a typo in the 
comments.

--
assignee: docs@python
components: Documentation
files: Grammar.diff
keywords: patch
messages: 270475
nosy: docs@python, matrixise
priority: normal
severity: normal
status: open
title: small typo error in Grammar/Grammar
versions: Python 3.6
Added file: http://bugs.python.org/file43730/Grammar.diff

___
Python tracker 

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



[issue27519] update the references to http://mercurial.selenic.com

2016-07-15 Thread Stéphane Wirtel

New submission from Stéphane Wirtel:

In the devguide, there are some references to 
http://mercurial.selenic.com/wiki/ but the website has been migrated to 
http://mercurial-scm.org/wiki/

--
assignee: docs@python
components: Documentation
messages: 270476
nosy: docs@python, matrixise
priority: normal
severity: normal
status: open
title: update the references to http://mercurial.selenic.com
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



[issue27519] update the references to http://mercurial.selenic.com

2016-07-15 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

I just updated to the new url of the Mercurial Wiki for the devguide.

--
components: +Devguide -Documentation
keywords: +patch
nosy: +ezio.melotti, willingc
versions: +Python 3.5
Added file: http://bugs.python.org/file43731/issue27519.diff

___
Python tracker 

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



[issue15988] Inconsistency in overflow error messages of integer argument

2016-07-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

You plan looks good, Oren.

I meant what you are planning in the last two items. There are also specific 
functions for converting to platform-depending integer types (size_t, time_t, 
uid_t, etc). Two most common patterns: "Python int too large to convert to C 
long" and "signed short integer is less/greater than maximum". Grep all code 
for raising OverflowError.

--
versions: +Python 3.6 -Python 3.4

___
Python tracker 

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



[issue15988] Inconsistency in overflow error messages of integer argument

2016-07-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

At this point in time, I have nothing further to add.  So follow Serhiy's 
advice.

--

___
Python tracker 

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



[issue27515] Dotted name re-import does not rebind after deletion

2016-07-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I am pursuing 1. for 3.6.  The first patch, moving 4 objects from pyshell to 
run and an import from run to pyshell, reduced a bloated len(sys.modules) from 
193 to 156. I hope to get under 100.  I will test 2., separately for each 
affected tkinter module, for 2.7 and 3.5.

--

___
Python tracker 

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



[issue27518] small typo error in Grammar/Grammar

2016-07-15 Thread Berker Peksag

Berker Peksag added the comment:

Thanks, Stéphane.

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type:  -> behavior
versions: +Python 3.5

___
Python tracker 

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



[issue27518] small typo error in Grammar/Grammar

2016-07-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset db5a5679a9de by Berker Peksag in branch '3.5':
Issue #27518: Fix typo in Grammar/Grammar
https://hg.python.org/cpython/rev/db5a5679a9de

New changeset bae0d7389e96 by Berker Peksag in branch 'default':
Issue #27518: Merge from 3.5
https://hg.python.org/cpython/rev/bae0d7389e96

--
nosy: +python-dev

___
Python tracker 

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



[issue27519] update the references to http://mercurial.selenic.com

2016-07-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 2edae149e8c5 by Berker Peksag in branch 'default':
Issue #27519: Update Mercurial links to mercurial-scm.org
https://hg.python.org/devguide/rev/2edae149e8c5

--
nosy: +python-dev

___
Python tracker 

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



[issue27519] update the references to http://mercurial.selenic.com

2016-07-15 Thread Berker Peksag

Berker Peksag added the comment:

Thanks!

--
nosy: +berker.peksag
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

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



[issue27519] update the references to http://mercurial.selenic.com

2016-07-15 Thread Berker Peksag

Changes by Berker Peksag :


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



[issue27519] update the references to http://mercurial.selenic.com

2016-07-15 Thread Decorater

Decorater added the comment:

Why not add url to the GUI version too that actually adds hg to the path?

--
nosy: +Decorater

___
Python tracker 

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



[issue27519] update the references to http://mercurial.selenic.com

2016-07-15 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

which GUI version ? it's in the documentation. please could you be more 
explicit ? thanks

--

___
Python tracker 

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



[issue27520] Issue when building PGO

2016-07-15 Thread Decorater

New submission from Decorater:

I get this issue when trying a PGO build it seems that some projects do not 
create a pgd.

(the link to simplify the size on here)
https://bpaste.net/show/c704ee912c53

--
components: Build, Tests, Windows
messages: 270487
nosy: Decorater, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Issue when building PGO
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



[issue27519] update the references to http://mercurial.selenic.com

2016-07-15 Thread Decorater

Decorater added the comment:

TortoiseHg

--

___
Python tracker 

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



[issue27519] update the references to http://mercurial.selenic.com

2016-07-15 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

because we don't want to change a tool but just an URL. you can create an other 
issue if you prefer to use TortoiseHg.

--

___
Python tracker 

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



[issue27521] Misleading compress level header on files created with gzip

2016-07-15 Thread Dor Dankner

New submission from Dor Dankner:

When creating a gzip file using the gzip module,
the wrong header is set as the compress level when not using the default (9).
the reason is that the header is set blindly as \002, without really checking 
what compress level is.

Patch to fix that behaviour is provided :)
(Patch tested on python 3.5, but relevant to 2.x versions too)

--
components: Extension Modules
files: gzip_compressionlvl_header_fix.patch
keywords: patch
messages: 270490
nosy: ddorda
priority: normal
severity: normal
status: open
title: Misleading compress level header on files created with gzip
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: 
http://bugs.python.org/file43732/gzip_compressionlvl_header_fix.patch

___
Python tracker 

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



[issue27512] os.fspath is certain to crash when exception raised in __fspath__

2016-07-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 35bf83ff0828 by Brett Cannon in branch 'default':
Issue #27512: Don't segfault when os.fspath() calls an object whose
https://hg.python.org/cpython/rev/35bf83ff0828

--
nosy: +python-dev

___
Python tracker 

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



[issue27512] os.fspath is certain to crash when exception raised in __fspath__

2016-07-15 Thread Brett Cannon

Brett Cannon added the comment:

Thanks for the patch, Xiang! Only thing I changed were braces around the `if` 
body in the C code and made the mock __fspath__() class raise an exception 
itself.

--

___
Python tracker 

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



[issue27512] os.fspath is certain to crash when exception raised in __fspath__

2016-07-15 Thread Brett Cannon

Changes by Brett Cannon :


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



[issue26844] Wrong error message during import

2016-07-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 22eaf6158e7b by Brett Cannon in branch '3.5':
Issue #26844: Fix imp.find_module() to have the exception related to
https://hg.python.org/cpython/rev/22eaf6158e7b

New changeset 46da639f7114 by Brett Cannon in branch 'default':
Merge for #26844
https://hg.python.org/cpython/rev/46da639f7114

--
nosy: +python-dev

___
Python tracker 

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



[issue26844] Wrong error message during import

2016-07-15 Thread Brett Cannon

Brett Cannon added the comment:

Thanks for the patch, Lev!

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



[issue27512] os.fspath is certain to crash when exception raised in __fspath__

2016-07-15 Thread R. David Murray

R. David Murray added the comment:

Looks like the buildbots aren't happy:

http://buildbot.python.org/all/builders/s390x%20SLES%203.x/builds/1396/steps/test/logs/stdio
http://buildbot.python.org/all/builders/s390x%20Debian%203.x/builds/1374

--
nosy: +r.david.murray
status: closed -> open

___
Python tracker 

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



[issue27521] Misleading compress level header on files created with gzip

2016-07-15 Thread R. David Murray

R. David Murray added the comment:

Thanks for the report and patch.  Now we need a test.

--
nosy: +r.david.murray
stage:  -> test needed
versions:  -Python 3.2, 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



[issue27512] os.fspath is certain to crash when exception raised in __fspath__

2016-07-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bb7686a555cc by Brett Cannon in branch 'default':
Fix a failing test introduced as part of issue #27512
https://hg.python.org/cpython/rev/bb7686a555cc

--

___
Python tracker 

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



[issue27512] os.fspath is certain to crash when exception raised in __fspath__

2016-07-15 Thread Brett Cannon

Brett Cannon added the comment:

Thanks for catching that, David.

--
status: open -> closed

___
Python tracker 

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



[issue27083] PYTHONCASEOK is ignored on Windows

2016-07-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bedcb9ec3f26 by Brett Cannon in branch '3.5':
Issue #27083: Respect the PYTHONCASEOK environment variable under
https://hg.python.org/cpython/rev/bedcb9ec3f26

New changeset 777da58794ca by Brett Cannon in branch 'default':
Merge for #27083
https://hg.python.org/cpython/rev/777da58794ca

--
nosy: +python-dev

___
Python tracker 

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



[issue27083] PYTHONCASEOK is ignored on Windows

2016-07-15 Thread Brett Cannon

Brett Cannon added the comment:

I fixed this by simply checking for both b'PYTHONCASEOK' and 'PYTHONCASEOK'. 
Thanks for the bug report, Eryk!

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue26696] Document collections.abc.ByteString

2016-07-15 Thread Brett Cannon

Brett Cannon added the comment:

Thanks for the patch, Xiang!

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



[issue26696] Document collections.abc.ByteString

2016-07-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8be87fde577f by Brett Cannon in branch '3.5':
Issue #26696: Document collections.abc.ByteString.
https://hg.python.org/cpython/rev/8be87fde577f

New changeset 6ba86ca875a8 by Brett Cannon in branch 'default':
Merge for #26696
https://hg.python.org/cpython/rev/6ba86ca875a8

--
nosy: +python-dev

___
Python tracker 

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



[issue27522] Reference cycle in email.feedparser

2016-07-15 Thread Costas

New submission from Costas:

Background: We have two (clusters of) servers running a high-throughput 
websocket application. One runs under Python 2.7, the other has been migrated 
to 3.4. Very similar code runs on both servers, and both manually call the gc 
periodically to reduce latency. 

Problem: We noticed that under load the 3.4 server seems to slowly "leak" 
memory between gc collections, while the 2.7 server doesn't have this issue.

Investigation: I tracked down the source of all the garbage to 
email.feedparser, which is used by http.server to parse the headers of incoming 
requests. The initialiser of the FeedParser class creates a reference cycle by 
putting a lambda function into a member variable. The lambda contains a closure 
with its surrounding scope that points to the object, and the object points 
back to the lambda. 

Proposed fix: The lambda can be harmlessly replaced by a boolean value, which 
doesn't cause the problem, and it's much more readable too. I'm attaching a 
little patch.

--
components: email
files: emailfeedparsergc.patch
keywords: patch
messages: 270503
nosy: Costas, barry, r.david.murray
priority: normal
severity: normal
status: open
title: Reference cycle in email.feedparser
type: resource usage
versions: Python 3.5
Added file: http://bugs.python.org/file43733/emailfeedparsergc.patch

___
Python tracker 

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



[issue27521] Misleading compress level header on files created with gzip

2016-07-15 Thread Dor Dankner

Dor Dankner added the comment:

Thank you for the fast reponse!
tests patch for the proposal fix is attached :)

--
Added file: http://bugs.python.org/file43734/compress_level_tests.patch

___
Python tracker 

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



[issue27078] Make f'' strings faster than .format: BUILD_STRING opcode?

2016-07-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Nice idea, Antti. But I tried to implement it, and surprisingly found that this 
approach is slower than FORMAT_VALUE + BUILD_STRING. At least for this 
particular example. Perhaps because we can't use a stack and need to allocate a 
new tuple containing literal strings and formatted values for PyUnicode_Join(). 
Not mentioning that the code is much more complex.

Here is updated previous patch with fixed leak.

--
Added file: http://bugs.python.org/file43735/fstring_build_string_2.patch

___
Python tracker 

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



[issue27083] PYTHONCASEOK is ignored on Windows

2016-07-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Comparing bytes with str can emit a warning or raise an exception. Checking for 
b'PYTHONCASEOK' in os.environ looks as a bug to me.

--
status: closed -> open

___
Python tracker 

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



[issue27083] PYTHONCASEOK is ignored on Windows

2016-07-15 Thread Brett Cannon

Brett Cannon added the comment:

There's no direct comparison to trigger a warning; it's just seeing if a key in 
a dict exists.

And b'PYTHONCASEOK' is not a bug as that's required for OS X (remember this is 
technically posix.environ, not os.environ).

--
status: open -> closed

___
Python tracker 

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



[issue27083] PYTHONCASEOK is ignored on Windows

2016-07-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Seeing if a key in a dict exists involves the key comparison if there is a key 
on the same position in the hash table.

--
nosy: +rhettinger

___
Python tracker 

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



[issue27083] PYTHONCASEOK is ignored on Windows

2016-07-15 Thread Brett Cannon

Brett Cannon added the comment:

I think the best we can do is be platform-specific in what is checked for in 
the environ dict (e.g. b'PYTHONCASEOK' on darwin, 'PYTHONCASEOK' on win, and I 
don't know about cygwin), but otherwise one would have to iterate through the 
keys of the dict and do a type check before doing the comparison to fully avoid 
any potential warning being triggered.

Does the platform-specific decision of what to look for work for you, Serhiy?

--

___
Python tracker 

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



[issue27515] Dotted name re-import does not rebind after deletion

2016-07-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Nick, do I understand correctly that if the reimport executes and I can access 
the module, everything should be okay?

--

___
Python tracker 

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



[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-07-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

In #27515, Nick Coughlin said that 'del a.b', would work if sys.modules('a.b') 
is also deleted -- unless a.b objects to being reloaded.  This seems not a 
problem for the current 8 tkinter submodules.  The attached tkimports.py runs 
without error.

I am not going to patch 2.7, which does not have the bug, just for the import 
reduction.  The last patch could be applied to 3.5 since it does not remove 
anything from PyShell.  Putting the three warning functions in a class and 
making the warning global a class attribute (a future issue) would be a 
different matter.

--
versions:  -Python 2.7
Added file: http://bugs.python.org/file43736/tkimports.py

___
Python tracker 

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



[issue27523] Silence Socket Depreciation Warnings.

2016-07-15 Thread Decorater

New submission from Decorater:

I have made a patch to some of the warnings to silence them hopefully this will 
help a lot.

--
files: socketmodule.c.patch
keywords: patch
messages: 270512
nosy: Decorater
priority: normal
severity: normal
status: open
title: Silence Socket Depreciation Warnings.
versions: Python 3.6
Added file: http://bugs.python.org/file43737/socketmodule.c.patch

___
Python tracker 

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



[issue27524] Update os.path for PEP 519/__fspath__()

2016-07-15 Thread Brett Cannon

New submission from Brett Cannon:

As per PEP 519, os.path needs to be updated to support __fspath__().

--
assignee: brett.cannon
components: Library (Lib)
messages: 270513
nosy: brett.cannon
priority: release blocker
severity: normal
stage: test needed
status: open
title: Update os.path for PEP 519/__fspath__()
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



[issue27523] Silence Socket Depreciation Warnings.

2016-07-15 Thread Decorater

Decorater added the comment:

Oh and ignore the exe on the patch if you see that 1 has changed.

--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
type:  -> enhancement

___
Python tracker 

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



[issue27524] Update os.path for PEP 519/__fspath__()

2016-07-15 Thread Brett Cannon

Changes by Brett Cannon :


--
dependencies: +Support Path objects in the posix module, Support path objects 
in the ntpath module

___
Python tracker 

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



[issue27525] Wrong OS header on file created by gzip module

2016-07-15 Thread Dor Dankner

New submission from Dor Dankner:

The gzip module generates files with wrong OS header, by putting "Unknown" OS, 
instead of checking and filling the user's OS.
>From the gzip RFC (rfc1952): "This identifies the type of file system on which 
>compression took place. This may be useful in determining end-of-line 
>convention for text files."

The following patch contains a fix that fills the current OS flag (and testcase 
;) )

* The bug is relevant to python 2.x too, but I did not test the patch on it.
** also, I did not run the testcase on Win/Mac, however it should work.

--
components: Extension Modules
files: gzip_os_header_fix_and_tests.patch
keywords: patch
messages: 270515
nosy: ddorda
priority: normal
severity: normal
status: open
title: Wrong OS header on file created by gzip module
type: behavior
versions: Python 2.7, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file43738/gzip_os_header_fix_and_tests.patch

___
Python tracker 

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



[issue26800] Don't accept bytearray as filenames part 2

2016-07-15 Thread Brett Cannon

Brett Cannon added the comment:

Serhiy's patch LGTM.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue24254] Make class definition namespace ordered by default

2016-07-15 Thread Eric Snow

Eric Snow added the comment:

post-review updates

--
Added file: http://bugs.python.org/file43739/deforder-with-tp-slot.diff

___
Python tracker 

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



[issue27524] Update os.path for PEP 519/__fspath__()

2016-07-15 Thread Ethan Furman

Changes by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue27523] Silence Socket Depreciation Warnings.

2016-07-15 Thread Decorater

Decorater added the comment:

I just noticed it does not work the way I had hoped. Ignore this.

--
status: open -> closed

___
Python tracker 

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



[issue27524] Update os.path for PEP 519/__fspath__()

2016-07-15 Thread Brett Cannon

Brett Cannon added the comment:

Here are tests for genericpath, posixpath, and ntpath (which should in the end 
cover all of os.path).

--
keywords: +patch
stage: test needed -> needs patch
Added file: http://bugs.python.org/file43740/fspath_tests.diff

___
Python tracker 

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



[issue27525] Wrong OS header on file created by gzip module

2016-07-15 Thread Ned Deily

Ned Deily added the comment:

It appears that not including the OS value in the header is probably more of a 
feature rather than a bug considering how long the gzip module has been around 
with this behavior.  Have you found any real-life cases where it makes a 
difference?

In any case, the os.platform value 'mac' referred to ancient Mac OS Classic 
(Mac OS 9 and earlier), platforms current Pythons do not support.  Current Mac 
OS X systems are platform 'darwin' and would use the same gzip value as 
platform 'posix'.

--
nosy: +ned.deily

___
Python tracker 

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



[issue27213] Rework CALL_FUNCTION* opcodes

2016-07-15 Thread Demur Rumed

Demur Rumed added the comment:

Since the most common use of CALL_FUNCTION_EX is..

def f(*x,*kw):
other_func(*x, **kw)

I've added some code to BUILD_MAP_UNPACK_WITH_CALL & BUILD_TUPLE_UNPACK to not 
allocate a new object if called with oparg of 1 & TOP() is correct type

--
Added file: http://bugs.python.org/file43741/callfunc5.patch

___
Python tracker 

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



[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-07-15 Thread Terry J. Reedy

Terry J. Reedy added the comment:

run_autocomplete.diff is a preliminary patch for moving the completion list 
function into run.py and reversing the imports.  However, the assert in 
test_autocomplete, line 103 newly fails because the call to open_completions in 
autocomplete_event (line 85) returns None.  The None comes from l. 155.
comp_lists = self.fetch_completions(comp_what, mode)
if not comp_lists[0]:
return None
I do not yet know why moving the one function causes the completion lists for 
re to be blank. I am going to shelve this approach and return to deletion.

--
keywords: +patch
Added file: http://bugs.python.org/file43742/run_autocomplete.diff

___
Python tracker 

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



[issue26988] Add AutoNumberedEnum to stdlib

2016-07-15 Thread Ethan Furman

Ethan Furman added the comment:

Okay, here's an updated patch with the doc changes.

Once the main patch is committed I'm going to reorganize the docs a bit, but 
that's later.

--
assignee:  -> ethan.furman
Added file: http://bugs.python.org/file43743/issue26988.stoneleaf.02.patch

___
Python tracker 

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



[issue26988] Add AutoNumberedEnum to stdlib

2016-07-15 Thread Ethan Furman

Ethan Furman added the comment:

Oh, and yes, I'll fix the whole 80-column thing.  ;)

--

___
Python tracker 

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



[issue25729] update pure python datetime.timedelta creation

2016-07-15 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Brian, we had a similar discussion in issue 20858, but I am still unsure about 
the relationship between our datetime.py and that in PyPy.  Do you use CPython 
version in PyPy?  If not, have you applied this patch and if so, can you link 
to a PyPy issue or a commit?

--

___
Python tracker 

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



[issue25729] update pure python datetime.timedelta creation

2016-07-15 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

For future reference, here is a link to PyPy history of datetime.py:

https://bitbucket.org/pypy/pypy/history-node/919e00b3e558/lib_pypy/datetime.py?at=default

--

___
Python tracker 

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



[issue10225] Fix doctest runable examples in python manual

2016-07-15 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
assignee: belopolsky -> 

___
Python tracker 

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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-07-15 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
nosy:  -Alexander.Belopolsky

___
Python tracker 

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



[issue27522] Reference cycle in email.feedparser

2016-07-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6c7fd035bce3 by R David Murray in branch '3.5':
#27522: break unintended cycle in feedparser.
https://hg.python.org/cpython/rev/6c7fd035bce3

New changeset e1278508f3cb by R David Murray in branch 'default':
Merge: #27522: break unintended cycle in feedparser.
https://hg.python.org/cpython/rev/e1278508f3cb

--
nosy: +python-dev

___
Python tracker 

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



[issue27522] Reference cycle in email.feedparser

2016-07-15 Thread R. David Murray

R. David Murray added the comment:

Thanks, Costas.

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



[issue27522] Reference cycle in email.feedparser

2016-07-15 Thread R. David Murray

Changes by R. David Murray :


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



[issue15873] datetime: add ability to parse RFC 3339 dates and times

2016-07-15 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

I would very much like to see this ready before the feature cut-off for Python 
3.6.  Could someone post a summary on python-ideas to get a show of hands on 
some of the remaining wrinkles?

I would not worry about a C implementation at this point.  We can put python 
implementation in _strptime.py and call it from C as we do for the strptime 
method.

--

___
Python tracker 

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



[issue24954] No way to generate or parse timezone as produced by datetime.isoformat()

2016-07-15 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Since this is closely related to issue 15873, I am merging the nosy lists.

As far as I can tell, the patch just needs tests and a final decision on issue 
5288. I don't think it is at all controversial, but we need to relax the offset 
restrictions before ::z code can go in.

shanmbic, you can use my PEP 495 branch to test.  See 
.

--
nosy: +Anders.Hovmöller, Arfrever, Eric.Hanchrow, Roman.Evstifeev, SilentGhost, 
aymeric.augustin, barry, berker.peksag, cvrebert, davydov, deronnax, 
eric.araujo, flying sheep, haypo, jcea, jstasiak, jwilk, karlcow, kirpit, 
mcepl, mihaic, nagle, pbryan, perey, piotr.dobrogost, r.david.murray, roysmith
stage: patch review -> commit review

___
Python tracker 

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



[issue24954] No way to generate or parse timezone as produced by datetime.isoformat()

2016-07-15 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Sorry, the tracker messed up the URL: go to

https://github.com/abalkin/cpython.git

and select branch:issue24773-s3

--

___
Python tracker 

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



[issue12750] datetime.strftime('%s') should respect tzinfo

2016-07-15 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
nosy: +shanmbic

___
Python tracker 

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



[issue12750] datetime.strftime('%s') should respect tzinfo

2016-07-15 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



[issue27526] test_venv.TestEnsurePip fails mysteriously when /tmp is too small

2016-07-15 Thread R. David Murray

New submission from R. David Murray:

I've been having a failure in test_venv when running the tests suite for some 
months now.  Since the buildbots aren't, I was guessing it was a local problem. 
 I finally got around to looking at it today, and I had no clue what was wrong 
here, after setting maxDiff to None:

==
FAIL: test_with_pip (test.test_venv.EnsurePipTest)
--
Traceback (most recent call last):
  File "/home/rdmurray/python/p35/Lib/test/test_venv.py", line 381, in 
test_with_pip
self.assertEqual(err, "")
AssertionError: 'Traceback (most recent call last):\n  Fil[741 chars]\'\n' != ''
- Traceback (most recent call last):
-   File "/home/rdmurray/python/p35/Lib/runpy.py", line 174, in 
_run_module_as_main
- mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
-   File "/home/rdmurray/python/p35/Lib/runpy.py", line 133, in 
_get_module_details
- return _get_module_details(pkg_main_name, error)
-   File "/home/rdmurray/python/p35/Lib/runpy.py", line 109, in 
_get_module_details
- __import__(pkg_name)
-   File "/tmp/tmpcpx0dj2o/lib/python3.5/site-packages/pip/__init__.py", line 
14, in 
- from pip.utils import get_installed_distributions, get_prog
-   File "/tmp/tmpcpx0dj2o/lib/python3.5/site-packages/pip/utils/__init__.py", 
line 27, in 
- from pip._vendor import pkg_resources
- ImportError: cannot import name 'pkg_resources'


It turns out that the problem was that the virtual machine I was running this 
in had a /tmp that was too small for pip to operate.  I've had this problem 
often with pip on my VMs.

I'm reporting this because it seems to me reasonably likely that ensurepip will 
fail mysteriously if /tmp is too small.  I'm OK with this issue getting closed 
as won't fix, since my setup is rather odd and it may be that no one else will 
run in to this.  But it may be that someone else will, and at least there will 
be a bug report to find.

--
messages: 270532
nosy: dstufft, r.david.murray
priority: normal
severity: normal
status: open
title: test_venv.TestEnsurePip fails mysteriously when /tmp is too small
type: behavior

___
Python tracker 

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



[issue12750] add cross-platform support for %s strftime-format code

2016-07-15 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Given that we have the .timestamp() method, I am not sure this would be a very 
useful feature, but maybe it is a way to eliminate an attractive nuisance.

If anyone is still interested in getting this in - please check with 
python-ideas.

--
title: datetime.strftime('%s') should respect tzinfo -> add cross-platform 
support for %s strftime-format code

___
Python tracker 

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



[issue22246] add strptime(s, '%s')

2016-07-15 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


--
assignee:  -> belopolsky
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



[issue22246] add strptime(s, '%s')

2016-07-15 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

With PEP 495, conversion from timestamp to naive datetime will no longer loose 
information.  In light of this, I would like to reconsider what strftime('%s') 
should return in the absence of %z.

--

___
Python tracker 

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



[issue15443] datetime module has no support for nanoseconds

2016-07-15 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Note that the patches attached so far to this issue are nowhere close to a 
complete implementation.  I don't think a python-only prototype (a patch to 
datetime.py) would be hard to implement, but implementation would be easier if 
nanoseconds replaced microseconds in datetime and timedelta objects with new 
microsecond(s) becoming a computed property.

--
keywords:  -patch
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



[issue27485] urllib.splitport -- is it official or not?

2016-07-15 Thread Senthil Kumaran

Senthil Kumaran added the comment:

I think that we use encourage everyone to use the higher level functions like 
urlparse() or urlsplit() and then get the .port from the named tuple result.

Two things to do.

1. Update that Note the documentation which states a false statement that those 
helper functions are not exposed in urllib.parse

2. Raise a DeprecationWarning and rename them to _splitport()

--
nosy: +orsenthil
versions:  -Python 3.2, 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



[issue27083] PYTHONCASEOK is ignored on Windows

2016-07-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Yes, I think it will work.

--

___
Python tracker 

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



[issue27527] Make not yielding from or awaiting a coroutine a SyntaxError

2016-07-15 Thread Decorater

New submission from Decorater:

Currently there is a waring printed in python when you try to call a coroutine 
without yieling from or awaiting it but I would like it to be a SyntaxError 
when this happens instead.

--
components: Windows
messages: 270538
nosy: Decorater, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Make not yielding from or awaiting a coroutine a SyntaxError
versions: 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



[issue27527] Make not yielding from or awaiting a coroutine a SyntaxError

2016-07-15 Thread Decorater

Decorater added the comment:

I am thinking like this example:

import asyncio

@asyncio.coroutine
def SomeCoroutine():
print("test...")

@asyncio.coroutine
def SomeNormalFunction():
SomeCoroutine()

Will print a warning instead I would like it to be a SyntaxError when the 
function is called that tries to call a coroutine that has not been 
yielded/awaited at all.

--

___
Python tracker 

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



[issue27527] Make not yielding from or awaiting a coroutine a SyntaxError

2016-07-15 Thread Decorater

Changes by Decorater :


--
type:  -> enhancement

___
Python tracker 

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



[issue27527] Make not yielding from or awaiting a coroutine a SyntaxError

2016-07-15 Thread Decorater

Decorater added the comment:

Oh it does not happen if you use the asyncio.coroutine decorater but it does do 
RuntimeWarning if you use the async def on it.

--
versions:  -Python 3.4

___
Python tracker 

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



[issue27527] Make not yielding from or awaiting a coroutine a SyntaxError

2016-07-15 Thread Decorater

Decorater added the comment:

So to make it Error it must be :

import asyncio

async def SomeCoroutine():
print("test...")

SomeCoroutine()

--

___
Python tracker 

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



[issue27515] Dotted name re-import does not rebind after deletion

2016-07-15 Thread Nick Coghlan

Nick Coghlan added the comment:

Terry: it's not a 100% guarantee, but it should be sufficient for your purposes 
(the more obscure failure modes mostly relate to C level globals, Python level 
module globals, pickling, and module import having side effects on state in 
other modules, and it's unlikely you'll hit any of those here as long as the 
main "tk" module and any modules it implicitly imports stay loaded. If you do 
end up getting bug reports about this, we can treat those as a bug in the 
affected modules)

As far as the module count goes, a plain "import tkinter" gets the imported 
module count up to 63, so that's presumably an absolute lower bound on your 
efforts.

--

___
Python tracker 

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



[issue24954] No way to generate or parse timezone as produced by datetime.isoformat()

2016-07-15 Thread Antti Haapala

Antti Haapala added the comment:

"Be conservative in what you do, be liberal in what you accept from others" 
they say. Also Z as a timezone designator is also widely used in iso 8601 
timestamps. I believe the effort should be made to *parse* *any/all* of the ISO 
8601 supported time-zone codes with one conversion, the list is not that long, 
just 'Z', HH, HH:MM, HHMM, longest match. Literal 'Z' really does not need to 
be supported for *output* at all, but for input, please.

Otherwise this will still go down the road of iso8601 library, which just tries 
to support all the YYmmddTHHMMSS.FF variants. It uses regular 
expressions to parse the dates as it is faster than trying N different formats 
with `strptime`

--
nosy: +ztane

___
Python tracker 

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