[issue29594] implementation of __or__ in enum.auto

2017-02-17 Thread Marc Guetg

Changes by Marc Guetg :


--
title: implement __or__ in enum.auto -> implementation of __or__ in enum.auto

___
Python tracker 

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



[issue29549] Improve docstring for str.index

2017-02-17 Thread Sanyam Khurana

Changes by Sanyam Khurana :


--
pull_requests: +107

___
Python tracker 

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



[issue29521] Minor warning messages when compiling documentation

2017-02-17 Thread Amit Kumar

Changes by Amit Kumar :


--
pull_requests: +106

___
Python tracker 

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



[issue29556] Remove unused #include

2017-02-17 Thread Ezio Melotti

Changes by Ezio Melotti :


--
Removed message: http://bugs.python.org/msg288058

___
Python tracker 

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



[issue29548] Recommend PyObject_Call* APIs over PyEval_Call*() APIs

2017-02-17 Thread Ezio Melotti

Changes by Ezio Melotti :


--
Removed message: http://bugs.python.org/msg288059

___
Python tracker 

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



[issue29481] 3.6.0 doc describes 3.6.1 feature - typing.Deque

2017-02-17 Thread Ezio Melotti

Changes by Ezio Melotti :


--
Removed message: http://bugs.python.org/msg288060

___
Python tracker 

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



[issue29576] Improve some deprecations in the importlib

2017-02-17 Thread Ezio Melotti

Changes by Ezio Melotti :


--
Removed message: http://bugs.python.org/msg288061

___
Python tracker 

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



[issue29026] time.time() documentation should mention UTC timezone

2017-02-17 Thread Ezio Melotti

Changes by Ezio Melotti :


--
Removed message: http://bugs.python.org/msg288063

___
Python tracker 

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



[issue29521] Minor warning messages when compiling documentation

2017-02-17 Thread Ezio Melotti

Changes by Ezio Melotti :


--
Removed message: http://bugs.python.org/msg288062

___
Python tracker 

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



[issue29505] Submit the re, json, & csv modules to oss-fuzz testing

2017-02-17 Thread Alex Gaynor

Changes by Alex Gaynor :


--
nosy: +alex

___
Python tracker 

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



[issue29576] Improve some deprecations in the importlib

2017-02-17 Thread Nick Coghlan

Nick Coghlan added the comment:


New changeset 1d4601c2c6952d03fc4dda2b041be9aa8713c0bc by Brett Cannon in 
branch 'ncoghlan-devguide-link':
bpo-29576: add explicit deprecation for importlib.abc.find_loader() and 
find_module() (GH-32)
https://github.com/python/cpython/commit/1d4601c2c6952d03fc4dda2b041be9aa8713c0bc


--
nosy: +ncoghlan

___
Python tracker 

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



[issue29481] 3.6.0 doc describes 3.6.1 feature - typing.Deque

2017-02-17 Thread Nick Coghlan

Nick Coghlan added the comment:


New changeset 36da1c3589e1bc4246cccf6bd0094a110416a43a by GitHub in branch 
'ncoghlan-devguide-link':
bpo-29481: add versionadded 3.6.1 to typing.Deque docs (#107)
https://github.com/python/cpython/commit/36da1c3589e1bc4246cccf6bd0094a110416a43a


--
nosy: +ncoghlan

___
Python tracker 

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



[issue29026] time.time() documentation should mention UTC timezone

2017-02-17 Thread Nick Coghlan

Nick Coghlan added the comment:


New changeset 23557d59b819f57800ddef0b1373acef8e024670 by Victor Stinner in 
branch 'ncoghlan-devguide-link':
bpo-29026: Clarify documentation of time.time (#34)
https://github.com/python/cpython/commit/23557d59b819f57800ddef0b1373acef8e024670


--
nosy: +ncoghlan

___
Python tracker 

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



[issue29548] Recommend PyObject_Call* APIs over PyEval_Call*() APIs

2017-02-17 Thread Nick Coghlan

Nick Coghlan added the comment:


New changeset 72dccde884d89586b0cafd990675b7e21720a81f by GitHub in branch 
'ncoghlan-devguide-link':
bpo-29548: Fix some inefficient call API usage (GH-97)
https://github.com/python/cpython/commit/72dccde884d89586b0cafd990675b7e21720a81f


--
nosy: +ncoghlan

___
Python tracker 

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



[issue29556] Remove unused #include

2017-02-17 Thread Nick Coghlan

Nick Coghlan added the comment:


New changeset 72e81d00eee685cfe33aaddf2aa9feef2d07591f by Victor Stinner in 
branch 'ncoghlan-devguide-link':
bpo-29556: Remove unused #include  (#98)
https://github.com/python/cpython/commit/72e81d00eee685cfe33aaddf2aa9feef2d07591f


--
nosy: +ncoghlan

___
Python tracker 

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



[issue29521] Minor warning messages when compiling documentation

2017-02-17 Thread Nick Coghlan

Nick Coghlan added the comment:


New changeset 85064db281545d587992df61154e76439138319f by Victor Stinner in 
branch 'ncoghlan-devguide-link':
bpo-29521 update Misc/ACKS (#106)
https://github.com/python/cpython/commit/85064db281545d587992df61154e76439138319f


--
nosy: +ncoghlan

___
Python tracker 

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



[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread INADA Naoki

INADA Naoki added the comment:

PR 136 now adds `sys._framework` and 'PYTHONFRAMEWORK' macro in pyconfig.h.

--

___
Python tracker 

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



[issue29571] test_re is failing when local is set for `en_IN`

2017-02-17 Thread Nick Coghlan

Nick Coghlan added the comment:

I have a few folks hitting this at the PyCon Pune sprints, so I'm going to 
apply Serhiy's patch :)

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

___
Python tracker 

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



[issue28087] macOS 12 poll syscall returns prematurely

2017-02-17 Thread Nick Coghlan

Nick Coghlan added the comment:

The failures in test_eintr and test_asyncio are confusing new contributors on 
Mac OS X - could we get some variant of this workaround merged until Apple fix 
their bug?

--
nosy: +ncoghlan

___
Python tracker 

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



[issue18861] Problems with recursive automatic exception chaining

2017-02-17 Thread Nathaniel Smith

Changes by Nathaniel Smith :


--
nosy: +njs

___
Python tracker 

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



[issue29561] Interactive mode gives sys.ps2 not sys.ps1 after comment-only line

2017-02-17 Thread Terry J. Reedy

Terry J. Reedy added the comment:

If src is effectively blank, compile(src, filename, mode) raises SyntaxError if 
mode is 'single' but not if it is 'exec'.  I believe IDLE compiles with 
'single', but it has the behavior Jim (and I) expect and consider correct, 
printing '>>>' after effectively blank lines.  This is because IDLE uses 
code.InteractiveInterpreter, which uses codeop.compile_command, which uses 
codeop._maybe_compile, which replaces effectively blank statements with 'pass'. 
 compile('pass', '', 'single') returns a do-nothing code object.  The C-coded 
interactive interpreter is doing something else.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue29592] abs_paths() in site.py is slow

2017-02-17 Thread INADA Naoki

INADA Naoki added the comment:

$ python2 -S
Python 2.7.12+ (default, Sep 17 2016, 12:08:02) 
[GCC 6.2.0 20160914] on linux2
>>> import x
>>> x.__file__
'x.py'

$ python3 -S
Python 3.6.0 (default, Dec 30 2016, 20:49:54) 
[GCC 6.2.0 20161005] on linux
>>> import x
>>> x.__file__
'/home/inada-n/x.py'

I think we can remove `abs_paths()` in site.py, thanks to 
_frozen_importlib_external.

I added all import experts to nosy list.
Please give me advice.

--
nosy: +brett.cannon, eric.snow, fdrake, ncoghlan

___
Python tracker 

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



[issue29592] abs_paths() in site.py is slow

2017-02-17 Thread INADA Naoki

INADA Naoki added the comment:

https://github.com/python/cpython/blob/master/Lib/importlib/_bootstrap_external.py#L1089-L1095

While '' in sys.path, it is converted to `getcwd()` before calling PathHook.
Is there any chance relative / not normalized path is in sys.path before site 
is loaded?

--

___
Python tracker 

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



[issue29580] "Built-in Functions" not being functions

2017-02-17 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I concur with the other respondents and am going to mark this as closed.

--
nosy: +rhettinger
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue29560] Turtle graphics fill behavior differs between versions

2017-02-17 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I believe that there is a known difference between tk on Windows and linux with 
respect to filling of even and odd areas.  If I understand correctly, you saw 
one behavior on Windows and the other on Linux.  If so, this is not a bug in 
tkinter.

--
nosy: +serhiy.storchaka, terry.reedy

___
Python tracker 

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



[issue29592] abs_paths() in site.py is slow

2017-02-17 Thread INADA Naoki

INADA Naoki added the comment:

path normalization was added by
https://github.com/python/cpython/commit/38cb9f1f174415d3b37fbaeb5d152d65525839d2

--

___
Python tracker 

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



[issue5945] PyMapping_Check returns 1 for lists

2017-02-17 Thread James R Barlow

Changes by James R Barlow :


--
pull_requests: +105

___
Python tracker 

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



[issue29596] Unfinished sentense in howto/clinic.rst

2017-02-17 Thread Matthias Bussonnier

New submission from Matthias Bussonnier:

Around line 1400 of Doc/howto/clinic.rst

  ``two-pass``
A buffer like ``buffer``.  However, a two-pass buffer can only
be written once, and it prints out all text sent to it during
all of processing, even from Clinic blocks *after* the

I've rarely be kept in such suspense ! Unless it's a reference to Monty 
Python's "The Man Who Finishes Other People's Sentences". In which case, I must 
say it's

--
assignee: docs@python
components: Documentation
messages: 288048
nosy: docs@python, mbussonn
priority: normal
severity: normal
status: open
title: Unfinished sentense in howto/clinic.rst
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



[issue29453] Remove reference to undefined dictionary ordering in Tutorial

2017-02-17 Thread Raymond Hettinger

Raymond Hettinger added the comment:

>> But maybe it is worth to mention that the output 
>> corresponds to the order of passed keyword arguments
 
> Should I add this note? 

Yes, please.  This is a section on keyword arguments, making it the preferred 
place to mention the new guaranteed output order.

--

___
Python tracker 

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



[issue28879] smtplib send_message should add Date header if it is missing, per RFC5322

2017-02-17 Thread Eric Lafontaine

Eric Lafontaine added the comment:

Hi,

Could someone put this ticket on "waiting for review"?

Regards,
Eric Lafontaine

--

___
Python tracker 

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



[issue6721] Locks in the standard library should be sanitized on fork

2017-02-17 Thread Camilla Montonen

Changes by Camilla Montonen :


--
nosy: +Winterflower

___
Python tracker 

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



[issue29247] Document return value of epoll.poll

2017-02-17 Thread Camilla Montonen

Changes by Camilla Montonen :


--
nosy: +Winterflower

___
Python tracker 

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



[issue29575] doc 17.2.1: basic Pool example is too basic

2017-02-17 Thread Camilla Montonen

Camilla Montonen added the comment:

Would you like to open a PR with a patch on GH? I think the docs could 
certainly do with another example for Pool.

--
nosy: +Winterflower

___
Python tracker 

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



[issue19675] Pool dies with excessive workers, but does not cleanup

2017-02-17 Thread Camilla Montonen

Camilla Montonen added the comment:

Would it be possible to see a review of the existing attempts at testing this 
issue?

--

___
Python tracker 

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



[issue29595] Expose max_queue_size in ThreadPoolExecutor

2017-02-17 Thread prayerslayer

New submission from prayerslayer:

Hi!

I think the ThreadPoolExecutor should allow to set the maximum size of the 
underlying queue.

The situation I ran into recently was that I used ThreadPoolExecutor to 
parallelize AWS API calls; I had to move data from one S3 bucket to another 
(~150M objects). Contrary to what I expected the maximum size of the underlying 
queue doesn't have a non-zero value by default. Thus my process ended up 
consuming gigabytes of memory, because it put more items into the queue than 
the threads were able to work off: The queue just kept growing. (It ran on K8s 
and the pod was rightfully killed eventually.)

Of course there ways to work around this. One could use more threads, to some 
extent. Or you could use your own queue with a defined maximum size. But I 
think it's more work for users of Python than necessary.

--
messages: 288043
nosy: prayerslayer
priority: normal
pull_requests: 104
severity: normal
status: open
title: Expose max_queue_size in ThreadPoolExecutor
type: enhancement

___
Python tracker 

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



[issue29579] Windows Python 3.7 installer broken by README.txt renamed to README.rst

2017-02-17 Thread Steve Dower

Steve Dower added the comment:

I don't think that removing the readme.txt from the install constitutes a 
breaking change (LICENSE would be a bigger deal), and removing the file from 
the installer sounds simpler than updating the readme.

Also, if you choose the 3.6 branch from the GitHub page you'll see whatever 
readme is in there, hence my thought that it would be backported.

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



[issue29593] Improve UnboundLocalError message for deleted names

2017-02-17 Thread Martin Panter

Martin Panter added the comment:

Matthias’s proposal sounds reasonable to me. There is a minor disadvantage that 
it will exceed the width of an 80-character terminal:

UnboundLocalError: local variable 'x' referenced before assignment, or got delet
ed

But I don’t think the wrapping is a big deal; it already happens with longer 
variable names anyway. I doubt using “unset” instead of “deleted” is any 
better. If you really wanted to make it clear, you would have to say “or got 
deleted, perhaps by an exception handler”, but that is probably going too far.

Another idea, which separates the hint from the technical error:

UnboundLocalError: local variable 'x' not set; perhaps it is not yet assigned

--

___
Python tracker 

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



[issue29579] Windows Python 3.7 installer broken by README.txt renamed to README.rst

2017-02-17 Thread Zachary Ware

Zachary Ware added the comment:

There were significant corrections to the README in that backport that should 
not be lost if we do de-restify the 3.6 readme.

--

___
Python tracker 

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



[issue29579] Windows Python 3.7 installer broken by README.txt renamed to README.rst

2017-02-17 Thread STINNER Victor

STINNER Victor added the comment:

Steve> Anyone know how far the change has been backported?

Ah, it seems like the README.txt => README.rst change was backported:
commit 1e8cc88a48a049b064f786bb4b97ea60b70dc504.

Since it breaks the Windows installer, I suggest to revert this change.

FYI my first motivation to convert README to reST was to have a nicer
homepage for http://github.com/python/cpython/ But the homepage uses
the README of the master branch.

--

___
Python tracker 

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



[issue29593] Improve UnboundLocalError message for deleted names

2017-02-17 Thread Matthias Bussonnier

Matthias Bussonnier added the comment:

> makes the error message longer

Out of curiosity is there a guide as to what is considered a too long error 
message ?

Or is there a technical reason like after a certain length strings are not 
cached and exception will be slower to construct ? I'm trying to understand why 
rhettinger would have proposed in his talk to make this specific error message 
longer and there is a push back now. 

> and since "del" is rarely used for deleting local variables I afraid that it 
> can add confusion in most cases.

> The "del" statement is not the only way to unset the local variable.

Good point, would "or has been unset" be acceptable ?

--

___
Python tracker 

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



[issue29579] Windows Python 3.7 installer broken by README.txt renamed to README.rst

2017-02-17 Thread Zachary Ware

Zachary Ware added the comment:

So far, to 3.6.  I don't really expect it to move back to 3.5, and 2.7's README 
is its own mess.

--

___
Python tracker 

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



[issue29579] Windows Python 3.7 installer broken by README.txt renamed to README.rst

2017-02-17 Thread Steve Dower

Steve Dower added the comment:

Okay. Unless someone volunteers to write a Windows specific one, I'll make the 
change to the installer to leave it out.

Anyone know how far the change has been backported?

--

___
Python tracker 

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



[issue29586] Cannot run pip in fresh install of py 3.5.3

2017-02-17 Thread Steve Dower

Steve Dower added the comment:

Depending on why the pip install failed, we may still have registered that it 
was installed. IIRC, we only trigger the install on a state change, which 
wouldn't happen in repair. That deserves its own bug (though maybe this one 
will suffice if we figure out the original failure - I haven't looked at the 
logs yet)

--

___
Python tracker 

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



[issue29586] Cannot run pip in fresh install of py 3.5.3

2017-02-17 Thread Eryk Sun

Eryk Sun added the comment:

The original install failed with the status code STATUS_DLL_NOT_FOUND 
(0xC135), as reported in "Python 3.5.3 
(32-bit)_20170217102132_008_pip_JustForMe.log":

MSI (s) (88:D8) [10:22:59:574]: Executing op: ActionStart(Name=UpdatePip,,)
MSI (s) (88:D8) [10:22:59:575]: Executing op: CustomActionSchedule(
Action=UpdatePip,ActionType=1089, Source=BinaryData,Target=CAQuietExec,
CustomActionData="C:\Python\Python35-32\python.exe" -E -s -m ensurepip 
-U --default-pip)
MSI (s) (88:C4) [10:22:59:588]: Invoking remote custom action.
DLL: C:\Windows\Installer\MSI2C60.tmp,
Entrypoint: CAQuietExec
MSI (s) (88:B0) [10:22:59:588]: Generating random cookie.
MSI (s) (88:B0) [10:22:59:590]: Created Custom Action Server with PID 6212 
(0x1844).
MSI (s) (88:A8) [10:22:59:630]: Running as a service.
MSI (s) (88:A8) [10:22:59:631]: Hello, I'm your 32bit Impersonated custom 
action server.
CAQuietExec:  Error 0xc135: Command line returned an error.
CAQuietExec:  Error 0xc135: QuietExec Failed
CAQuietExec:  Error 0xc135: Failed in ExecCommon method
MSI (s) (88:D8) [10:22:59:658]: Executing op: End(Checksum=0,
ProgressTotalHDWord=0,ProgressTotalLDWord=287056)
CustomAction UpdatePip returned actual error code 1603 but will be
translated to success due to continue marking

Did your system require a reboot for Python 3.5 to work?

>From what I can see in "Python 3.5.3 
>(32-bit)_20170217131555_007_pip_JustForMe.log", it looks like the repair 
>skipped installing pip. 

MSI (s) (D8:1C) [13:16:31:822]: Skipping action: SetRemovePipCommandLine 
(condition is false)
MSI (s) (D8:1C) [13:16:31:822]: Skipping action: SetUpdatePipCommandLine 
(condition is false)
MSI (s) (D8:1C) [13:16:31:822]: Skipping action: UpdatePip (condition is 
false)
MSI (s) (D8:1C) [13:16:31:822]: Doing action: InstallFinalize
MSI (s) (D8:1C) [13:16:31:822]: Note: 1: 2205 2:  3: ActionText 
Action ended 13:16:31: PublishProduct. Return value 1.

Maybe Steve Dower can shed light on why a repair with pip selected didn't try 
to install pip.

--

___
Python tracker 

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



[issue1025395] email.Utils.parseaddr fails to parse valid addresses

2017-02-17 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +103

___
Python tracker 

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



[issue29593] Improve UnboundLocalError message for deleted names

2017-02-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Adding "or got deleted" makes the error message longer, and since "del" is 
rarely used for deleting local variables I afraid that it can add confusion in 
most cases.

The "del" statement is not the only way to unset the local variable.

>>> def foo():
... e = None
... try:
... 1/0
... except Exception as e:
... pass
... print(e)
... 
>>> foo()
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 7, in foo
UnboundLocalError: local variable 'e' referenced before assignment

--

___
Python tracker 

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



[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +merwok

___
Python tracker 

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



[issue29593] Improve UnboundLocalError message for deleted names

2017-02-17 Thread Matthias Bussonnier

Matthias Bussonnier added the comment:

> Wouldn't be better to say just "local variable 'xxx' is not set"?

Thank you for responding that fast and for your interest in this issue. 

While I think that "local variable 'xxx' is not set" is technically correct, I 
think it would be a step back.

The improvement of the error message is not really meant for the 99% of the 
developers hanging on b.p.o. I think for these just the fact that there is an 
UnboundLocalError is sufficient to know what's happening. 

The error message will mostly be useful for users that still don't have much 
clue about what's going on. For these kind of users UnboundLocalError("local 
variable 'xxx' is not set") is not much different from NameError("name 'xxx' is 
not defined")[*]

The current error message already does a good job at giving some extra hint as 
to why this is the case. In particular that it is (often) assigned but not in 
the right place. Changing to "local variable 'xxx' is not set" will likely make 
many novices check the spelling, and be more confused.

Note that "local variable 'xxx' referenced before assignment, or got deleted" 
would not be completely obvious for novices either, why would the following not 
trigger such an error ? 

In [1]: def foo():
   ...: if False:
   ...: print(n)
   ...: n = 1

Well, for you and me it's (likely) obvious. 

I want to point out (just stealing rhettinger example) that it might not be 
obvious either the variable has been deleted:

In [5]: def foo():
   ...: n = 1 
   ...: def g(): # imagine a more complex g
   ...: del n 
   ...: g()
   ...: print(n) #UnboundLocalError
   ...:

So I think expanding the error message to give hints as of _why_ is better than 
just stating what is. 


[*] Source: The users I work with. Last question I got on wednesday: "Can you 
re-explain the difference between a string and a function". They meant "list" 
and "list comprehension".

--

___
Python tracker 

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



[issue29565] Still broken ctypes calling convention on MSVC / 64-bit Windows (large structs)

2017-02-17 Thread Eryk Sun

Eryk Sun added the comment:

This issue is more straight-forward than #22273. ISTM, we just have to copy 
large values. For example, in ffi_call, we'd iterate over the arguments and 
alloca and memcpy the large values prior to calling ffi_call_AMD64:

case FFI_SYSV:
  /* If a single argument takes more than 8 bytes,
 then a copy is passed by reference. */
  for (unsigned i = 0; i < cif->nargs; i++) {
  size_t z = cif->arg_types[i]->size;
  if (z > 8) {
  void *temp = alloca(z);
  memcpy(temp, avalue[i], z);
  avalue[i] = temp;
  }
  }
  /*@-usedef@*/
  return ffi_call_AMD64(ffi_prep_args, , cif->bytes,
cif->flags, ecif.rvalue, fn);
  /*@=usedef@*/
  break;

--

___
Python tracker 

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



[issue29540] Add compact=True flag to json.dump/dumps

2017-02-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Since core developers have different opinions about this issue, it should be 
discussed on the Python-Dev maillist until one side convince the other side or 
BDFL make his decision.

Personally I dislike any complication of json API. Likely it is already the 
most complicated API in the stdlib.

--

___
Python tracker 

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



[issue29594] implement __or__ in enum.auto

2017-02-17 Thread Marc Guetg

New submission from Marc Guetg:

At the moment it is only possible to combine flags that already exist:

from enum import *
class Foo(Flag):
A = auto()  # 1
B = auto()  # 2
AB = A | B  # 3 (1 | 2)
AC = auto() | A # Fails, but should be 5 (1 | 4)
ABD = auto() | A | B # Just taking it one step further to make a point, 11 
(1 | 2 | 8)

It would be nice to have this for cases when C only makes sense in combination 
with A but not on its own.


A solution to achieve this one would need to change two things in 
~/cpython/Lib/enum.py

First extend class auto by:
class auto:
"""
Instances are replaced with an appropriate value in Enum class suites.
"""
value = _auto_null
or_value = 0

def __or__(self, other):
""" Postpone the real or operation until value creation in _EnumDict """
 
self.or_value |= other
return self

And second change one line in _EnumDict:
value = value.value
changes to:
value = value.value | value.or_value


Some simple tests show the expected results:
print(repr(Foo.A))  # A  - 1
print(repr(Foo.B))  # B  - 2
print(repr(Foo.AB)) # AB - 3
print(repr(Foo.AC)) # AC - 5
print(repr(Foo.A | Foo.AC)) # AC - 5
print(repr(Foo.A & Foo.AC)) # A  - 1
print(repr(Foo.ABD))# ABD  - 11

Would it make sense to enhance python enums with that functionality?

--
components: Library (Lib)
files: test.py
messages: 288029
nosy: magu
priority: normal
severity: normal
status: open
title: implement __or__ in enum.auto
type: enhancement
versions: Python 3.6, Python 3.7
Added file: http://bugs.python.org/file46646/test.py

___
Python tracker 

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



[issue29579] Windows Python 3.7 installer broken by README.txt renamed to README.rst

2017-02-17 Thread Ned Deily

Ned Deily added the comment:

FWIW, we do not include the top-level README in the macOS installer package.  
Instead, we supply Mac-installer specific Welcome and Readme files that are 
displayed by the macOS Installer app during the installation process and the 
installer Readme is also installed for later reference.  These files are also 
the primary documentation for python.org macOS binary installer changes.  I 
agree with Zach that the top-level README doesn't seem very useful for binary 
installs.

--

___
Python tracker 

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



[issue29549] Improve docstring for str.index

2017-02-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

str.index() still is not converted to Argument Clinic (this is not easy). The 
docstring needs to be rewritten when convert it to Argument Clinic in any case. 
It would be nice to make it Argument Clinic compatible right now. The first 
line line should be short description, following paragraph(s) can describe more 
details, the description shouldn't refer to the metavariable S.

Docstrings for str, bytes and bytearray methods should be synchronised. Look 
also at docstrings for the index() method in other sequence types (list, tuple, 
deque, array, Sequence).

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue29546] A more helpful ImportError message

2017-02-17 Thread Ivan Levkivskyi

Changes by Ivan Levkivskyi :


--
nosy: +levkivskyi

___
Python tracker 

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



[issue29540] Add compact=True flag to json.dump/dumps

2017-02-17 Thread Ben Hoyt

Ben Hoyt added the comment:

I agree with the confusion (PR proposes separators=COMPACT, issue compact=True).

I like the concept but not either of the APIs proposed. I *much* more often 
want to get pretty output -- if I had a dime for every time I've written 
"json.dumps(obj, sort_keys=True, indent=4)" I'd be rich enough to buy an entire 
cup of Starbucks coffee. But then you'd need a pretty=True option as well, 
which would be mutually exclusive with compact=True, so not great.

But what about a style= (or "format="?) parameter, which defaults to 'default' 
(or just None) meaning the same as now. If you pass format='pretty' you get 
"sort_keys=True, indent=4" and if you pass format='compact' you get 
"separators=(',', ':')".

--
nosy: +benhoyt

___
Python tracker 

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



[issue29581] __init_subclass__ causes TypeError when used with standard library metaclasses (such as ABCMeta)

2017-02-17 Thread Ivan Levkivskyi

Changes by Ivan Levkivskyi :


--
nosy: +levkivskyi

___
Python tracker 

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



[issue29549] Improve docstring for str.index

2017-02-17 Thread Ben Hoyt

Ben Hoyt added the comment:

Good call. Additionally, it's weird to me that the docstring for str.find() 
says "Return -1 on failure." because the string not being found is not a 
"failure". Like the docs 
(https://docs.python.org/3.5/library/stdtypes.html#str.find) say, the 
str.find() docstring should say "Return -1 if sub is not found."

--
nosy: +benhoyt

___
Python tracker 

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



[issue29593] Improve UnboundLocalError message for deleted names

2017-02-17 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Wouldn't be better to say just "local variable 'xxx' is not set"?

--
components: +Interpreter Core
nosy: +martin.panter, r.david.murray, rhettinger, serhiy.storchaka

___
Python tracker 

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



[issue29593] Improve UnboundLocalError message for deleted names

2017-02-17 Thread Matthias Bussonnier

New submission from Matthias Bussonnier:

Raymond Hettinger reported during PyCon Canada 2016 Keynote (~20m30 sec)
that unbound local error message was inaccurate, it state that :

> local variable 'xxx' referenced before assignment

Though it can be assigned and deleted.

for a toy example:

   def foo():
  x = 1
  del x
  print(x)

   foo()

Do the same for free variable.

def multiplier(n):
def multiply(x):
return x * n
del n
return multiply

The error message can be improved by adding "or got deleted".

--
messages: 288023
nosy: mbussonn
priority: normal
pull_requests: 102
severity: normal
status: open
title: Improve UnboundLocalError message for deleted names
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue29586] Cannot run pip in fresh install of py 3.5.3

2017-02-17 Thread Adrian Chan

Adrian Chan added the comment:

Install logs attached.
First set from initial install, second set from repair.

--
Added file: http://bugs.python.org/file46645/py_install_logs.tar.gz

___
Python tracker 

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



[issue26788] test_gdb fails all tests on a profile-opt build configured --with-lto

2017-02-17 Thread Gregory P. Smith

Gregory P. Smith added the comment:

there may be something in sysconfig.get_config_vars() we could use or, better, 
we could add something specific to indicate both pgo and lto builds.

--

___
Python tracker 

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



[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread INADA Naoki

INADA Naoki added the comment:

I create #29592 for abs_paths().  Let's focus on sysconfig in this issue.

PR 136 ports really needed part of sysconfig into site.py already.
'PYTHONFRAMEWORK' on macOS is the only variable we need import from sysconfig.

Adding `site.cfg` like `pyvenv.cfg` make sense?

--

___
Python tracker 

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



[issue29592] abs_paths() in site.py is slow

2017-02-17 Thread INADA Naoki

New submission from INADA Naoki:

abs_paths() is the another most slow parts of site module.
We can speedup it if we have C implementation of os.path.abspath() or 
abs_paths().

But before trying it, is abs_paths() really needed for now?
It only rewrite `__file__` and `__cached__` of modules imported before site is 
imported.
What is difference between modules loaded befere / after site module?

Here is profile output. sysconfig dependency is removed by #29585 patch, and 
pstat is modified
to show time in ms instead of sec.

   Ordered by: cumulative time

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
  3/10.0040.0012.5252.525 {built-in method builtins.exec}
10.0030.0032.5242.524 x.py:1()
10.0100.0101.8061.806 site.py:555(main)
  4/30.0220.0051.1790.393 :958(_find_and_load)
  4/30.0170.0041.1100.370 :931(_find_and_load_unlocked)
10.1950.1950.9280.928 site.py:99(abs_paths)
  1080.0980.0010.7760.007 posixpath.py:367(abspath)
40.0350.0090.6470.162 :861(_find_spec)
40.0050.0010.5890.147 :1150(find_spec)
40.0430.0110.5840.146 :1118(_get_spec)
  2/10.0120.0060.5570.557 :641(_load_unlocked)
  2/10.0060.0030.5110.511 :673(exec_module)
  1080.4610.0040.4930.005 posixpath.py:329(normpath)
   160.1500.0090.4530.028 :1234(find_spec)

--
components: Library (Lib)
messages: 288019
nosy: inada.naoki
priority: normal
severity: normal
status: open
title: abs_paths() in site.py is slow
type: performance
versions: Python 3.7

___
Python tracker 

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



[issue29591] Various security vulnerabilities in bundled expat

2017-02-17 Thread Christian Heimes

Changes by Christian Heimes :


--
assignee:  -> christian.heimes
components: +XML
stage:  -> needs patch
versions:  -Python 3.3, Python 3.4

___
Python tracker 

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



[issue29591] Various security vulnerabilities in bundled expat

2017-02-17 Thread Christian Heimes

Christian Heimes added the comment:

CVE-2016-0718 and CVE-2016-4472 might be relevant for Python. CVE-2016-5300 and 
CVE-2012-6702 are irrelevant. As Victor already pointed out, Python seeds 
libexpat from a good CPRNG.

--

___
Python tracker 

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



[issue29591] Various security vulnerabilities in bundled expat

2017-02-17 Thread Chi Hsuan Yen

Changes by Chi Hsuan Yen :


--
nosy: +Chi Hsuan Yen

___
Python tracker 

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



[issue29591] Various security vulnerabilities in bundled expat

2017-02-17 Thread STINNER Victor

STINNER Victor added the comment:

You may want to look also at https://pypi.python.org/pypi/defusedxml

--

___
Python tracker 

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



[issue29591] Various security vulnerabilities in bundled expat

2017-02-17 Thread STINNER Victor

STINNER Victor added the comment:

> CVE-2012-6702 (issue 519)
> Resolve troublesome internal call to srand that was introduced with Expat 
> 2.1.0 when addressing CVE-2012-0876 (issue 496)

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2012-6702

Extract of Modules/pyexpat.c:
---
#if ((XML_MAJOR_VERSION >= 2) && (XML_MINOR_VERSION >= 1)) || 
defined(XML_HAS_SET_HASH_SALT)
/* This feature was added upstream in libexpat 2.1.0.  Our expat copy
 * has a backport of this feature where we also define XML_HAS_SET_HASH_SALT
 * to indicate that we can still use it. */
XML_SetHashSalt(self->itself,
(unsigned long)_Py_HashSecret.prefix);
#endif
---

Python 2.7, 3.5, 3.6 and 3.7 have this call at least (I didn't check other 
versions).

--
nosy: +christian.heimes, haypo

___
Python tracker 

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



[issue29579] Windows Python 3.7 installer broken by README.txt renamed to README.rst

2017-02-17 Thread Zachary Ware

Zachary Ware added the comment:

Another option acceptable to me would be to simply leave out the readme 
entirely.  I wasn't even aware it was included until this issue came up :)

--

___
Python tracker 

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



[issue29591] Various security vulnerabilities in bundled expat

2017-02-17 Thread Natanael Copa

New submission from Natanael Copa:

cpython bundles expat in Modules/expat/ and needs to be updated to expat-2.2.0 
to fix various security vulnerabilities.

21 June 2016, Expat 2.2.0 released.
Release 2.2.0 includes security & other bug fixes.

Security fixes

CVE-2016-0718 (issue 537)
Fix crash on malformed input

CVE-2016-4472
Improve insufficient fix to CVE-2015-1283 / CVE-2015-2716 introduced with Expat 
2.1.1

CVE-2016-5300 (issue 499)
Use more entropy for hash initialization than the original fix to CVE-2012-0876

CVE-2012-6702 (issue 519)
Resolve troublesome internal call to srand that was introduced with Expat 2.1.0 
when addressing CVE-2012-0876 (issue 496)

Fix should be applied to all maintained python branches.

--
messages: 288014
nosy: Natanael Copa
priority: normal
severity: normal
status: open
title: Various security vulnerabilities in bundled expat
type: security
versions: Python 2.7, Python 3.3, Python 3.4, 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



[issue29579] Windows Python 3.7 installer broken by README.txt renamed to README.rst

2017-02-17 Thread Zachary Ware

Zachary Ware added the comment:

With the exception of the Travis and Codecov badges, `rst2html README.rst` 
produces a nicely self-contained HTML readme.

However, I'm not sure how useful that readme is on Windows.  Perhaps we should 
draft a new, simple readme for inclusion in the Windows installers that focuses 
on Python on Windows.

--

___
Python tracker 

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



[issue28637] Python startup performance regression

2017-02-17 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



Re: [issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread M.-A. Lemburg
On 17.02.2017 13:06, STINNER Victor wrote:
>> Alternatively, sysconfig data could be made available via a C lookup 
>> function; with the complete dictionary only being created on demand. 
>> get_config_var() already is such a lookup API which could be used as 
>> front-end.
> 
> I don't think that it's worth it to reimplement partially sysconfig in
> C. This module is huge, complex, and platform dependant.

Sorry, I was just referring to the data part of sysconfig,
not sysconfig itself.

Having a lookup function much like we have for unicodedata
makes things much more manageable, since you don't need to
generate a dictionary in memory for all the values in the
config data. Creating that dictionary takes a while (in terms
of ms).

-- 
Marc-Andre Lemburg
eGenix.com

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



[issue25612] nested try..excepts don't work correctly for generators

2017-02-17 Thread Guido van Rossum

Changes by Guido van Rossum :


--
nosy:  -gvanrossum

___
Python tracker 

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



[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-17 Thread STINNER Victor

STINNER Victor added the comment:

Thank you for your check! Good to know that it works on Android.

Chi Hsuan Yen added the comment:
> I know little about the C API. Just a question: isn't 
> PyImport_ImportModuleNoBlock deprecated?

I am not aware of any deprecation:
https://docs.python.org/dev/c-api/import.html#c.PyImport_ImportModuleNoBlock

Oh, it seems like the function is now more an less an alias to
PyImport_ImportModule().

I wasn't aware that the "NoBlock" is no more needed: I copied/pasted
from a different .c file, I don't recall which one. I should updated
other files ;-)

--

___
Python tracker 

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



[issue29590] Incorrect stack traces when re-entering a generator/coroutine stack via .throw()

2017-02-17 Thread Nathaniel Smith

New submission from Nathaniel Smith:

The attached script sets up a stack of generators calling each other via 'yield 
from': f yields from g yield from h. Then the generator at the bottom of the 
stack yields.

Before they yield, sys._getframe shows the expected stack (or if you put in 
traceback.print_stack() you get the same thing).

After they yield, it depends: if the generator is resumed via 'gen.send(None)', 
then the stack looks sensible. But if the generator is resumed via 
'gen.throw(...)', then the stack is weird: Objects/genobject.c:_gen_throw 
implements 'yield from' in an weird manual way, where it first directly resumes 
the innermost generator frame, and then propagates any result to the next 
generator frame, etc. So the output I get from the sample script is:

~$ python3.6 weird-throw-stack.py
-- f before yielding --
f

-- g before yielding --
g
f

-- h before yielding --
h
g
f

-- h after yielding --
h

-- g after yielding --
g

-- f after yielding --
f


This causes problems for stack-based profiling 
(https://github.com/vmprof/vmprof-python/issues/117), debuggers, and other 
tools that need to introspect the stack.

--
files: weird-throw-stack.py
messages: 288010
nosy: njs
priority: normal
severity: normal
status: open
title: Incorrect stack traces when re-entering a generator/coroutine stack via 
.throw()
versions: Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file46644/weird-throw-stack.py

___
Python tracker 

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



[issue29586] Cannot run pip in fresh install of py 3.5.3

2017-02-17 Thread Eryk Sun

Eryk Sun added the comment:

If you have the 3.5 installation logs in your %TEMP% directory, please zip them 
up and attach them to this issue.

--

___
Python tracker 

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



[issue29586] Cannot run pip in fresh install of py 3.5.3

2017-02-17 Thread Adrian Chan

Adrian Chan added the comment:

It's all working fine now, thanks.

If one of the installer/windows guys wants to dig more into why this didn't 
install properly I'm happy to run things in my environment as necessary.

--

___
Python tracker 

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



[issue29586] Cannot run pip in fresh install of py 3.5.3

2017-02-17 Thread Eryk Sun

Eryk Sun added the comment:

pip should be installed in site-packages, which for you is 
"C:\Python\Python35-32\Lib\site-packages". Try manually running ensurepip to 
make sure pip is installed:

python -m ensurepip --verbose --upgrade --default-pip

--

___
Python tracker 

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



[issue29176] /tmp does not exist on Android and is used by curses.window.putwin()

2017-02-17 Thread Chi Hsuan Yen

Chi Hsuan Yen added the comment:

Here are test results for PR 53:

shell@ASUS_Z00E_2:/data/local/tmp $ python3.7m -m test -u curses test_curses
Run tests sequentially
0:00:00 [1/1] test_curses
1 test OK.

Total duration: 1 sec
Tests result: SUCCESS
abcshell@ASUS_Z00E_2:/data/local/tmp $ 

I know little about the C API. Just a question: isn't 
PyImport_ImportModuleNoBlock deprecated?

--

___
Python tracker 

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



[issue29589] test_asyncio & test_multiprocessing_forkserver failed

2017-02-17 Thread Dima Zhukov

New submission from Dima Zhukov:

Hi, i'm new to Python. Just have downloded source code and tried to install it, 
but "make test" failed 2 test: test_asyncio  and 
test_multiprocessing_forkserver. How bad is it and what should i do? Logs 
attached

--
components: Build
files: tests.output
messages: 288005
nosy: Dima Zhukov
priority: normal
severity: normal
status: open
title: test_asyncio & test_multiprocessing_forkserver failed
type: behavior
versions: Python 3.6
Added file: http://bugs.python.org/file46643/tests.output

___
Python tracker 

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



[issue29586] Cannot run pip in fresh install of py 3.5.3

2017-02-17 Thread Adrian Chan

Adrian Chan added the comment:

Thanks, but I know how to drive a terminal ;)

Your hunch was basically correct though.  I ran again with `python -v -m pip` 
(see with_pip_dir.txt), and see that python is attempting to import pip from my 
user directory (C:\Users\amc2\pip).  This is an empty directory, except for an 
old pip log file from 2.7.

If I rename the directory to something unrelated, `python -m pip` just fails 
with:

C:\Python\Python35-32\python.exe: No module named pip.

So mystery 1 is solved.

I've definitely selected the pip option in the python installer.  I also 
repaired the installation, with the pip option selected, and the error still 
remains.
Where is pip supposed to be located on a win7 install?

--
Added file: http://bugs.python.org/file46642/import_logs.tar.gz

___
Python tracker 

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



[issue29583] Python 3.6 won't install on Windows 2012 R2

2017-02-17 Thread Eryk Sun

Eryk Sun added the comment:

That's good news. As far as I can see, there isn't anything Python's installer 
can do if the CRT update fails for reasons beyond our control, so I'm closing 
this as a 3rd party issue. Thank you for the report.

--
resolution:  -> third party
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



[issue29586] Cannot run pip in fresh install of py 3.5.3

2017-02-17 Thread Eryk Sun

Eryk Sun added the comment:

That error looks like __init__.py[c] was left in 
"C:\python27\lib\site-packages\pip". Just to be sure, since I don't know what 
you did to clear the value, please run `set PYTHONPATH=` to clear the value for 
the current shell. Then try `python -m pip`.

When you modify or remove an environment variable using the control panel 
dialog, it broadcasts a window message that causes Explorer to reload its 
environment. Generally console applications such as cmd.exe do not own a 
top-level window (the console window is owned by conhost.exe) and thus cannot 
see this broadcasted message. To get the updated environment, you have to run a 
new instance of cmd from Explorer.

--

___
Python tracker 

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



[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread INADA Naoki

INADA Naoki added the comment:

no-site
python_startup_no_site: Median +- std dev: 9.13 ms +- 0.02 ms

default:
python_startup: Median +- std dev: 15.6 ms +- 0.0 ms

GH-136 + skip abs_paths().
python_startup: Median +- std dev: 14.2 ms +- 0.0 ms

profile of GH-136 + skip abs_paths():
https://gist.github.com/methane/26fc0a2382207655a6819a92f867620c

Most of time is consumed by importlib.

--

___
Python tracker 

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



[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread INADA Naoki

INADA Naoki added the comment:

FYI, here is profile of site:
https://gist.github.com/methane/1f1fe4385dad84f03eb429359f0f917b

--

___
Python tracker 

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



[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread Christian Heimes

Christian Heimes added the comment:

Instead of _site, would it make sense to include the four vars in sys, perhaps 
as named structure like sys.flags?

--

___
Python tracker 

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



[issue29586] Cannot run pip in fresh install of py 3.5.3

2017-02-17 Thread Adrian Chan

Adrian Chan added the comment:

There is no traceback, that is the entirety of the output of the command.

Python bin is C:\Python\Python35-32\python.exe
PYTHONHOME is not set.
PYTHONPATH is C:\python27\lib\site-packages\

I don't know why PYTHONPATH was set.  I cleared it but it made no difference -- 
same error.

--

___
Python tracker 

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



[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread STINNER Victor

STINNER Victor added the comment:

Marc-Andre Lemburg added the comment:
> I don't think rewriting party of site.py in C is a good idea. It's a rather 
> maintenance intense module.
>
> However, optimizing access is certainly something that's possible, e.g. by 
> placing the few variables that are actually needed by site.py into a 
> bootstrap module for sysconfig, which only contains the few variables needed 
> by interpreter startup.

Right, I don't propose to rewrite the 598 lines of site.py in C, but
only rewrite the parts which have a huge impact on the startup time.
It seems like the minimum part would be to write a _site module which
provide the 4 variables currently read from sysconfig.

I'm proposing to add a new private module because I don't want to
pollute site which already contains too many things.

I looked at site.py history: I don't see *major* changes last 2 years.
Only small enhancements, updates and fixes.

> Alternatively, sysconfig data could be made available via a C lookup 
> function; with the complete dictionary only being created on demand. 
> get_config_var() already is such a lookup API which could be used as 
> front-end.

I don't think that it's worth it to reimplement partially sysconfig in
C. This module is huge, complex, and platform dependant.

Well, I'm not sure about what is the best approach, but I'm sure that
we can do something to optimize site.py. 6 ms is a lot!

I never liked site.py. It seems like a huge workaround. I also dislike
having a different behaviour if site is imported or not.

That's why I asked Steve Dower to removing the code to create the
cpXXX alias for the mbcs codec from site.py to encodings/__init__.py:
see commit f5aba58480bb0dd45181f609487ac2ecfcc98673. I'm happy that
this code was removed from site.py!

--

___
Python tracker 

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



[issue25612] nested try..excepts don't work correctly for generators

2017-02-17 Thread Nathaniel Smith

Nathaniel Smith added the comment:

(Issue 29587 is a duplicate of this one, but it has some more information on 
where the !throwflag check came from and why it might be possible to remove it 
now.)

--

___
Python tracker 

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



[issue25612] nested try..excepts don't work correctly for generators

2017-02-17 Thread Nathaniel Smith

Nathaniel Smith added the comment:

I read the patch but I don't understand the logic behind it :-). Why should the 
value of tstate->exc_type affect whether we save/restore exc_info? Won't this 
mean that things are still broken for code like:

-
def f():
try:
raise KeyError
except Exception:
try:
yield
except Exception:
pass
raise

try:
raise NameError
except Exception:
gen = f()
gen.send(None)
gen.throw(ValueError)
-

?

Conceptually I would have thought the fix would be to remove the '!throwflag' 
check, but I haven't actually tried it...

--
nosy: +njs

___
Python tracker 

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



[issue29586] Cannot run pip in fresh install of py 3.5.3

2017-02-17 Thread Eryk Sun

Eryk Sun added the comment:

Please provide the complete traceback. Copy and paste it from the command 
prompt. Also, include the fully-qualified path for what "python" runs, e.g. run 
`where python` in the command prompt. Also, include the value of the 
environment variables PYTHONHOME and PYTHONPATH, e.g. run `echo %PYTHONHOME% & 
echo %PYTHONPATH%` in the command prompt.

--
nosy: +eryksun

___
Python tracker 

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



[issue25683] __context__ for yields inside except clause

2017-02-17 Thread Nathaniel Smith

Nathaniel Smith added the comment:

I disagree with the stated reason for closing this, because in general, 
implicit context chaining doesn't care about where the exception was 
instantiated, only where it was raised. For example:

-
err = ValueError()
try:
raise KeyError
except Exception:
raise err
-

Prints:

-
Traceback (most recent call last):
  File "/tmp/bar.py", line 3, in 
raise KeyError
KeyError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/bar.py", line 5, in 
raise err
ValueError
-

I would expect 'gen.throw(OBJ)' to be equivalent to doing 'raise OBJ' inside 
the generator, and raise does set __context__.

--
nosy: +njs

___
Python tracker 

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



[issue29587] Generator/coroutine 'throw' discards exc_info state, which is bad

2017-02-17 Thread Martin Panter

Martin Panter added the comment:

The second example seems like the original complaint in Issue 25612. That 
spawned a separate bug related to the first situation, which was later closed: 
Issue 25683.

--
nosy: +martin.panter
type:  -> behavior

___
Python tracker 

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



[issue29588] importing ssl can fail with NameError: name 'PROTOCOL_TLS' is not defined

2017-02-17 Thread Christian Heimes

Christian Heimes added the comment:

The _ssl extension module always defines and exports PROTOCOL_TLS. The name is 
always available. I guess you somehow mixed a new ssl.py with an old _ssl.so. 
Please verify that _ssl is correct and defines the name.

--

___
Python tracker 

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



[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

I don't think rewriting party of site.py in C is a good idea. It's a rather 
maintenance intense module.

However, optimizing access is certainly something that's possible, e.g. by 
placing the few variables that are actually needed by site.py into a bootstrap 
module for sysconfig, which only contains the few variables needed by 
interpreter startup.

Alternatively, sysconfig data could be made available via a C lookup function; 
with the complete dictionary only being created on demand. get_config_var() 
already is such a lookup API which could be used as front-end.

--
nosy: +lemburg

___
Python tracker 

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



[issue29588] importing ssl can fail with NameError: name 'PROTOCOL_TLS' is not defined

2017-02-17 Thread Jeroen Demeyer

New submission from Jeroen Demeyer:

This is a regression introduced in Python 2.7.13:

Importing the ssl module can fail with

>>> import ssl
Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/jdemeyer/sage/local/lib/python/ssl.py", line 133, in 
PROTOCOL_SSLv23 = PROTOCOL_TLS
NameError: name 'PROTOCOL_TLS' is not defined

While getting an ImportError from the ssl module is expected if SSL is not 
available (httplib for example handles that fine), a NameError is not.

--
assignee: christian.heimes
components: SSL
messages: 287989
nosy: christian.heimes, jdemeyer
priority: normal
severity: normal
status: open
title: importing ssl can fail with NameError: name 'PROTOCOL_TLS' is not defined
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



[issue29585] site.py imports relatively large `sysconfig` module.

2017-02-17 Thread INADA Naoki

INADA Naoki added the comment:

Christian: I'm using macOS on office and Linux on home.

sysconfig is imported even on Linux
https://github.com/python/cpython/blob/master/Lib/site.py#L247-L248
https://github.com/python/cpython/blob/master/Lib/site.py#L263-L271

--

___
Python tracker 

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



[issue29587] Generator/coroutine 'throw' discards exc_info state, which is bad

2017-02-17 Thread Nathaniel Smith

New submission from Nathaniel Smith:

Example 1:

---
def f():
try:
raise KeyError
except Exception:
yield

gen = f()
gen.send(None)
gen.throw(ValueError)
-

Output:
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 5, in f
ValueError

Expected output:

Something involving the string "During handling of the above exception, another 
exception occurred", and a traceback for the original KeyError.


Example 2:

---
import sys

def f():
try:
raise KeyError
except Exception:
print(sys.exc_info())
try:
yield
except Exception:
pass
print(sys.exc_info())
raise

gen = f()
gen.send(None)
gen.throw(ValueError)
---

Output:

(, KeyError(), )
(None, None, None)
Traceback (most recent call last):
  File "/tmp/foo.py", line 17, in 
gen.throw(ValueError)
  File "/tmp/foo.py", line 13, in f
raise
RuntimeError: No active exception to reraise

Expected output: certainly not that :-)


This seems to happen because normally, generators save the current exc_info 
when yielding, and then restore it when re-entered. But, if we re-enter through 
'throw' (throwflag is true), this is disabled:

https://github.com/python/cpython/blob/b2ee40ed9c9041dcff9c898aa19aacf9ec60308a/Python/ceval.c#L1027

This check seems to have been added in ae5f2f4a39e6a3f4c45e9dc95bd4e1fe5dfb60f2 
as a fix for:

https://bugs.python.org/issue7173

which had to do with a nasty situation involving a generator object that  was 
part of a reference cycle: the gc sometimes would free the objects stored in 
the generator's saved exc_info, and then try to clean up the generator by 
throwing in a GeneratorExit.

AFAICT this situation shouldn't be possible anymore thanks to PEP 442, which 
makes it so that finalizers are run before any part of the cycle is freed. And 
in any case it certainly doesn't justify breaking code like the examples above.

(Note: the examples use generators for simplicity, but of course the way I 
noticed this was that I had some async/await code where exceptions were 
mysteriously disappearing instead of showing up in __context__ and couldn't 
figure out why. It's likely that more people will run into this in the future 
as async/await becomes more widely used. As a workaround for now I'll probably 
modify my coroutine runner so that it never uses 'throw'.)

--
messages: 287987
nosy: njs
priority: normal
severity: normal
status: open
title: Generator/coroutine 'throw' discards exc_info state, which is bad
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



[issue29586] Cannot run pip in fresh install of py 3.5.3

2017-02-17 Thread Adrian Chan

New submission from Adrian Chan:

I uninstalled python 2.7 and 3.4, then performed a fresh install of 3.5.3.
Running pip with `python -m pip` as per https://docs.python.org/3.5/installing 
gives the following error:

C:\Python\Python35-32\python.exe: No module named pip.__main__; 'pip' is a 
package and cannot be directly executed

Installation details:
*  win 7 64 bit.
*  python 3.5.3 32 bit.
*  chose options for pip, tcl/tk/idle, test suite, py launcher, shortcuts, add 
to env, precompile std lib.
*  installed to non-standard directory.

--
assignee: docs@python
components: Documentation, Installation, Windows
messages: 287986
nosy: Adrian Chan, docs@python, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Cannot run pip in fresh install of py 3.5.3
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



  1   2   >