[issue13821] misleading return from isidentifier

2017-06-23 Thread Matthias Bussonnier

Matthias Bussonnier added the comment:

I have been bitten by that as well. I think the doc should mention to verify 
that the given string is normalized, not that it **should** be normalized.

Agreed that If isidentifier could also possibly grow a `allow_non_nfkc=True` 
default parameter that would allow to deactivate internal normalisation and 
return False/Raise on Non NKFC that would be great. 

I'm also interested on having an option on ast.parse or compile to not 
normalize to at least be able to lint wether users are using non NFKC form, but 
that's another issue.

I'll see if I can come up with – at least – a documentation patch.

--
nosy: +mbussonn

___
Python tracker 

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



[issue30730] Injecting environment variable in subprocess on Windows

2017-06-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

3.3 and 3.4 starves from this issue

--
versions: +Python 2.7

___
Python tracker 

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



[issue30606] The reply's additional 'Re' is ok

2017-06-23 Thread Lovelyn

New submission from Lovelyn:

love
On Jun 9, 2017 11:39 AM, "Lovelyn"  wrote:

>
> New submission from Lovelyn:
>
> lovecoli...@gmail.com
>
> --
> messages: 295479
> nosy: Love
> priority: normal
> severity: normal
> status: open
> title: The reply's additional 'Re' is ok
>
> ___
> Python tracker 
> 
> ___
>

--
nosy: +Love
title: Spam -> The reply's additional 'Re' is ok

___
Python tracker 

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



[issue30744] Local variable assignment is broken when combined with threads + tracing + closures

2017-06-23 Thread Nathaniel Smith

New submission from Nathaniel Smith:

The attached script looks innocent, but gives wildly incorrect results on all 
versions of CPython I've tested.

It does two things:

- spawns a thread which just loops, doing nothing

- in the main thread, repeatedly increments a variable 'x'

And most of the increments of the variable are lost!

This requires two key things I haven't mentioned, but that you wouldn't expect 
to change anything. First, the thread function closes over the local variable 
'x' (though it doesn't touch this variable in any way). And second, the thread 
function has a Python-level trace function registered (but this trace function 
is a no-op).

Here's what's going on:

When you use sys.settrace() to install a Python-level trace function, it 
installs the C-level trace function "call_trampoline". And then whenever a 
trace event happens, call_trampoline calls PyFrame_FastToLocalsWithError, then 
calls the Python-level trace function, then calls PyFrame_LocalsToFast (see: 
https://github.com/python/cpython/blob/master/Python/sysmodule.c#L384-L395). 
This save/call/restore sequence is safe if all the variables being 
saved/restored are only visible to the current thread, which used to be true 
back in the days when local variables were really local. But it turns out 
nowadays (since, uh... python 2.1), local variables can be closed over, and 
thus can visible from multiple threads simultaneously.

Which means we get the following sequence of events:

- In thread A, a trace event occurs (e.g., executing a line of code)

- In thread A, call_trampoline does PyFrame_FastToLocalsWithError, which saves 
a snapshot of the current value of 'x'

- In thread A, call_trampoline then starts calling the trace function

- In thread B, we increment 'x'

- In thread A, the trace function returns

- In thread A, call_trampoline then does PyFrame_LocalsToFast, which restores 
the old value of 'x', overwriting thread B's modifications

This means that merely installing a Python-level trace function – for example, 
by running with 'python -m trace' or under pdb – can cause otherwise correct 
code to give wrong answers, in an incredibly obscure fashion.

In real life, I originally ran into this in a substantially more complicated 
situation involving PyPy and coverage.py and a nonlocal variable that was 
protected by a mutex, which you can read about here: 
https://bitbucket.org/pypy/pypy/issues/2591/
It turns out that since this only affects *Python*-level trace functions, 
merely recording coverage information using coverage.py doesn't normally 
trigger it, since on CPython coverage.py tries to install an accelerator module 
that uses a *C*-level trace function. Which is lucky for my particular case. 
But probably it should be fixed anyway :-).

CC'ing belopolsky as the interest area for the trace module, Mark Shannon 
because he seems to enjoy really pathological low-level bugs, and Benjamin and 
Yury as the "bytecode" interest area. I'm surprised that there's apparently no 
interest area for, like, "variables should retain the values they are assigned" 
-- apologies if I've CC'ed anyone incorrectly.

--
components: Interpreter Core
files: thread-closure-bug-demo.py
messages: 296751
nosy: Mark.Shannon, belopolsky, benjamin.peterson, njs, yselivanov
priority: normal
severity: normal
status: open
title: Local variable assignment is broken when combined with threads + tracing 
+ closures
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file46971/thread-closure-bug-demo.py

___
Python tracker 

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



[issue25720] Fix curses module compilation with ncurses6

2017-06-23 Thread Masayuki Yamamoto

Masayuki Yamamoto added the comment:

Ping. I updated PR a bit: macOS is joined to new compile condition and remove 
platform-specific condition.

--

___
Python tracker 

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



[issue24813] Redesign Help => About IDLE, make it non-modal

2017-06-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

There is something more I want to add: the bitness of the machine.

>>> platform.architecture()
('64bit', 'WindowsPE')

Display as '(64 bit)' or '(32 bit).  For the moment, add this to the title 
since it will not necessarily fit after python version.  See the doc note about 
Macs.

The reason has to do with import problems people report on Stackoverflow.  One 
possible reason is having multiple interpreters, only some of which have a 3rd 
party module.  Another is mismatched architecture.

At the same time, change the fg/bg to Mark's suggestion.

--

___
Python tracker 

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



[issue24813] Redesign Help => About IDLE, make it non-modal

2017-06-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset bd570f42110b99bade6e58e3ed2d620f27a92fc3 by terryjreedy in branch 
'3.6':
[3.6] bpo-24813: IDLE: Add default title to help_about (GH-2366) (#2369)
https://github.com/python/cpython/commit/bd570f42110b99bade6e58e3ed2d620f27a92fc3


--

___
Python tracker 

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



[issue24813] Redesign Help => About IDLE, make it non-modal

2017-06-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

tk Text does not have a ttk version and does have default and tab settable 
colors.  Maybe I should start experimenting with tagged text instead of Labels 
and Buttons.  Let's skip 4 for now.  You can work on 'default non-model' (I 
don't want to toss the modal code quite yet), or do something else, like 
configdialog.  At the moment, I would prefer the latter.

--

___
Python tracker 

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



[issue24813] Redesign Help => About IDLE, make it non-modal

2017-06-23 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +2419

___
Python tracker 

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



[issue24813] Redesign Help => About IDLE, make it non-modal

2017-06-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 18ede062581edb7e8d359d02cd3419466114cf5a by terryjreedy 
(csabella) in branch 'master':
bpo-24813: IDLE: Add default title to help_about (#2366)
https://github.com/python/cpython/commit/18ede062581edb7e8d359d02cd3419466114cf5a


--

___
Python tracker 

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



[issue24813] Redesign Help => About IDLE, make it non-modal

2017-06-23 Thread Cheryl Sabella

Cheryl Sabella added the comment:

I submitted a PR for #1.

For #4, I had a question to this related to ttk widgets.  When I had moved the 
widgets to ttk, I had to remove the fg and bg settings because the ttk versions 
of Label, Frame, and Widget don't have those as part of their config.  Do you 
want me to work on changing the colors without worrying about the ttk versions 
for now?

--

___
Python tracker 

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



[issue30726] [Windows] Warnings in elementtree due to new expat

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 8f525882fa43209d52afdb99753de2f5111d7433 by Victor Stinner in 
branch 'master':
bpo-30726: expat: Fix compiler warnings on Windows 64-bit (#2368)
https://github.com/python/cpython/commit/8f525882fa43209d52afdb99753de2f5111d7433


--

___
Python tracker 

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



[issue30728] IDLE: Modernize configdialog code.

2017-06-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I reviewed IDLE issues with patches.  I will post my updated issues list on the 
roadmap issue, #30422.  Of relevance to this issue is that config related 
patches are split between config, configdialog, and config_key, and limited to 
3 or 4 each.

I decided that we should start with a reduced version of PR 2307 focused on the 
caps names to no-caps name changes.  I evaluated other proposed changes on 
their likelihood of creating merge conflicts. Details are included in a new 
review of PR 2307.

It should be too difficult to make the same caps to no-caps changes in existing 
patch files, whether by hand or script.  First consider a TitleCase name, 
beginning with a cap.  We assume that it is a class or a name from another 
module unless discovered or indicated otherwise.  Any name following 'def' is 
not a class.  A file can be scanned once to find all function names defined in 
a module.  I did not see any local or non-function attribute TitleCase names.

We can assume that camelCase names are not class names and should change unless 
specified otherwise.  The change can be be dict lookup or the repacement rule: 
'X' to '_X'.  Attached is a file specifying camelCase names that should not be 
changed or that have a custom replacement.  TitleCase names can also have 
custom replacements.

--
Added file: 
http://bugs.python.org/file46970/configdialog_custom_name_changes.txt

___
Python tracker 

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



[issue30743] unittest discover does not mention module file must be named with "test_" prefix

2017-06-23 Thread Alessandro Piccione

Alessandro Piccione added the comment:

If you refer to the -p ("pattern" parameter) I think not.
I have my module named aaaTest.py.
I is is not mentioned that discover look for modules named "test_" for which 
reason I have to use a pattern?

If you refer to -s ("start-directory" parameter) same thing: for which reason I 
have to assume my aaaTest.py module is not recognized as a test?

--

___
Python tracker 

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



[issue30743] unittest discover does not mention module file must be named with "test_" prefix

2017-06-23 Thread Zachary Ware

Zachary Ware added the comment:

Does this cover what you're looking for?

https://docs.python.org/3/library/unittest.html#cmdoption-unittest-discover-p

--
nosy: +zach.ware

___
Python tracker 

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



[issue30743] unittest discover does not mention module file must be named with "test_" prefix

2017-06-23 Thread Alessandro Piccione

New submission from Alessandro Piccione:

1. execute "python -m unittest"
2. Result: 0 test found
3. Change file name from "aaaTest.py" to "test_aaa.py" 
4. execute "python -m unittest"
3. Result: Ran 1 tests in 000.0s

Module file MUST be named using the prefiux "test_".

The page "https://docs.python.org/3/library/unittest.html;
does not mention this MANDATORY rule.

I went to this conclusion because I readed the documentation without find any 
point about the naming convention of modules and than looking for this specific 
rule searching "test_" and "test_ " without any result.

Regards,

Alessandro

--
assignee: docs@python
components: Documentation
messages: 296740
nosy: alex.75, docs@python
priority: normal
severity: normal
status: open
title: unittest discover does not mention module file must be named with 
"test_" prefix
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



[issue30543] test_timeout fails on AMD64 FreeBSD CURRENT Debug 3.x: ConnectionResetError: [Errno 54] Connection reset by peer

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%20CURRENT%20Debug%203.6/builds/266/steps/test/logs/stdio

==
ERROR: testSend (test.test_timeout.TCPTimeoutTestCase)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/test/test_timeout.py",
 line 151, in tearDown
self.sock.close()
  File 
"/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/socket.py", line 
417, in close
self._real_close()
  File 
"/usr/home/buildbot/python/3.6.koobs-freebsd-current/build/Lib/socket.py", line 
411, in _real_close
_ss.close(self)
ConnectionResetError: [Errno 54] Connection reset by peer

--

___
Python tracker 

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



[issue30742] VS2015 support for 2.7 branch

2017-06-23 Thread Dženan Zukić

Changes by Dženan Zukić :


--
components: +Build -Library (Lib)
type:  -> compile error

___
Python tracker 

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



[issue30742] VS2015 support for 2.7 branch

2017-06-23 Thread Dženan Zukić

New submission from Dženan Zukić:

In VS2015 timezone and friends have been replace by _timezone (related 
issue24643). The second problem is missing _PyVerify_fd during linking phase.

--
components: Library (Lib)
messages: 296738
nosy: Dženan Zukić
priority: normal
severity: normal
status: open
title: VS2015 support for 2.7 branch
versions: Python 2.7

___
Python tracker 

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



[issue30726] [Windows] Warnings in elementtree due to new expat

2017-06-23 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2418

___
Python tracker 

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



[issue30711] getaddrinfo invalid port number

2017-06-23 Thread Radek Smejkal

Radek Smejkal added the comment:

See also issue30710.

--

___
Python tracker 

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



[issue30711] getaddrinfo invalid port number

2017-06-23 Thread Radek Smejkal

Changes by Radek Smejkal :


Removed file: http://bugs.python.org/file46965/getaddrinfo_invalid_port.patch

___
Python tracker 

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



[issue24813] Redesign Help => About IDLE, make it non-modal

2017-06-23 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
pull_requests: +2417

___
Python tracker 

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



[issue30696] infinite loop in PyRun_InteractiveLoopFlags()

2017-06-23 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
pull_requests: +2416

___
Python tracker 

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



[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-23 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
pull_requests: +2415

___
Python tracker 

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



[issue30664] Change unittest's _SubTest to not sort its params when printing test failures

2017-06-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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



[issue30664] Change unittest's _SubTest to not sort its params when printing test failures

2017-06-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 48fbe52ac71ea711a4701db909ad1ce2647b09fd by Serhiy Storchaka in 
branch 'master':
bpo-30664: The description of a unittest subtest now preserves the (#2265)
https://github.com/python/cpython/commit/48fbe52ac71ea711a4701db909ad1ce2647b09fd


--

___
Python tracker 

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



[issue11978] Report correct coverage.py data for tests that invoke subprocesses

2017-06-23 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee: brett.cannon -> 

___
Python tracker 

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



[issue30645] imp.py: load_package() appends to its own loop variable

2017-06-23 Thread Brett Cannon

Changes by Brett Cannon :


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



[issue11978] Report correct coverage.py data for tests that invoke subprocesses

2017-06-23 Thread Brett Cannon

Brett Cannon added the comment:

Just an FYI that I have never managed to make this work.

--

___
Python tracker 

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



[issue30645] imp.py: load_package() appends to its own loop variable

2017-06-23 Thread Brett Cannon

Brett Cannon added the comment:


New changeset 599ff020b308113f3709fd4e623d9f0d08511706 by Brett Cannon in 
branch '3.5':
[3.5] bpo-30645: don't append to an inner loop path in imp.load_package() 
(GH-2268) (GH-2365)
https://github.com/python/cpython/commit/599ff020b308113f3709fd4e623d9f0d08511706


--

___
Python tracker 

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



[issue30645] imp.py: load_package() appends to its own loop variable

2017-06-23 Thread Brett Cannon

Brett Cannon added the comment:


New changeset 9db3ae045dd462a2da2e016c44231de1befd1f87 by Brett Cannon in 
branch '3.6':
[3.6] bpo-30645: don't append to an inner loop path in imp.load_package() 
(GH-2268) (#2364)
https://github.com/python/cpython/commit/9db3ae045dd462a2da2e016c44231de1befd1f87


--

___
Python tracker 

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



[issue30532] email.policy.SMTP.fold() mangles long headers

2017-06-23 Thread R. David Murray

R. David Murray added the comment:

Just as well.  I had no time last weekend.  I should have time this Sunday, 
though.

--

___
Python tracker 

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



[issue30734] 200000 indexes crashes eval and python (without eval)

2017-06-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:

To be clear, as the title and version suggest, the bug is the 2.7 segfault 
versus the 3.x exception during compile.  It is normal for the compiler to have 
limits and to exit when they are exceeded.

I have no idea if the 3.x code can be backported.  I added ast/compiler experts 
to the nosy list.

--
nosy: +benjamin.peterson, brett.cannon, ncoghlan, terry.reedy, yselivanov

___
Python tracker 

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



[issue30645] imp.py: load_package() appends to its own loop variable

2017-06-23 Thread Brett Cannon

Changes by Brett Cannon :


--
pull_requests: +2414

___
Python tracker 

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



[issue30645] imp.py: load_package() appends to its own loop variable

2017-06-23 Thread Brett Cannon

Changes by Brett Cannon :


--
pull_requests: +2413

___
Python tracker 

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



[issue30730] Injecting environment variable in subprocess on Windows

2017-06-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +georg.brandl
stage: patch review -> backport needed
versions: +Python 3.3, Python 3.4 -Python 2.7

___
Python tracker 

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



[issue30730] Injecting environment variable in subprocess on Windows

2017-06-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +2412

___
Python tracker 

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



[issue30730] Injecting environment variable in subprocess on Windows

2017-06-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +2411

___
Python tracker 

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



[issue30645] imp.py: load_package() appends to its own loop variable

2017-06-23 Thread Brett Cannon

Brett Cannon added the comment:


New changeset c38e32a10061a7c6d54e7e53ffabf7af7998f045 by Brett Cannon 
(Alexandru Ardelean) in branch 'master':
bpo-30645: don't append to an inner loop path in imp.load_package() (GH-2268)
https://github.com/python/cpython/commit/c38e32a10061a7c6d54e7e53ffabf7af7998f045


--

___
Python tracker 

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



[issue30730] Injecting environment variable in subprocess on Windows

2017-06-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset a7c0264735f46afab13771be4218d8eab0d7dc91 by Serhiy Storchaka in 
branch '3.5':
[3.5] bpo-30730: Prevent environment variables injection in subprocess on 
Windows. (GH-2325) (#2361)
https://github.com/python/cpython/commit/a7c0264735f46afab13771be4218d8eab0d7dc91


--

___
Python tracker 

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



[issue30730] Injecting environment variable in subprocess on Windows

2017-06-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset e7135751b8e48af80665e40ac8fa6d0073e5affe by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-30730: Prevent environment variables injection in subprocess on 
Windows. (GH-2325) (#2360)
https://github.com/python/cpython/commit/e7135751b8e48af80665e40ac8fa6d0073e5affe


--

___
Python tracker 

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



[issue30741] https://www.pypi-mirrors.org/ error 503

2017-06-23 Thread Brett Cannon

Brett Cannon added the comment:

So is this a bug in Python or a problem with the website? If it's the former 
then the title is misleading and we should clarify it, and if it's the latter 
this should be closed as "third party".

--
nosy: +brett.cannon

___
Python tracker 

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



[issue24813] Redesign Help => About IDLE, make it non-modal

2017-06-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 1b7474dedcbbd731a362b17abfbd7e5a60b64f63 by terryjreedy in branch 
'3.6':
[3.6] bpo-24813: IDLE: Add icon to help_about (GH-2335) (#2359)
https://github.com/python/cpython/commit/1b7474dedcbbd731a362b17abfbd7e5a60b64f63


--

___
Python tracker 

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



[issue30730] Injecting environment variable in subprocess on Windows

2017-06-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +2410

___
Python tracker 

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



[issue30730] Injecting environment variable in subprocess on Windows

2017-06-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +2409

___
Python tracker 

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



[issue30730] Injecting environment variable in subprocess on Windows

2017-06-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset d174d24a5d37d1516b885dc7c82f71ecd5930700 by Serhiy Storchaka in 
branch 'master':
bpo-30730: Prevent environment variables injection in subprocess on Windows. 
(#2325)
https://github.com/python/cpython/commit/d174d24a5d37d1516b885dc7c82f71ecd5930700


--

___
Python tracker 

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



[issue30730] Injecting environment variable in subprocess on Windows

2017-06-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka

___
Python tracker 

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



[issue24813] Redesign Help => About IDLE, make it non-modal

2017-06-23 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +2408

___
Python tracker 

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



[issue24813] Redesign Help => About IDLE, make it non-modal

2017-06-23 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset d352d689775699c289e011e8cec52c23c600b7fa by terryjreedy 
(csabella) in branch 'master':
bpo-24813: IDLE: Add icon to help_about (#2335)
https://github.com/python/cpython/commit/d352d689775699c289e011e8cec52c23c600b7fa


--

___
Python tracker 

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



[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-23 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
pull_requests:  -2406

___
Python tracker 

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



[issue30696] infinite loop in PyRun_InteractiveLoopFlags()

2017-06-23 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
pull_requests:  -2407

___
Python tracker 

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



[issue30696] infinite loop in PyRun_InteractiveLoopFlags()

2017-06-23 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
pull_requests: +2407

___
Python tracker 

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



[issue30695] add a nomemory_allocator to the _testcapi module

2017-06-23 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
pull_requests: +2406

___
Python tracker 

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



[issue30741] https://www.pypi-mirrors.org/ error 503

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:

See also issue #30739:
  Could not fetch URL https://pypi.python.org/simple/PyJWT/: connection error: 
[SSL: CERTIFICATE_VERIFY_FAILED] unknown error (_ssl.c)

--

___
Python tracker 

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



[issue30741] https://www.pypi-mirrors.org/ error 503

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:

http://www.pypi-mirrors.org/ (clear text) works and redirects to 
https://www.pypi-mirrors.org/ (TLS) which fails with HTTP error 503:

503 Service Unavailable
No server is available to handle this request.

--
nosy: +haypo

___
Python tracker 

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



[issue30741] https://www.pypi-mirrors.org/ error 503

2017-06-23 Thread Luc Zimmermann

New submission from Luc Zimmermann:

is that linked with the certificate error on pypi ? 

you redirect http request to https, but you still listen 80 and not 443 ?

--
messages: 296721
nosy: Luc Zimmermann
priority: normal
severity: normal
status: open
title: https://www.pypi-mirrors.org/ error 503
type: security

___
Python tracker 

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



[issue30740] SSLError when cancelling an SSL connection

2017-06-23 Thread Mark Haase

New submission from Mark Haase:

If a task is cancelled while it waiting for SSL negotiation, then an SSLError 
is raised, but there is no way (as far as I can tell) for the caller to catch 
it. (The example below is pretty contrived, but in an application I'm working 
on, the user can cancel downloads at any time.) Here's an example:

import asyncio, random, ssl

async def download(host):
ssl_context = ssl.create_default_context()
reader, writer = await asyncio.open_connection(host, 443, 
ssl=ssl_context)
request = f'HEAD / HTTP/1.1\r\nHost: {host}\r\n\r\n'
writer.write(request.encode('ascii'))
lines = list()
while True:
newdata = await reader.readline()
if newdata == b'\r\n':
break
else:
lines.append(newdata.decode('utf8').rstrip('\r\n'))
return lines[0]

async def main():
while True:
task = asyncio.Task(download('www.python.org'))
await asyncio.sleep(random.uniform(0.0, 0.5))
task.cancel()
try:
response = await task
print(response)
except asyncio.CancelledError:
print('request cancelled!')
except ssl.SSLError:
print('caught SSL error')
await asyncio.sleep(1)

loop = asyncio.get_event_loop()
loop.run_until_complete(main())
loop.close()

Running this script yields the following output:

HTTP/1.1 200 OK
request cancelled!
HTTP/1.1 200 OK
HTTP/1.1 200 OK
: SSL handshake 
failed
Traceback (most recent call last):
  File "/usr/lib/python3.6/asyncio/base_events.py", line 803, in 
_create_connection_transport
yield from waiter
  File "/usr/lib/python3.6/asyncio/tasks.py", line 304, in _wakeup
future.result()
concurrent.futures._base.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/asyncio/sslproto.py", line 577, in 
_on_handshake_complete
raise handshake_exc
  File "/usr/lib/python3.6/asyncio/sslproto.py", line 638, in 
_process_write_backlog
ssldata = self._sslpipe.shutdown(self._finalize)
  File "/usr/lib/python3.6/asyncio/sslproto.py", line 155, in shutdown
ssldata, appdata = self.feed_ssldata(b'')
  File "/usr/lib/python3.6/asyncio/sslproto.py", line 219, in feed_ssldata
self._sslobj.unwrap()
  File "/usr/lib/python3.6/ssl.py", line 692, in unwrap
return self._sslobj.shutdown()
ssl.SSLError: [SSL] shutdown while in init (_ssl.c:2299)

I posted this on async-sig, and Nathaniel replied:

> SSLObject.unwrap has the contract that if it finishes successfully, then the 
> SSL connection has been cleanly shut down and both sides remain in sync, and 
> can continue to use the socket in unencrypted mode. When asyncio calls unwrap 
> before the handshake has completed, then this contract is impossible to 
> fulfill, and raising an error is the right thing to do. So imo the ssl module 
> is correct here, and this is a (minor) bug in asyncio.

The unwrap() call that throws is already wrapped in `try ... except SSLError` 
but the exception handler checks for specific SSL error codes and re-throws 
this particular SSL error. 

except (ssl.SSLError, ssl.CertificateError) as exc:
if getattr(exc, 'errno', None) not in (
ssl.SSL_ERROR_WANT_READ, ssl.SSL_ERROR_WANT_WRITE,
ssl.SSL_ERROR_SYSCALL):
if self._state == _DO_HANDSHAKE and self._handshake_cb:
self._handshake_cb(exc)
raise
self._need_ssldata = (exc.errno == ssl.SSL_ERROR_WANT_READ)

I think this could be fixed checking for SSL_R_SHUTDOWN_WHILE_IN_INIT in this 
exception handler, but that constant doesn't exist in _ssl.c.

As an alternative, maybe a new state _ABORT_HANDSHAKE could be introduced (the 
existing states are _DO_HANDSHAKE, _WRAPPED, _SHUTDOWN, and _UNWRAP).

I'm happy to try my hand at either one of these approaches if somebody can 
point me in the right direction.

--
components: asyncio
messages: 296720
nosy: mehaase, yselivanov
priority: normal
severity: normal
status: open
title: SSLError when cancelling an SSL connection
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



[issue30602] [Windows] os.spawn*() tests of test_os leak references on Windows

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:

Thank you Eryk Sun for the careful reviews! All known issues on os.spawn*() on 
Windows are now be fixed, so I closed this issue.

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



[issue30604] co_extra_freefuncs is stored thread locally and can lead to crashes

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:


New changeset cea2174ab7cce01c420b2770562be4c91f1f4e35 by Victor Stinner in 
branch '3.6':
bpo-30604: Skip CoExtra tests if ctypes is missing (#2356) (#2358)
https://github.com/python/cpython/commit/cea2174ab7cce01c420b2770562be4c91f1f4e35


--

___
Python tracker 

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



[issue30602] [Windows] os.spawn*() tests of test_os leak references on Windows

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:


New changeset c472fb6b2744b36c7a0823c20e0d5ac9be3ea623 by Victor Stinner in 
branch '3.6':
bpo-30602: Fix lastarg in os.spawnve() (#2287) (#2357)
https://github.com/python/cpython/commit/c472fb6b2744b36c7a0823c20e0d5ac9be3ea623


--

___
Python tracker 

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



[issue30604] co_extra_freefuncs is stored thread locally and can lead to crashes

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:

The test_code is fixed again, so 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



[issue29591] expat 2.2.0: Various security vulnerabilities in bundled expat (CVE-2016-0718 and CVE-2016-4472)

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:


New changeset d32a05953130fb5cc2d3c0c9fcb20ad0859353f3 by Victor Stinner in 
branch '3.6':
[3.6] bpo-30726: PCbuild _elementtree: remove duplicate defines (#2348) (#2349)
https://github.com/python/cpython/commit/d32a05953130fb5cc2d3c0c9fcb20ad0859353f3


--

___
Python tracker 

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



[issue30726] [Windows] Warnings in elementtree due to new expat

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:


New changeset d32a05953130fb5cc2d3c0c9fcb20ad0859353f3 by Victor Stinner in 
branch '3.6':
[3.6] bpo-30726: PCbuild _elementtree: remove duplicate defines (#2348) (#2349)
https://github.com/python/cpython/commit/d32a05953130fb5cc2d3c0c9fcb20ad0859353f3


--

___
Python tracker 

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



[issue30726] [Windows] Warnings in elementtree due to new expat

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:


New changeset f42ce179c8aaa7e211ac4123c58fa3dd9a452004 by Victor Stinner in 
branch '3.5':
[3.5] bpo-30726: PCbuild _elementtree: remove duplicate defines (#2348) (#2350)
https://github.com/python/cpython/commit/f42ce179c8aaa7e211ac4123c58fa3dd9a452004


--

___
Python tracker 

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



[issue29591] expat 2.2.0: Various security vulnerabilities in bundled expat (CVE-2016-0718 and CVE-2016-4472)

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:


New changeset f42ce179c8aaa7e211ac4123c58fa3dd9a452004 by Victor Stinner in 
branch '3.5':
[3.5] bpo-30726: PCbuild _elementtree: remove duplicate defines (#2348) (#2350)
https://github.com/python/cpython/commit/f42ce179c8aaa7e211ac4123c58fa3dd9a452004


--

___
Python tracker 

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



[issue21071] struct.Struct.format is bytes, but should be str

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:

Ok, I changed struct.Struct.format type to str (Unicode string).

If someone wants to modify the C code to use a PyUnicodeObject rather than a 
char*, feel free to propose a further change.

Since the initial issue is fixed, I now close the issue.

Thank you all for your feedback and reviews ;-)

--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed
versions: +Python 3.7 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue21071] struct.Struct.format is bytes, but should be str

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:


New changeset f87b85f80853c580b1c8bf78a51b0e9a25f6e1a7 by Victor Stinner in 
branch 'master':
bpo-21071: struct.Struct.format type is now str (#845)
https://github.com/python/cpython/commit/f87b85f80853c580b1c8bf78a51b0e9a25f6e1a7


--

___
Python tracker 

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



[issue30604] co_extra_freefuncs is stored thread locally and can lead to crashes

2017-06-23 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2405

___
Python tracker 

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



[issue30604] co_extra_freefuncs is stored thread locally and can lead to crashes

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:


New changeset a4b091e135ccf345cfafdd8477aef897c5214f82 by Victor Stinner in 
branch 'master':
bpo-30604: Skip CoExtra tests if ctypes is missing (#2356)
https://github.com/python/cpython/commit/a4b091e135ccf345cfafdd8477aef897c5214f82


--

___
Python tracker 

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



[issue30739] pypi ssl errors [CERTIFICATE_VERIFY_FAILED]

2017-06-23 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +dstufft

___
Python tracker 

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



[issue30739] pypi ssl errors [CERTIFICATE_VERIFY_FAILED]

2017-06-23 Thread Luc Zimmermann

New submission from Luc Zimmermann:

Hi Guys, 

I've a strange behavior. 
We use python for configure our new boxes with openWRT and coovaChilli.

But since yesterday, when i ask to pip to dowload PyJWT, json-cfg and 
speedtest-cli, 

some boxes can download these packages, and some can't.

root@OpenWrt:~# cat /root/.pip/pip.log

/usr/bin/pip run on Thu Apr 13 18:46:19 2017
Downloading/unpacking PyJWT
  Getting page https://pypi.python.org/simple/PyJWT/
  Could not fetch URL https://pypi.python.org/simple/PyJWT/: connection error: 
[SSL: CERTIFICATE_VERIFY_FAILED] unknown error (_ssl.c)
  Will skip URL https://pypi.python.org/simple/PyJWT/ when looking for download 
links for PyJWT
  Getting page https://pypi.python.org/simple/
  Could not fetch URL https://pypi.python.org/simple/: connection error: 
HTTPSConnectionPool(host='pypi.python.org', port=443): Max r)
  Will skip URL https://pypi.python.org/simple/ when looking for download links 
for PyJWT
  Cannot fetch index base URL https://pypi.python.org/simple/
  URLs to search for versions for PyJWT:
  * https://pypi.python.org/simple/PyJWT/
  Getting page https://pypi.python.org/simple/PyJWT/
  Could not fetch URL https://pypi.python.org/simple/PyJWT/: connection error: 
[SSL: CERTIFICATE_VERIFY_FAILED] unknown error (_ssl.c)
  Will skip URL https://pypi.python.org/simple/PyJWT/ when looking for download 
links for PyJWT
  Could not find any downloads that satisfy the requirement PyJWT
Cleaning up...
  Removing temporary dir /tmp/pip_build_root...
No distributions at all found for PyJWT
Exception information:
Traceback (most recent call last):
  File 
"/usr/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 
122, in main
status = self.run(options, args)
  File 
"/usr/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/commands/install.py", 
line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, 
bundle=self.bundle)
  File "/usr/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 
1177, in prepare_files
url = finder.find_requirement(req_to_install, upgrade=self.upgrade)
  File "/usr/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/index.py", 
line 277, in find_requirement
raise DistributionNotFound('No distributions at all found for %s' % req)
DistributionNotFound: No distributions at all found for PyJWT

--
messages: 296708
nosy: Luc Zimmermann
priority: normal
severity: normal
status: open
title: pypi ssl errors [CERTIFICATE_VERIFY_FAILED]
type: resource usage
versions: Python 2.7

___
Python tracker 

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



[issue30602] [Windows] os.spawn*() tests of test_os leak references on Windows

2017-06-23 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2404

___
Python tracker 

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



[issue30602] [Windows] os.spawn*() tests of test_os leak references on Windows

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:


New changeset c8d6ab2e25ff212702d387e516e258b1d8c52910 by Victor Stinner in 
branch 'master':
bpo-30602: Fix lastarg in os.spawnve() (#2287)
https://github.com/python/cpython/commit/c8d6ab2e25ff212702d387e516e258b1d8c52910


--

___
Python tracker 

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



[issue30604] co_extra_freefuncs is stored thread locally and can lead to crashes

2017-06-23 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2403

___
Python tracker 

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



[issue30727] [2.7] test_threading.ConditionTests.test_notify() hangs randomly on Python 2.7

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:

> In Python 3 the test was failed if decrease the sleep time in _wait() to 
> 0.001. Patched test no longer fail for any small sleep intervals.

I used sleep(1e-9), 1 nanosecond, for my tests :-)

I confirm that I'm unable to reproduce the bug on 2.7 and master
branches anymore. Well done Serhiy!

--

___
Python tracker 

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



[issue29304] dict: simplify lookup functions

2017-06-23 Thread INADA Naoki

Changes by INADA Naoki :


--
pull_requests: +2402

___
Python tracker 

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



[issue30541] Add restricted mocks to the python unittest mocking framework

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:

> I don't like the idea of an additional Mock class for this.

Hum, in the current implementation, it's an enhancement of the Mock class, no 
more a new class.

--

___
Python tracker 

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



[issue26145] PEP 511: Add sys.set_code_transformers()

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:

Recently, some people asked me for an update for my FAT Python project. So I 
rebased this change I wrote 1 year 1/2 and adapted it for the new code base:

* I renamed test_pep511.py to test_code_transformer.py
* I removed the sys module from the PyInterpreterState structure (added in my 
previous patch), since Eric Snow and Nick Coghlan removed a variant of the sys 
module from this structure for their work on subinterpreters and reworked 
Python initialization

The PEP 511 is not accepted, so the implementation is still a work-in-progress 
(WIP) and must not be merged.

--

___
Python tracker 

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



[issue26145] PEP 511: Add sys.set_code_transformers()

2017-06-23 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2401

___
Python tracker 

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



[issue26098] PEP 510: Specialize functions with guards

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:

Recently, some people asked me for an update for my FAT Python project. So I 
rebased this change I wrote 1 year 1/2 and adapted it for the new code base:

* I renamed test_pep510.py to test_func_specialize.py
* I removed the useless PyFunction_Check() macro
* I changed the guard check prototype to use the new FASTCALL calling 
convention: (PyObject **args, Py_ssize_t nargs, PyObject *kwnames: tuple)
* I patched _PyFunction_FastCallDict() *and* PyFunction_FastCallKeywords() to 
check guards and call specified code if guards succeeded

The PEP 510 is not accepted, so the implementation is still a work-in-progress 
(WIP) and must not be merged.

--

___
Python tracker 

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



[issue26098] PEP 510: Specialize functions with guards

2017-06-23 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2400

___
Python tracker 

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



[issue29304] dict: simplify lookup functions

2017-06-23 Thread Antoine Pitrou

Antoine Pitrou added the comment:

>From a purely human and social perspective, I agree that it's beneficial to 
>minimize duplicated code.

>From a performance perspective, I can see two possible consequences:
- either compilers are already smart enough to undo the code duplication, and 
generated code will remain the same => no performance difference
- or compilers are not able to undo the code duplication, and the reduced 
I-cache pressure may be beneficial on non-trivial workloads => potential 
improvement (though probably minor) with the reduced code size

--
nosy: +pitrou

___
Python tracker 

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



[issue30727] [2.7] test_threading.ConditionTests.test_notify() hangs randomly on Python 2.7

2017-06-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In Python 3 the test was failed if decrease the sleep time in _wait() to 0.001. 
Patched test no longer fail for any small sleep intervals.

--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed
versions: +Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue30727] [2.7] test_threading.ConditionTests.test_notify() hangs randomly on Python 2.7

2017-06-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 7709b4d57b433ef027a2e7e63b4cab3fc9ad910d by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-30727: Fix a race condition in test_threading. (GH-2334). (#2353)
https://github.com/python/cpython/commit/7709b4d57b433ef027a2e7e63b4cab3fc9ad910d


--

___
Python tracker 

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



[issue30727] [2.7] test_threading.ConditionTests.test_notify() hangs randomly on Python 2.7

2017-06-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset e2aec8e691d8acb08373889d9af48a5b1d03b689 by Serhiy Storchaka in 
branch '3.5':
[3.5] bpo-30727: Fix a race condition in test_threading. (GH-2334) (#2352)
https://github.com/python/cpython/commit/e2aec8e691d8acb08373889d9af48a5b1d03b689


--

___
Python tracker 

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



[issue30727] [2.7] test_threading.ConditionTests.test_notify() hangs randomly on Python 2.7

2017-06-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset c1d5345679eaa5fccd719b1c130140eecc8ba4c8 by Serhiy Storchaka in 
branch '3.6':
[3.6] bpo-30727: Fix a race condition in test_threading. (GH-2334) (#2351)
https://github.com/python/cpython/commit/c1d5345679eaa5fccd719b1c130140eecc8ba4c8


--

___
Python tracker 

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



[issue30541] Add restricted mocks to the python unittest mocking framework

2017-06-23 Thread Michael Foord

Michael Foord added the comment:

Note that you can use an object as the parameter to the spec argument rather 
than just a list of attributes. 

Hmmm... I'm not totally opposed to the addition of a "seal_mock" method 
(optionally with a recurse boolean for child mocks) being added to the 
Mock/MagicMock classes. It's quite a nice API. I don't like the idea of an 
additional Mock class for this.

--

___
Python tracker 

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



[issue30727] [2.7] test_threading.ConditionTests.test_notify() hangs randomly on Python 2.7

2017-06-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +2399

___
Python tracker 

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



[issue30726] [Windows] Warnings in elementtree due to new expat

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 87c65550730a8f85ce339ba197bce4fb7e836619 by Victor Stinner (Segev 
Finer) in branch 'master':
bpo-30726: Fix elementtree warnings on Windows due to expat upgrade (#2319)
https://github.com/python/cpython/commit/87c65550730a8f85ce339ba197bce4fb7e836619


--

___
Python tracker 

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



[issue30727] [2.7] test_threading.ConditionTests.test_notify() hangs randomly on Python 2.7

2017-06-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +2398

___
Python tracker 

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



[issue30727] [2.7] test_threading.ConditionTests.test_notify() hangs randomly on Python 2.7

2017-06-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +2397

___
Python tracker 

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



[issue30727] [2.7] test_threading.ConditionTests.test_notify() hangs randomly on Python 2.7

2017-06-23 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 32cb968a2edd482891c33b6f2ebae10f1d305424 by Serhiy Storchaka in 
branch 'master':
bpo-30727: Fix a race condition in test_threading. (#2334)
https://github.com/python/cpython/commit/32cb968a2edd482891c33b6f2ebae10f1d305424


--

___
Python tracker 

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



[issue30726] [Windows] Warnings in elementtree due to new expat

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:

> Oh... I'm sorry Segev Finer, I didn't see that you proposed a PR :-(

Please rebase and rewrite your PR to just add _CRT_SECURE_NO_WARNINGS. Once 
merged, I will include this change to my 3.6 and 3.5 backports.

--

___
Python tracker 

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



[issue30726] [Windows] Warnings in elementtree due to new expat

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:

For siphash.h warnings, I created a PR on libexpat:
https://github.com/libexpat/libexpat/pull/58

--

___
Python tracker 

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



[issue30462] urllib does not support NO_PROXY environment variable containing domain with asterisk

2017-06-23 Thread Xiang Zhang

Xiang Zhang added the comment:

One question about this function: hosts like "*.foo.com" gets an unambiguous 
intention, but how about hosts like "*foo.com"? Should it match hosts like 
barfoo.com, or treat it as a typo and not match? Although the link says 
"asterisks can be used as wildcards" but I am still not quite sure it's 
intention.

--

___
Python tracker 

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



[issue30726] [Windows] Warnings in elementtree due to new expat

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:

Oh... I'm sorry Segev Finer, I didn't see that you proposed a PR :-(

--

___
Python tracker 

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



[issue29591] expat 2.2.0: Various security vulnerabilities in bundled expat (CVE-2016-0718 and CVE-2016-4472)

2017-06-23 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2396

___
Python tracker 

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



[issue30726] [Windows] Warnings in elementtree due to new expat

2017-06-23 Thread STINNER Victor

STINNER Victor added the comment:

My commit c8fb58bd7917151e63398587a7fc2126db7c26de (co-written with Jeremy 
Kloth) fixes the "macro redefinition".

There are still warnings in the siphash code, but I suggest to report them 
upstream, and *then* propose to cherry-pick fixes from libexpat (as I did for 
Visual Studio 2008 support in Python 2.7 when I upgraded libexpat to 2.2.1, but 
I was lucky, the fix was already made in libexpat).

--

___
Python tracker 

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



[issue30726] [Windows] Warnings in elementtree due to new expat

2017-06-23 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2393

___
Python tracker 

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



  1   2   >