[issue25316] distutils: broken error reporting about vcvarsall.bat

2015-10-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a2016b29762c by Steve Dower in branch '3.5':
Issue #25316: distutils raises OSError instead of DistutilsPlatformError when 
MSVC is not installed.
https://hg.python.org/cpython/rev/a2016b29762c

New changeset 07161dd8a078 by Steve Dower in branch 'default':
Issue #25316: distutils raises OSError instead of DistutilsPlatformError when 
MSVC is not installed.
https://hg.python.org/cpython/rev/07161dd8a078

--
nosy: +python-dev

___
Python tracker 

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



[issue25294] Absolute imports fail in some cases where relative imports would work

2015-10-05 Thread Brett Cannon

Brett Cannon added the comment:

You have to realize, Patrick, that the ability for `from ... import ...` to 
work in some situations that `import ...` won't is an age-old problem -- they 
are different at the bytecode level as well as how __import__ handles them -- 
and starting in Python 3.5 it got tweaked to potentially make the differences 
more pronounced by making a certain situation involving circular imports not 
trip users up as much where it was technically feasible to make the change 
without backwards-compatibility issues. It was a "practicality over purity" 
decision.

You also said that "PEP 8 prescribes a way of doing something that often won't 
work" which I disagree with. I think you're reading "absolute import" as 
synonymous with `import ...` which is not what the term means. In actuality, 
absolute imports means no leading dot in the name, e.g. `from .x import y` is a 
relative import while `from z.x import y` is an absolute one (as is `import 
z.x.y`). If you are using the term "absolute import" in the correct way then I 
still don't see how PEP 8 is suggesting any practice "that won't often work".

Circular imports are just plain hard to deal with. Due to the long-standing 
design of import being nothing more than syntactic sugar around exec() we don't 
get to know statically that a circular import is going to happen, so we can't 
error out early to tell the user that they *may* be in trouble. And not 
everyone gets themselves in a position where a circular import dependencies is 
a problem since it only causes issues when module-level code depends on each 
other in a circular way (which does include import statements which is where 
people typically trip themselves up when they get in this situation). I realize 
you're trying to do the right thing here and get the docs clarified to help 
newcomers out, but please realize it's just a difficult subject to explain 
succinctly, especially since a vast majority of people don't get themselves 
into a position where they have to deal with a circular import.

--

___
Python tracker 

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



[issue25316] distutils: broken error reporting about vcvarsall.bat

2015-10-05 Thread Steve Dower

Steve Dower added the comment:

Ah, found it in the linked thread. I'll fix for 3.5.1.

--

___
Python tracker 

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



[issue25316] distutils: broken error reporting about vcvarsall.bat

2015-10-05 Thread Steve Dower

Steve Dower added the comment:

Do you have a full stack trace for that exception? I don't see anywhere that 
should be able to raise WinError in _find_vcvarsall.

--

___
Python tracker 

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



[issue25298] Add lock and rlock weakref tests

2015-10-05 Thread Nir Soffer

Changes by Nir Soffer :


--
nosy: +pitrou

___
Python tracker 

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



[issue25175] Documentation-Tkinter Clarify module spelling change in Python 3 docs

2015-10-05 Thread Terry J. Reedy

Changes by Terry J. Reedy :


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



[issue20981] ssl doesn't build anymore with OpenSSL 0.9.7 or older: X509_check_ca

2015-10-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

For ancient OSes such as RHEL 4, I would suggest people request backports from 
the OS vendor if desired.

--

___
Python tracker 

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



[issue25319] Keep lock type when reseting internal locks

2015-10-05 Thread Nir Soffer

Changes by Nir Soffer :


--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue25316] distutils: broken error reporting about vcvarsall.bat

2015-10-05 Thread Steve Dower

Changes by Steve Dower :


--
assignee:  -> steve.dower
components: +Windows
keywords: +3.5regression
nosy: +eric.araujo, paul.moore, tim.golden, zach.ware

___
Python tracker 

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



[issue25316] distutils: broken error reporting about vcvarsall.bat

2015-10-05 Thread Steve Dower

Changes by Steve Dower :


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



[issue25315] OrderedDict mangled private attribute is inaccessible

2015-10-05 Thread R. David Murray

R. David Murray added the comment:

Yes, that would be correct.  OrderedDict is designed to keep things in 
insertion order, so supporting changing that order is not part of its mission.  
Sorry about that, you'll have to write your own class.

Now, Raymond might find the idea of supporting other orders interesting.  If so 
I'm sure he'll comment on the issue eventually.

--

___
Python tracker 

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



[issue25315] OrderedDict mangled private attribute is inaccessible

2015-10-05 Thread Serge Matveenko

Serge Matveenko added the comment:

Ok, then the OrderedDict is useless for any advanced hacking like altering the 
order in which __setitem__ stores items.

It is just useless Python code and so much appliances missed for this class:(

Thank you all for these completely helpful answers.

--

___
Python tracker 

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



[issue24505] shutil.which wrong result on Windows

2015-10-05 Thread R. David Murray

R. David Murray added the comment:

Well, that's a newish situation for Windows, something I certainly wasn't aware 
of.  Which is trying to find the executable that would be found if typed at the 
prompt.  So, what is the correct algorithm for emulating how Windows does that 
search?  (Or some way to hook directly in to Windows search...)

--

___
Python tracker 

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



[issue25319] Keep lock type when reseting internal locks

2015-10-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 69a26f0800b3 by Benjamin Peterson in branch '2.7':
reinitialize an Event's Condition with a regular lock (closes #25319)
https://hg.python.org/cpython/rev/69a26f0800b3

New changeset 6108d30dde21 by Benjamin Peterson in branch '3.4':
reinitialize an Event's Condition with a regular lock (closes #25319)
https://hg.python.org/cpython/rev/6108d30dde21

New changeset 3719e842a7b1 by Benjamin Peterson in branch '3.5':
merge 3.4 (#25319)
https://hg.python.org/cpython/rev/3719e842a7b1

New changeset 41f29bbf520d by Benjamin Peterson in branch 'default':
merge 3.5 (#25319)
https://hg.python.org/cpython/rev/41f29bbf520d

--
nosy: +python-dev
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



[issue25321] Null Dereference "subname" in zipimport.c

2015-10-05 Thread Benjamin Peterson

Benjamin Peterson added the comment:

I don't think get_subname can return NULL.

--

___
Python tracker 

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



[issue25024] Allow passing "delete=False" to TemporaryDirectory

2015-10-05 Thread Mauro S. M. Rodrigues

Mauro S. M. Rodrigues added the comment:

Hi everybody!
This is my second patch on the community, although the first one is not merged, 
so any feedback is appreciated. 

I've added tests to cover this new situation and docs to let people know about 
the possibility of keeping their temporary directories for debugging purposes. 

Regarding the code itself, I've also made a 'design decision' to remove the 
directory even when created with delete=False if cleanup method is called 
explicitly, so I would like to hear your thoughts on that matter specially if 
you don't agree with it.

--
keywords: +patch
nosy: +maurosr
Added file: 
http://bugs.python.org/file40694/TemporaryDirectory_delete_false.patch

___
Python tracker 

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



[issue25321] Null Dereference "subname" in zipimport.c

2015-10-05 Thread Pankaj Sharma

New submission from Pankaj Sharma:

Hi ,
The issues reported as String NULL dereferecne at line 
Python-2.7.10/Modules/zipimport.c:266 for "subname" which assigned by
get_subname(fullname) at line 264.so there should be check "subname" for NULL 
and return error,if it is NULL.
the respective patch have been attached ,please review it.
Thanks

--
components: Library (Lib)
files: Python-2.7.10-zipimport-01.patch
keywords: patch
messages: 252377
nosy: benjamin.peterson, pankaj.s01, twouters
priority: normal
severity: normal
status: open
title: Null Dereference  "subname" in zipimport.c
type: crash
versions: Python 2.7
Added file: http://bugs.python.org/file40695/Python-2.7.10-zipimport-01.patch

___
Python tracker 

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



[issue23609] Export PyModuleObject in moduleobject.h

2015-10-05 Thread Hristo Venev

Hristo Venev added the comment:

Quote from PEP 489:
The Py_mod_create slot is used to support custom module subclasses.

There is no way to subclass PyModuleObject from C.

--
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue24505] shutil.which wrong result on Windows

2015-10-05 Thread Steve Dower

Steve Dower added the comment:

The Win32 API function linked by eryksun is the correct way to determine 
whether to include the current directory in the search - the doc specifically 
refers to matching cmd.exe's behaviour (searching ".;%PATH%" vs. just "%PATH%").

The PATHEXT behaviour should be to look for the name as provided first, 
followed be appending each extension. So looking for "python" will look for 
["python", *("python" + p for p in getenv('PATHEXT').split(';'))] in that order.

--

___
Python tracker 

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



[issue24505] shutil.which wrong result on Windows

2015-10-05 Thread eryksun

eryksun added the comment:

My suggestion is only for 3.5 / 3.6, because Windows XP is no longer supported. 
Starting with Windows Vista, both cmd.exe and CreateProcess support this 
behavior. I realize that disabling searching the current director by default is 
going beyond what cmd.exe does, which is to require opting in via the 
environment variable. But Python can choose to follow the more-modern behavior 
of PowerShell as a precedent here. 

As Steve mentioned, technically a program isn't supposed to check for the 
environment variable, but instead call NeedCurrentDirectoryForExePath. This 
would require either adding a built-in function, e.g. to the _winapi module, or 
require ctypes:

>>> kernel32.NeedCurrentDirectoryForExePathW('command')
1
>>> os.environ['NoDefaultCurrentDirectoryInExePath'] = '1'
>>> kernel32.NeedCurrentDirectoryForExePathW('command')
0

Note that it requires first normalizing the path to replace slashes with 
backslashes, which is unusual for the Windows API.

>>> kernel32.NeedCurrentDirectoryForExePathW(r'.\command')
1
>>> kernel32.NeedCurrentDirectoryForExePathW('./command')
0

--

___
Python tracker 

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-05 Thread Florin Papa

Florin Papa added the comment:

Hi Stefan,

When activating the "--with-mpx" flag in ./configure, a check is also performed 
to see if the compiler is GCC version 5.1 or higher in order to support MPX 
(and an appropriate error is shown, indicating that the compiler version is 
wrong). Setting the flags manually will only result in a compiler error.

Also, it might not be obvious for the user from the GCC documentation that both 
"-fcheck-pointer-bounds" and "-mmpx" flags are needed to enable MPX 
instrumentation, so adding the "--with-mpx" flag to configure will make it 
easier to use this feature.

--

___
Python tracker 

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



[issue25316] distutils: broken error reporting about vcvarsall.bat

2015-10-05 Thread Marius Gedminas

New submission from Marius Gedminas:

When you try to build a C extension on Windows without having a C compiler, 
distutils tries to raise DistutilsPlatformError("Unable to find 
vcvarsall.bat").  However, on Python 3.5, it doesn't do that -- instead it lets 
a WinError(2 "no such file or directory") from _find_vcvarsall escape.

This breaks packages such as zope.interface that ship optional C modules for 
faster execution, but would like to work on people's computers even when there 
is no C compiler.  See 
https://github.com/zopefoundation/zope.interface/issues/24 for details.

--
components: Distutils
messages: 252308
nosy: dstufft, eric.araujo, mgedmin
priority: normal
severity: normal
status: open
title: distutils: broken error reporting about vcvarsall.bat
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



[issue12486] tokenize module should have a unicode API

2015-10-05 Thread Martin Panter

Martin Panter added the comment:

I didn’t notice that this dual untokenize() behaviour already existed. Taking 
that into account weakens my argument for having separate text and bytes 
tokenize() functions.

--

___
Python tracker 

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



[issue12486] tokenize module should have a unicode API

2015-10-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your review Martin.

Here is rebased patch that addresses Matin's comments.

I agree that having untokenize() changes its output type depending on the 
ENCODING token is bad design and we should change this. But this is perhaps 
other issue.

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



[issue12486] tokenize module should have a unicode API

2015-10-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file40679/tokenize_str_2.diff

___
Python tracker 

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-05 Thread Florin Papa

Florin Papa added the comment:

Hi Antoine,

Third party modules might need patching to work with MPX, as did the math 
module, included in this patch. Everything else worked fine in Python 2.7.10+ 
and 3.6 when running the Grand Unified Python Benchmarks suite and Openstack 
Swift ssbench benchmark (ssbench supports only 2.7.10+).

--

___
Python tracker 

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



[issue25315] OrderedDict mangled private attribute is inaccessible

2015-10-05 Thread Serge Matveenko

Serge Matveenko added the comment:

Zach, ok I got your point. But there is Python implementation in the library 
still which does not conform the one done in C. Such a behavior is tremendously 
confusing.

If there is both Python and C implementation in the library they must conform 
each other. And there is nothing with "you *really* shouldn't use this" when 
you need to especially when it is there. If it is there it must work as it 
written. Otherwise why Python does have this peace of code while it is 
completely useless as reference?

--
resolution: wont fix -> 
status: closed -> open

___
Python tracker 

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



[issue20658] os.environ.clear() fails with empty keys (posix.unsetenv)

2015-10-05 Thread Peter Funk

Changes by Peter Funk :


--
nosy: +pefu

___
Python tracker 

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



[issue4926] putenv() accepts names containing '=', return value of unsetenv() not checked

2015-10-05 Thread Peter Funk

Changes by Peter Funk :


--
nosy: +pefu

___
Python tracker 

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



[issue25315] OrderedDict mangled private attribute is inaccessible

2015-10-05 Thread Serge Matveenko

Serge Matveenko added the comment:

If Python source does conform the one in C, it will be completely fine and 
understandable to have such a change and to rely on it in using version checks 
or whatever.

--

___
Python tracker 

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



[issue25317] Convert test_

2015-10-05 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

A large part of test_tokenize is doctests. Doctests are less powerful than 
unittests, and error reporting in doctests is less informative than in 
unittests. Proposed patch converts doctests to unittests.

--
components: Tests
files: test_tokenize.patch
keywords: patch
messages: 252312
nosy: ezio.melotti, meador.inge, michael.foord, pitrou, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Convert test_
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file40680/test_tokenize.patch

___
Python tracker 

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



[issue25315] OrderedDict mangled private attribute is inaccessible

2015-10-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> rhettinger
nosy: +rhettinger
priority: normal -> low

___
Python tracker 

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



[issue25317] Convert test_tokenize to unittests

2015-10-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
title: Convert test_ -> Convert test_tokenize to unittests

___
Python tracker 

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



[issue25313] IDLE: gracefully handle themes (or keysets, or ...) not present

2015-10-05 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Schedule update: 3.4.4 will be delayed untill after 3.5.1, which will be much 
sooner than the original minimum of 4 months after 3.5.0.  Larry promises at 
least two weeks notice before 3.5.1rc1 but will give no hint of when notice 
might be given.  So we have at least two week to do something correct.

I am against duplicating names because it is wrong in principle.  On the other 
hand, I understand the objection to a popup always and forever.  It is past 
time anyway to enable a working [Help] button, #22726.  The current popup help 
text should go there as tab-specific text.  The only automatic notice on 
selecting a new builtin theme would be 'New theme, see Help', maybe in orange 
(warning color, but not emergency red ;-) added in the empty space below.

I believe one new 'name2 = new_theme' addition to config-main would be enough 
for future additions.  We add to configHandler 'new_themes, a set, currently 
{'IDLE Dark'}.  If a selected builtin is in the set, the message is displayed 
and name2 is written.  On reading, if name2 is present but not recognized, 
revert to IDLE Classic, which is present on all systems now.

Intended result: all IDLEs keep working, new releases get a minimally intrusive 
notice pointing to a full explanation.

--

___
Python tracker 

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



[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-10-05 Thread Vincent Michel

Vincent Michel added the comment:

I attached a patch that should sum up all the points we discussed.

I replaced the `call_soon_threadsafe` example with:
  loop.call_soon_threadsafe(callback, *args)
cause I couldn't find a simple specific usage. Let me know if you think of a 
better example.

--
Added file: http://bugs.python.org/file40691/run_coroutine_threadsafe_2.patch

___
Python tracker 

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



[issue25294] Absolute imports fail in some cases where relative imports would work

2015-10-05 Thread Patrick Maupin

Patrick Maupin added the comment:

You are correct that I have conflated two issues, but they are not orthogonal 
-- if you choose to use relative imports, you will never encounter this issue, 
because your imports will all be of the 'from ... import' form.

(And, as you point out, the fact that you don't have this issue with absolute 
"from ... import" statements is due to some special-casing in the import logic 
that doesn't help the other kind of import statement.)

But PEP 8 denigrates relative imports, and then goes on to describe the use of 
the "import x.y.z; x.y.z.foo" form as a way to avoid name clashes.

So PEP 8 promotes absolute imports, and then it presents using "import" instead 
of "from ... import" as a solution to some problems.  It never mentions that 
the 'as' clause could also solve those problems, and also never mentions that 
"import x.y.z" can actually cause problems in some cases.

And the importlib documentation is also a bit sparse on where things can fail.

We're in agreement that it will be difficult to document properly, and maybe I 
overstated my case, but my opinion remains that the current documentation 
promotes practices that _will_ sometimes get people in trouble.

--

___
Python tracker 

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



[issue25266] mako benchmark not working in Python 3.6

2015-10-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thanks, Brett and Florin!

--

___
Python tracker 

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



[issue1644818] Allow built-in packages and submodules as well as top-level modules

2015-10-05 Thread Nick Coghlan

Nick Coghlan added the comment:

Petr, this could be an interesting issue to take a look at from the point of 
view of the builtin and extension module import changes in Python 3.5.

Given the extent of the import system changes across 3.3/4/5, it's even 
conceivable we may have made this work somewhere along the line. In that case 
we'd still need a new regression test to ensure it keeps working - we didn't 
even have a regression test to ensure extension module imports from inside a 
package worked, so we definitely don't have one for builtin submodules.

--
nosy: +encukou

___
Python tracker 

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



[issue14373] C implementation of functools.lru_cache

2015-10-05 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee:  -> serhiy.storchaka
status: open -> pending

___
Python tracker 

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-05 Thread Florin Papa

Florin Papa added the comment:

Hi all,

Thank you for your feedback on the code I submitted.

I added the MPX flags to CFLAGS, not CFLAGS_NODIST, because they also need to 
be included in LDFLAGS.

Please see the new set of patches.

Thank you,
Florin

--
Added file: http://bugs.python.org/file40681/mpx_enable_3_6_v2.patch

___
Python tracker 

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-05 Thread Florin Papa

Changes by Florin Papa :


Added file: http://bugs.python.org/file40682/mpx_enable_2_7_v2.patch

___
Python tracker 

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



[issue25301] Optimize UTF-8 decoder with error handlers

2015-10-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3152e4038d97 by Victor Stinner in branch 'default':
Issue #25301: The UTF-8 decoder is now up to 15 times as fast for error
https://hg.python.org/cpython/rev/3152e4038d97

--
nosy: +python-dev

___
Python tracker 

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



[issue25301] Optimize UTF-8 decoder with error handlers

2015-10-05 Thread STINNER Victor

STINNER Victor added the comment:

I pushed my optimization. I close the issue.

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-05 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This looks ok to me as long as it's disabled by default.

--
type: security -> enhancement

___
Python tracker 

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



[issue25175] Documentation-Tkinter Clarify module spelling change in Python 3 docs

2015-10-05 Thread Bar Harel

Bar Harel added the comment:

I guess you're correct, a simple mistake one time mistake shouldn't require the 
changing of the docs.

--

___
Python tracker 

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



[issue20981] ssl doesn't build anymore with OpenSSL 0.9.7 or older: X509_check_ca

2015-10-05 Thread Mișu Moldovan

Mișu Moldovan added the comment:

For the record, this is an issue in Red Hat Enterprise Linux 4 too. For RHEL 4, 
"Extended" support ends on March 31, 2017, according to 
https://access.redhat.com/support/policy/updates/errata

--

___
Python tracker 

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



[issue25317] Convert test_tokenize to unittests

2015-10-05 Thread Eric V. Smith

Eric V. Smith added the comment:

+1

--
nosy: +eric.smith

___
Python tracker 

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



[issue25318] Add _PyBytesWriter API to optimize Unicode encoders

2015-10-05 Thread STINNER Victor

STINNER Victor added the comment:

Results of bench.py attached to issue #25227 (ASCII and Latin1 encoders): 
attached bench_ucs1_result.txt file.

+-+---
Summary | ucs1_before | ucs1_after
+-+---
ascii   | 1.69 ms (*) |1.69 ms
latin1  |  1.7 ms (*) |1.69 ms
+-+---
Total   | 3.39 ms (*) |3.39 ms
+-+---

--

___
Python tracker 

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



[issue25318] Add _PyBytesWriter API to optimize Unicode encoders

2015-10-05 Thread STINNER Victor

STINNER Victor added the comment:

Result of  bench.py attached to issue #25267: attached bench_utf8_result.txt.

--+-+---
Summary   | utf8_before | 
utf8_after
--+-+---
ignore: "\udcff" * length | 7.63 us (*) |    
7.91 us
ignore: "a" * length + "\udcff"   | 10.7 us (*) |    
10.8 us
ignore: ("a" * 99 + "\udcff" * 99) * length   | 2.17 ms (*) |    
2.16 ms
ignore: ("\udcff" * 99 + "a") * length    |  843 us (*) | 
866 us
ignore: "\udcff" + "a" * length   | 10.7 us (*) |  
11 us
replace: "\udcff" * length    | 7.87 us (*) |  8.43 us 
(+7%)
replace: "a" * length + "\udcff"  | 10.8 us (*) |    
10.9 us
replace: ("a" * 99 + "\udcff" * 99) * length  | 2.46 ms (*) |    
2.46 ms
replace: ("\udcff" * 99 + "a") * length   |  907 us (*) | 
939 us
replace: "\udcff" + "a" * length  | 10.9 us (*) |  
11 us
surrogateescape: "\udcff" * length    | 14.2 us (*) | 17.2 us 
(+21%)
surrogateescape: "a" * length + "\udcff"  | 10.6 us (*) |    
10.7 us
surrogateescape: ("a" * 99 + "\udcff" * 99) * length  | 3.19 ms (*) |   3.4 ms 
(+7%)
surrogateescape: ("\udcff" * 99 + "a") * length   | 1.64 ms (*) | 1.87 ms 
(+13%)
surrogateescape: "\udcff" + "a" * length  | 10.6 us (*) |    
10.7 us
surrogatepass: "\udcff" * length  | 23.1 us (*) |    
23.5 us
surrogatepass: "a" * length + "\udcff"    | 10.7 us (*) |    
10.8 us
surrogatepass: ("a" * 99 + "\udcff" * 99) * length    | 4.39 ms (*) |    
4.44 ms
surrogatepass: ("\udcff" * 99 + "a") * length | 2.43 ms (*) |    
2.47 ms
surrogatepass: "\udcff" + "a" * length    | 10.6 us (*) |    
10.8 us
backslashreplace: "\udcff" * length   | 65.7 us (*) |    
64.3 us
backslashreplace: "a" * length + "\udcff" | 15.7 us (*) |  
15 us
backslashreplace: ("a" * 99 + "\udcff" * 99) * length |   12 ms (*) | 15.9 ms 
(+32%)
backslashreplace: ("\udcff" * 99 + "a") * length  | 11.1 ms (*) | 13.5 ms 
(+22%)
backslashreplace: "\udcff" + "a" * length | 16.4 us (*) |  15.1 us 
(-8%)
--+-+---
Total | 41.4 ms (*) | 48.3 ms 
(+17%)
--+-+---

--
Added file: http://bugs.python.org/file40683/bench_utf8_result.txt

___
Python tracker 

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



[issue25318] Add _PyBytesWriter API to optimize Unicode encoders

2015-10-05 Thread STINNER Victor

New submission from STINNER Victor:

Attached patch is the first step to optimize Unicode encoders: it adds a 
_PyBytesWriter API. This API is responsible to use the most efficient buffer 
depending on the need:

* it's possible to use a small buffer directly allocated on the C stack
* otherwise a Python bytes object is allocated
* it's possible to overallocate the bytes objcet to reduce the number of calls 
to _PyBytes_Resize()

The patch only adds the new API, don't expect any speed up. I just added a 
small optimization: the overallocation is disabled in UCS1 encoder (ASCII and 
Latin1) for the last write.

--
components: Unicode
messages: 252322
nosy: ezio.melotti, haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Add _PyBytesWriter API to optimize Unicode encoders
type: performance
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



[issue25319] Keep lock type when reseting internal locks

2015-10-05 Thread Nir Soffer

New submission from Nir Soffer:

When Event._reset_internal_locks was called after fork, it use to
reinitialize its condition without arguments, using RLock instead of
Lock.

--
components: Library (Lib)
files: 0001-Keep-lock-type-when-reseting-internal-locks.patch
keywords: patch
messages: 252326
nosy: nirs
priority: normal
severity: normal
status: open
title: Keep lock type when reseting internal locks
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: 
http://bugs.python.org/file40686/0001-Keep-lock-type-when-reseting-internal-locks.patch

___
Python tracker 

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



[issue25318] Add _PyBytesWriter API to optimize Unicode encoders

2015-10-05 Thread STINNER Victor

Changes by STINNER Victor :


--
keywords: +patch
Added file: http://bugs.python.org/file40685/bytes_writer.patch

___
Python tracker 

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



[issue25318] Add _PyBytesWriter API to optimize Unicode encoders

2015-10-05 Thread STINNER Victor

Changes by STINNER Victor :


Added file: http://bugs.python.org/file40684/bench_ucs1_result.txt

___
Python tracker 

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



[issue25315] OrderedDict mangled private attribute is inaccessible

2015-10-05 Thread Emanuel Barry

Emanuel Barry added the comment:

The same is true of the decimal and datetime modules. Names starting with an 
underscore are an implementation detail, and you shouldn't rely on these in 
production code.

--
nosy: +ebarry

___
Python tracker 

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



[issue25301] Optimize UTF-8 decoder with error handlers

2015-10-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5b9ffea7e7c3 by Victor Stinner in branch 'default':
Issue #25301: Fix compatibility with ISO C90
https://hg.python.org/cpython/rev/5b9ffea7e7c3

--

___
Python tracker 

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



[issue25318] Add _PyBytesWriter API to optimize Unicode encoders

2015-10-05 Thread STINNER Victor

STINNER Victor added the comment:

A few months ago, I wrote a previous implementation of the _PyBytesWriter API 
which embedded the "current pointer" inside _PyBytesWriter API. The problem was 
that GCC produced less efficient code than expect for the hotspot of the 
encoder.

In the new implementation (attached patch), the "current pointer" is unchanged: 
it's still a variable local to the encoder function. Instead, the current 
pointer became a *parameter* to all _PyBytesWriter *functions*.

I expect to not touch performances of encoders for valid encoded strings (when 
the code calling error handlers is not used), which is important since we have 
very good performance here.

_PyBytesWriter is not restricted to the code to allocate the buffer.

--

bytes_writer.patch:

+char stackbuf[256];

Oh, I forgot to mention this other small optimization. I also added a small 
buffer allocated on the C stack for the UCS1 encoder (ASCII, Latin1). It may 
optimize a little bit encoding when the output string is smaller than 256 bytes 
when the error handler is used.

The optimization comes from the very efficient UTF-8 encoder.

--

___
Python tracker 

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



[issue25319] Keep lock type when reseting internal locks

2015-10-05 Thread Nir Soffer

Changes by Nir Soffer :


Added file: 
http://bugs.python.org/file40688/0001-Keep-lock-type-when-reseting-internal-locks.patch

___
Python tracker 

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



[issue25315] OrderedDict mangled private attribute is inaccessible

2015-10-05 Thread R. David Murray

R. David Murray added the comment:

A method that starts with an '_' is not part of the API unless documented to be 
so (as with namedtuple), and a non-special method that starts with two is 
purposefully mangled so that you cannot accidentally rely on it.  The C 
implementation is an implementation of the API and the behavior when that API 
is used (as vetted by the tests that are run against both implementations); it 
is not otherwise required to "conform" to the python implementation or vice 
versa.

--
nosy: +r.david.murray
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue25294] Absolute imports fail in some cases where relative imports would work

2015-10-05 Thread Patrick Maupin

Patrick Maupin added the comment:

concurrent/futures/__init__.py may be a better example than 2to3 for this 
issue.  It's relatively new code, it's part of the standard library, it's 
fairly small and self-contained, and it doesn't follow the promulgated standard.

If it's bad code, it should be modified.  If it's not bad code, then the docs 
shouldn't denigrate the coding style (especially not to the extent of requiring 
absolute imports in standard library code), because a lot of newbies take the 
docs to heart and spend a lot of time and energy beating up themselves and 
others about conformance.

--

___
Python tracker 

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



[issue25319] Keep lock type when reseting internal locks

2015-10-05 Thread Nir Soffer

Changes by Nir Soffer :


Added file: 
http://bugs.python.org/file40687/0001-Keep-lock-type-when-reseting-internal-locks-2.7.patch

___
Python tracker 

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



[issue24505] shutil.which wrong result on Windows

2015-10-05 Thread Bar Harel

Bar Harel added the comment:

Unfortunately that patch will not help for files like "python.exe.exe", and 
double ext which sometimes happens.
I'm on it. Should take me a day or two, more problems might arise along the 
way. Thanks Bob for alerting.

Regarding the uppercase, I believe it is better to leave the casing as it is. 
It should be up to the user to mess with it as converting case is a one way 
ticket. If someone entered an uppercase, perhaps he wants it like that. Also 
it's less prune to errors and behaves the same for Unix and Windows.

--
nosy: +bar.harel

___
Python tracker 

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



[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-10-05 Thread Guido van Rossum

Guido van Rossum added the comment:

loop *is* required for this function. It's just that there's an earlier, 
general comment describing it as optional for all functions in this section.

--

___
Python tracker 

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



[issue23972] Asyncio reuseport

2015-10-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5e7e9b131904 by Guido van Rossum in branch '3.4':
Issue #23972: updates to asyncio datagram API. By Chris Laws.
https://hg.python.org/cpython/rev/5e7e9b131904

New changeset ba956289fe66 by Guido van Rossum in branch '3.5':
Issue #23972: updates to asyncio datagram API. By Chris Laws. (Merge 3.4->3.5.)
https://hg.python.org/cpython/rev/ba956289fe66

New changeset c0f1f882737c by Guido van Rossum in branch 'default':
Issue #23972: updates to asyncio datagram API. By Chris Laws. (Merge 3.5->3.6.)
https://hg.python.org/cpython/rev/c0f1f882737c

--
nosy: +python-dev

___
Python tracker 

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



[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-10-05 Thread Vincent Michel

Vincent Michel added the comment:

> The docs look good.

Should I add a note to explain why the loop argument has to be explicitly 
passed? (there is a note at the beginning of the `task functions` section 
stating "In the functions below, the optional loop argument ...")

> What do you need to add to the concurrency and multithreading section?

This section provides an example to schedule a coroutine from a different 
thread using `ensure_future` and `call_soon_threadsafe`. This example should be 
replaced with another usage of `call_soon_threadsafe` and another paragraph 
about `run_coroutine_threadsafe` should be added.

> I agree on the try/except

Do you think the exception should be re-raised for the logger?

> can you add that to the same diff? 

All right, should I make another PR on the asyncio github repo as well?

--

___
Python tracker 

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



[issue25316] distutils: broken error reporting about vcvarsall.bat

2015-10-05 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +steve.dower -eric.araujo

___
Python tracker 

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



[issue25320] unittest loader.py TypeError when code directory contains a socket

2015-10-05 Thread Victor van den Elzen

New submission from Victor van den Elzen:

Hi, when trying to run tests after upgrading from Python 3.4 to Python 3.5 I 
encountered the following exception:

Traceback (most recent call last):
  ...
  File "/usr/lib/python3.5/unittest/loader.py", line 341, in discover
tests = list(self._find_tests(start_dir, pattern))
  File "/usr/lib/python3.5/unittest/loader.py", line 398, in _find_tests
full_path, pattern, namespace)
TypeError: 'NoneType' object is not iterable

This was caused by a stray socket in my code directory, and the fact that 
_find_test_path only considers directories and regular files.

I attached a suggested fix that just skips all special files. No tests other 
than "it works on my machine".

--
components: Library (Lib)
files: unittest_socket.diff
keywords: patch
messages: 252342
nosy: Victor van den Elzen
priority: normal
severity: normal
status: open
title: unittest loader.py TypeError when code directory contains a socket
versions: Python 3.5
Added file: http://bugs.python.org/file40690/unittest_socket.diff

___
Python tracker 

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



[issue22413] Bizarre StringIO(newline="\r\n") translation

2015-10-05 Thread Guido van Rossum

Guido van Rossum added the comment:

The patch fails to apply in the 2.7 branch. It works in 3.4. Could you look 
into the 2.7 issue?

--

___
Python tracker 

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



[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-10-05 Thread Yury Selivanov

Yury Selivanov added the comment:

>> Should I add a note to explain why the loop argument has to be explicitly
passed? (there is a note at the beginning of the `task functions` section
stating "In the functions below, the optional loop argument ...")

> Oh, that's a good idea. It's sort of clear because it starts with "from a
different thread" but it doesn't hurt to say the same thing in different
ways, because it's an easy mistake to make.

Can we make 'loop' a required argument (no default None value)?

--

___
Python tracker 

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



[issue25300] Enable Intel MPX (Memory protection Extensions) feature

2015-10-05 Thread Stefan Krah

Stefan Krah added the comment:

> Third party modules might need patching to work with MPX...

If the flags go into CFLAGS, these modules won't compile with
distutils.  Perhaps we should also add LDFLAGS_NODIST, if that
would solve your problem.

--

___
Python tracker 

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



[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-10-05 Thread Vincent Michel

Vincent Michel added the comment:

I attached the first version of the documentation for 
`run_coroutine_threadsafe`. The `Concurrency and multithreading` section also 
needs to be updated but I could already use some feedback.

Also, I think we should add a `try-except` in the callback function, especially 
since users can set their own task factory. For instance:
  
loop.set_task_factory(lambda loop, coro: i_raise_an_exception)

will cause the future returned by `run_coroutine_threadsafe` to wait forever. 
Instead, we could have:

except Exception as exc:
if future.set_running_or_notify_cancel():
future.set_exception(exc)

inside the callback to notify the future.

--
keywords: +patch
Added file: http://bugs.python.org/file40689/run_coroutine_threadsafe_doc.patch

___
Python tracker 

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



[issue23972] Asyncio reuseport

2015-10-05 Thread Guido van Rossum

Guido van Rossum added the comment:

Thanks for the patch! It's live now. Closing. Watch the buildbots for me please!

--
assignee:  -> gvanrossum
resolution:  -> fixed
status: open -> closed
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



[issue24505] shutil.which wrong result on Windows

2015-10-05 Thread eryksun

eryksun added the comment:

Please don't default to searching the current directory:

if is_windows:
# The current directory takes precedence on Windows.
if not os.curdir in path:
path.insert(0, os.curdir)

Add a keyword option to enable this, with a warning that including the current 
directory isn't secure. This option should not be able to override the 
environment variable [NoDefaultCurrentDirectoryInExePath][1].

[1]: https://msdn.microsoft.com/en-us/library/ms684269

--
components: +Windows
nosy: +eryksun, paul.moore, steve.dower, tim.golden, zach.ware
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



[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-10-05 Thread Guido van Rossum

Guido van Rossum added the comment:

> Should I add a note to explain why the loop argument has to be explicitly
passed? (there is a note at the beginning of the `task functions` section
stating "In the functions below, the optional loop argument ...")

Oh, that's a good idea. It's sort of clear because it starts with "from a
different thread" but it doesn't hurt to say the same thing in different
ways, because it's an easy mistake to make.

>> What do you need to add to the concurrency and multithreading section?

> This section provides an example to schedule a coroutine from a different
thread using `ensure_future` and `call_soon_threadsafe`. This example
should be replaced with another usage of `call_soon_threadsafe` and another
paragraph about `run_coroutine_threadsafe` should be added.

Oh, yes, definitely update that!

> > I agree on the try/except
>
> Do you think the exception should be re-raised for the logger?
>

Yes.

> > can you add that to the same diff?
>
> All right, should I make another PR on the asyncio github repo as well?
>

No, it's easier for me to copy the changes from CPython into the asyncio
repo.

--

___
Python tracker 

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



[issue22413] Bizarre StringIO(newline="\r\n") translation

2015-10-05 Thread Guido van Rossum

Guido van Rossum added the comment:

It looks like we don't merge 2.7 into 3.4 any more, so that will have to be a 
separate patch anyway.

So you can commit the patch to 3.4, merge into 3.5 and 3.6. Good luck! And 
thanks for your perseverance.

--

___
Python tracker 

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



[issue25228] Regression in cookie parsing with brackets and quotes

2015-10-05 Thread Pathangi Jatinshravan

Pathangi Jatinshravan added the comment:

This is the first ever bug I will be working on so there might be a bit of a 
learning curve, but I'll do my best to come out with something by this week.

--

___
Python tracker 

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



[issue25228] Regression in cookie parsing with brackets and quotes

2015-10-05 Thread Tim Graham

Tim Graham added the comment:

Sure, feel free to propose a patch.

--

___
Python tracker 

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



[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-10-05 Thread Guido van Rossum

Guido van Rossum added the comment:

The docs look good. (I assume you've generated the HTML and checked that the 
output looks good, links are clickable etc.) What do you need to add to the 
concurrency and multithreading section?

I agree on the try/except; can you add that to the same diff? (Merging diffs 
into three different branches is a pain so I want to have to do as little as 
possible of it.)

--

___
Python tracker 

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



[issue25294] Absolute imports fail in some cases where relative imports would work

2015-10-05 Thread Patrick Maupin

Patrick Maupin added the comment:

I don't think anything is wrong with that code.  But PEP 8 prescribes a way of 
doing something that often won't work (which is unusual for PEP 8), with no 
discussion of this fact.

> I think the key thing to take away from this whole discussion is "don't have 
> circular imports" is the key practice to follow.

If this is a "key practice" then why the heck is the recommended way to do 
things the one that is guaranteed to break it?

I have empirical evidence that it is surprising to some users that the 
semantics of "from .z import foo" and "from x.y.z import foo" are not identical 
-- in other words, some of them have a hard time classifying the second as a 
circular import but not the first.  And the documentation is silent on this.

> And if someone wants to propose a patch to update some documentation

I'll try to get to this in the next couple of weeks.

Thanks,
Pat

--

___
Python tracker 

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



[issue25228] Regression in cookie parsing with brackets and quotes

2015-10-05 Thread Pathangi Jatinshravan

Pathangi Jatinshravan added the comment:

Hi, can I be assigned to this behaviour issue?

--
nosy: +Pathangi Jatinshravan

___
Python tracker 

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



[issue25318] Add _PyBytesWriter API to optimize Unicode encoders

2015-10-05 Thread STINNER Victor

STINNER Victor added the comment:

My previous abandonned attempt was the issue #17742.

"Add _PyBytesWriter API to optimize Unicode encoders"

Oh, I forgot to mention and it may also be used to optimize bytes % args. More 
generally, any code generating a bytes object with an unknown length is 
advance. Said differently: _PyBytesWriter can be used when precomputing the 
output length is more expensive.

str % args now uses _PyUnicodeWriter but building an Unicode string is even 
more complex because of the different Unicode "kinds": 1, 2 or 4 bytes per 
character.

--

___
Python tracker 

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



[issue25294] Absolute imports fail in some cases where relative imports would work

2015-10-05 Thread Brett Cannon

Brett Cannon added the comment:

I don't quite follow what you think is wrong with 
https://hg.python.org/cpython/file/tip/Lib/concurrent/futures/__init__.py . It 
looks totally fine to me.

And I should mention that you shouldn't follow PEP 8 like it's in stone and the 
only way to format code. The PEP is a set of guidelines only and not rules 
(this is a long-standing position of python-dev on PEP 8). For instance, I 
don't agree with the absolute import recommendation and do not follow it in my 
own code nor in importlib (it makes vendoring impossible without modifying the 
import statements).

I think the key thing to take away from this whole discussion is "don't have 
circular imports" is the key practice to follow. And if someone wants to 
propose a patch to update some documentation to point out that `from ... import 
...` may work in some situations where `import ...; ... = ...` doesn't then I 
will personally review such a patch.

--

___
Python tracker 

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