[issue29394] Cannot tunnel TLS connection through TLS connection

2017-01-30 Thread Maximilian Blochberger

New submission from Maximilian Blochberger:

I have the following scenario: Client → Proxy → Target.

The following two scenarios are working perfectly fine:

1) Establishing a TLS-secured connection to the proxy and then tunnel traffic 
through that connection to the target. This results in the proxy being able to 
observe and manipulate the traffic in both directions. It protects against an 
adversary who has no control over the proxy, e.g. it prevents observers from 
learning that you are using a proxy (if the IP/port is not known) and from 
reading the actual traffic.

2) Establish a non-secured connection to the proxy and then tunnel TLS-secured 
traffic through that connection to the target. That prevents the proxy from 
being able to observe or manipulate the traffic. Although an observer could 
learn that you are using a proxy and what target you are connecting to.

Now what I tried was to establish a TLS-secured connection to the proxy and 
then to establish a TLS-secured tunnel to the target, effectively resulting in 
two layers of TLS in between the client and the proxy. This would protect from 
an observer learning that you are using a proxy and where you connect to (the 
proxy still knows) but preventing the proxy from observing and manipulating the 
actual traffic to the target.

This does not work in Python 3.6. The TLS-secured connection to the proxy is 
straight forward and can be easily done with ssl.SSLContext.wrap_socket(). The 
TCP connection between the proxy and the target can then be established by 
issuing an HTTP CONNECT request. The response can than be read without closing 
the connection as done in http.client.HTTPConnection._tunnel(). Now my idea was 
to call ssl.SSLContext.wrap_socket() again (with a different context for the 
target) and send traffic through that. Unfortunately the TLS handshake fails 
with the error message "unknown protocol". I looked into the actual traffic 
transmitted and realised that the handshake was performed in plain text – so 
effectively stripping the TLS layer that was established already – which 
results in the proxy server not knowing how to handle the traffic (as it is not 
TLS-secured) aborting the connection (and reporting a fatal TLS alert).

This leads to the conclusion that another call to ssl.SSLContext.wrap_socket() 
will override a previous call of the same function (different context object 
though). I think this is unexpected behaviour.

It might be easier to handle such scenarios if a tunnel would be a separate 
http.client.HTTP(S)Connection object, see issue #24964. This would also allow 
to handle ssl-specific calls such as ssl.SSLSocket.getpeercert() as each layer 
probably uses different certificates.

--
assignee: christian.heimes
components: SSL
messages: 286517
nosy: Maximilian Blochberger, christian.heimes
priority: normal
severity: normal
status: open
title: Cannot tunnel TLS connection through TLS connection
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue28164] _PyIO_get_console_type fails for various paths

2017-01-30 Thread Steve Dower

Steve Dower added the comment:

I'm okay with this patch. We move closer to being right without degrading the 
normal case, and I don't think the edge cases are important (and the behavior 
in those cases will be acceptable).

With a couple of tests to make sure the path comparisons don't get broken in 
the future, this will be ready to merge.

--

___
Python tracker 

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



[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2017-01-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Mariatta, please review the rm-finite patch.  We're already agreed that the 
removal makes sense.  What you're checking for is whether patch is complete 
(that there aren't any dangling references to the removed code and that it 
doesn't remove too much).  Also, try out the patch and run the test suite in in 
a debug mode.  

Whether you find any issues or are ready to bless the patch, make a comment in 
the tracker and assign back to Martin (the core dev who posts the patch is 
usually the one to apply it).  After merging, he will mark the class as 
closed/rejected.

--
assignee:  -> Mariatta
nosy: +Mariatta

___
Python tracker 

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



[issue27200] make doctest in CPython has failures

2017-01-30 Thread Zachary Ware

Zachary Ware added the comment:

Raymond Hettinger wrote:
> Similarly, make sure that clarity and cut-and-pastability don't get lost by 
> adding ... PS2 prompts that uglify the examples.

Note that Sphinx adds a ">>>" button to the upper right of the example
that, when clicked, makes all of the prompts and output disappear so
that the code (and only the code) can be copied easily.  Not having
the ps2 prompts breaks that button.

--

___
Python tracker 

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



[issue15373] copy.copy() does not properly copy os.environment

2017-01-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

That patch would be fine except that I really agree with Antoine that an error 
should be raised.

--

___
Python tracker 

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



[issue29390] Python Tutorial should introduce iterators and generators

2017-01-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

IMO, the iterators are introduced at the correct point.  

There are many topics that one could argue should be introduced early, but of 
course they can't all go earlier (classes should be introduced earlier because 
everything in python is an object; namespaces should be introduced earlier 
because they are core concept that affects everything from function locals, to 
closures, classes, instances, and modules).

I concur with Jim that dropping more terminology earlier in the tutorial 
doesn't serve the user well.

--
nosy: +rhettinger
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue27200] make doctest in CPython has failures

2017-01-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Also, please make this 3.7 only.  There is no point in going back in time 
unless an example is found that is actually broken.

--
priority: normal -> low
versions:  -Python 2.7, Python 3.5, Python 3.6

___
Python tracker 

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



[issue27200] make doctest in CPython has failures

2017-01-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Mariatta, would you please add your review comments to the proposed patches.  
For the most part, we want the patches to make the minimal changes necessary to 
pass the doctests.  Also, clarity of the examples is more important than making 
the examples doctestable (i.e. perhaps added sorted() to the output makes it 
more predictable but it might also obfuscate the point being made).

In general, we would like to have the convenience of doc testing but should be 
unwilling to commit any atrocities along the way.  Ideally, the examples should 
be written in a way that doesn't garbage them up with  and whatnot 
(that is generally distracting to the reader and only serves doctest).  
Similarly, make sure that clarity and cut-and-pastability don't get lost by 
adding ... PS2 prompts that uglify the examples.  In all cases, the intent of 
the example writer and the clarity of the example takes precedence over the 
doctests.

You should try out the patches and make sure the tests run, build the docs and 
make sure the examples are clean looking from a user point of view. If you find 
any issues or have questions, use rietveld for discussion (that is the "review" 
link to the right of the patch).

--
assignee:  -> Mariatta
nosy: +Mariatta, rhettinger

___
Python tracker 

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



[issue29381] Tutorial documentation contains undefined reference to #!

2017-01-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I would only post this to 2.7, 3.6 and 3.7.   Also, no Misc/NEWS entry is 
needed.

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



[issue29381] Tutorial documentation contains undefined reference to #!

2017-01-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

It looks like everyone is happy and the patch is ready for Mariatta to apply.

The procedure is:
 $ hg pull -u
 $ hg diff  # Verify it has only your intended patch
 $ hg update 3.6
 $ cd Doc
 $ make html
 $ open build/html/index.html   # Now review generated HTML
 $ hg commit -m "Issue #29381: Clarify ordering of UNIX shebang line as source 
encoding line"
 $ hg update default
 $ hg merge 3.6
 $ hg diff  # Verify it has only your intended patch
 $ hg commit -m "merge"
 $ hg push

Then return to this issue, verify the bot has posted the commit.

Write a comment thanking the OP and reviewers.  Then mark the status as 
"closed" and resolution as "fixed".

--

___
Python tracker 

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



[issue28164] _PyIO_get_console_type fails for various paths

2017-01-30 Thread Eryk Sun

Eryk Sun added the comment:

I had reopened this issue with a suggestion for expanding the supported paths 
in msg276864, but it's languished for a while now. I've attached a patch 
implementing the change to _PyIO_get_console_type that I had suggested. Here 
are some example paths that this change enables (tested in Windows 10; need to 
check Windows 7):

\\.\conin$
\\.\conout$
\\.\con
//?/con
C:/Temp/con
C:/Temp/conout$
C:/Temp/conin$

Paths such as "C:/Temp/con" are recognized by first converting to a device path 
such as r"\\.\con". It's fine if the directory doesn't exist because CreateFile 
will fail anyway in that case.

This patch also fixes an error in handling the return value of _get_osfhandle 
when it fails. 

It also adds a couple checks to __init__ to provide a better error message when 
io._WindowsConsoleIO is called directly for some reason instead of via open(). 
If the console type can't be determined it should error out immediately instead 
of printing an unrelated error about not being able to open the input/output 
buffer.

--
keywords: +patch
Added file: http://bugs.python.org/file46461/issue_28164_01.patch

___
Python tracker 

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



[issue29393] Enabiling IPv6 by default

2017-01-30 Thread Cooper Lees

New submission from Cooper Lees:

Can we discuss the possibility of enabling IPv6 by default now during build. I 
think enough of the world now NEED IPv6 so people should all be building their 
Python with it.

--
components: Build
messages: 286506
nosy: cooperlees
priority: normal
severity: normal
status: open
title: Enabiling IPv6 by default
type: behavior
versions: Python 3.7

___
Python tracker 

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



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

2017-01-30 Thread Eric Lafontaine

Eric Lafontaine added the comment:

Hi all,

Here you go :).

Regards,
Eric Lafontaine

--
Added file: http://bugs.python.org/file46459/issue28879_v5.patch

___
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-01-30 Thread Eric Lafontaine

Eric Lafontaine added the comment:

Resent-heuristic

--
Added file: http://bugs.python.org/file46460/Resent_heuristic.patch

___
Python tracker 

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



[issue11549] Build-out an AST optimizer, moving some functionality out of the peephole optimizer

2017-01-30 Thread INADA Naoki

INADA Naoki added the comment:

@haypo, how do you think about ast.Lit and ast.Constant?
Is this patch updated to use ast.Constant?
Or ast.Constant should be used only for some transform like constant folding?

--
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



[issue29381] Tutorial documentation contains undefined reference to #!

2017-01-30 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks all for the feedback. I updated the patch.

Marco, IMO it's not necessary to update the PEP.
This section of the documentation serves as a tutorial for it, and the update 
in this patch clarifies the situation.

--
Added file: http://bugs.python.org/file46458/issue29381v3.patch

___
Python tracker 

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



[issue29392] msvcrt.locking crashes python

2017-01-30 Thread Eryk Sun

Changes by Eryk Sun :


--
stage:  -> needs patch
versions: +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



[issue29392] msvcrt.locking crashes python

2017-01-30 Thread Eryk Sun

Eryk Sun added the comment:

The old CRT doesn't do any parameter validation on the nbytes parameter. It 
just passes it directly to Windows LockFile as follows:

LockFile((HANDLE)_get_osfhandle(fh), lockoffset, 0L, nbytes, 0L)

which is locking (DWORD)-1 bytes, i.e. 0x. This allows users to 
sneakily lock more than 2 GiB by passing a negative value. Python could do its 
own validation in 2.7 to raise an exception for negative values, but I think 
it's too late; that ship has sailed. 

The parameter is validated by the new CRT in 3.5+, which limits nbytes to 
non-negative values. There we need the _Py_BEGIN_SUPPRESS_IPH and 
_Py_END_SUPPRESS_IPH macros to handle the failed call without crashing the 
process.

--
nosy: +eryksun

___
Python tracker 

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



[issue29392] msvcrt.locking crashes python

2017-01-30 Thread Frazer McLean

Frazer McLean added the comment:

I ran it on AppVeyor to double check, the crash appears from 3.5 onwards as I 
saw on my computer.

https://ci.appveyor.com/project/RazerM/issue29392/build/3

--

___
Python tracker 

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



[issue29391] Windows Defender finds trojan Spursint in Numpy for Py36 Win64

2017-01-30 Thread Eryk Sun

Changes by Eryk Sun :


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



[issue29377] Add the 'wrapper_descriptor' type to the types module

2017-01-30 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

Thank you!
The new patch LGTM.
(I combined two diffs in your patch into one so that it could be understood by 
Rietveld).

Guido, Yury, could one of you please take a look at this?

--
nosy: +yselivanov
Added file: http://bugs.python.org/file46457/combined-patch.diff

___
Python tracker 

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



[issue2771] Test issue

2017-01-30 Thread Ezio Melotti

Ezio Melotti added the comment:

test

--

___
Python tracker 

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



[issue29389] math.isclose signature contains incorrect start parameter

2017-01-30 Thread Ammar Askar

Changes by Ammar Askar :


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



[issue28231] zipfile does not support pathlib

2017-01-30 Thread Steve Dower

Steve Dower added the comment:

Speaking as a "regular user" who just ran into this, my main concern is that 
PathLike paths get used properly. For filenames being passed back out, if I 
really want them to be Path objects, I'll wrap them in Path() anyway.

Please don't let a full conversion to pathlib hold up fixing passing a PathLike 
into the constructor. That's the main use case, and given how nicely most of 
the rest of the stdlib handles Path objects now, it's an annoying wart.

--
nosy: +steve.dower

___
Python tracker 

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



[issue22594] Add a link to the regex module in re documentation

2017-01-30 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee: docs@python -> brett.cannon
nosy: +brett.cannon

___
Python tracker 

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



[issue29349] Update old Python 2 code in Docs/tools/extensions/patchlevel.py

2017-01-30 Thread Ned Deily

Ned Deily added the comment:

The fix looks good and the dmg buildbots are happy again.  Thanks, Martin and 
David.

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



[issue29392] msvcrt.locking crashes python

2017-01-30 Thread Frazer McLean

New submission from Frazer McLean:

On 3.5.2 and 3.5.3, but not 3.4.3 or 2.7.10 (Windows 64-bit), the third line 
causes Python to crash with exit code 0xC417.

import msvcrt
fp = open('file.txt', 'w')
msvcrt.locking(fp.fileno(), msvcrt.LK_NBLCK, -1)
print('End')

I came across this in the portalocker module. I don't think -1 is a valid third 
argument, but it doesn't raise an exception on Python 3.4 or 2.7.

--
components: Windows
messages: 286495
nosy: RazerM, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: msvcrt.locking crashes python
type: crash
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



[issue4630] IDLE: add cursor noblink option

2017-01-30 Thread Terry J. Reedy

Terry J. Reedy added the comment:

SO request for same: 
https://stackoverflow.com/questions/41937748/stop-cursor-blinking-in-idle.

--
assignee:  -> terry.reedy
versions: +Python 3.6, Python 3.7 -Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue29391] Windows Defender finds trojan Spursint in Numpy for Py36 Win64

2017-01-30 Thread Eric V. Smith

Eric V. Smith added the comment:

You should report this to the Numpy tracker. It's a third party package.

--
nosy: +eric.smith

___
Python tracker 

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



[issue29391] Windows Defender finds trojan Spursint in Numpy for Py36 Win64

2017-01-30 Thread Glenn Clark

New submission from Glenn Clark:

Windows Defender trojan Spursint Numpy Python3.6 Python 3.4 Win64

--
components: Windows
messages: 286492
nosy: Glenn Clark, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Windows Defender finds trojan Spursint in Numpy for Py36 Win64
type: security
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



[issue9914] trace/profile conflict with the use of sys.modules[__name__]

2017-01-30 Thread Davin Potts

Davin Potts added the comment:

Though this issue is specifically concerned with runpy APIs and their impact 
especially in running unittest test scripts, it's worth commenting here for 
people who need a workaround in the short term:  code such as that shared in 
http://stackoverflow.com/q/41892297/1878788 can be made to run happily by 
creating a second script which imports the first and simply runs the test(s) 
from there.

In the specific case of the 'forkiter.py' from 
http://stackoverflow.com/q/41892297/1878788, one would create a 
'run_my_tests.py' with the contents:

from forkiter import main

if __name__ == "__main__":
exit(main())





Now this invocation of cProfile runs happily because pickle is able to see the 
module where all the needed classes/functions were defined:
python3.6 -m cProfile -o forkiter.prof ./run_my_tests.py

--
nosy: +davin

___
Python tracker 

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



[issue27200] make doctest in CPython has failures

2017-01-30 Thread Marco Buttu

Marco Buttu added the comment:

Thanks Brett :-) Following the suggestion of Ezio to split the patch in more 
patches (msg284560), and according to msg284628, here is a first patch for just 
three files. To run their doctests:

$ sphinx-build -b doctest . build/doctest \
library/configparser.rst \
library/ctypes.rst \
library/copyreg.rst

--
Added file: http://bugs.python.org/file46456/configparser_ctypes_copyreg.patch

___
Python tracker 

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



[issue29377] Add the 'wrapper_descriptor' type to the types module

2017-01-30 Thread Manuel Krebber

Manuel Krebber added the comment:

Okay, I added MethodDescriptorType to the types module and updated the docs. 
Hope this is okay now.

--
Added file: http://bugs.python.org/file46455/slot-wrapper-types.patch

___
Python tracker 

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



[issue29381] Tutorial documentation contains undefined reference to #!

2017-01-30 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

Added a comment too. Other than that and the comment by Marco it looks fine to 
me too.

--

___
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-01-30 Thread Marco Buttu

Marco Buttu added the comment:

The patch LGTM. There is just one typo, I think (see review).

--
nosy: +marco.buttu

___
Python tracker 

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



[issue29390] Python Tutorial should introduce iterators and generators

2017-01-30 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

Typo, is *now* becoming :-)

--

___
Python tracker 

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



[issue29390] Python Tutorial should introduce iterators and generators

2017-01-30 Thread Jim Fasarakis-Hilliard

Jim Fasarakis-Hilliard added the comment:

What change do you have in mind for introducing these?

As for my personal opinion, dunno about this. I understand your concerns but 
dropping more terminology to a new learner early on wouldn't be the best idea 
in my view. 

>From what I am aware, Python is not becoming one of the *first* languages 
>people learn due to its friendly nature. Adding concepts like generators and 
>iterators when a new user is struggling with appends and mutability doesn't 
>seem like it would help. 

BTW, iterators and generators are discussed in the Classes section of the 
tutorial, don't you think this suffices?

--
nosy: +Jim Fasarakis-Hilliard

___
Python tracker 

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



[issue9914] trace/profile conflict with the use of sys.modules[__name__]

2017-01-30 Thread bli

bli added the comment:

Just to report that this bug seems responsible for failures at cProfiling some 
code using multiprocessing:

http://stackoverflow.com/q/41892297/1878788
http://stackoverflow.com/q/11512499/1878788

--
nosy: +bli

___
Python tracker 

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



[issue29283] duplicate README in site-packages

2017-01-30 Thread Berker Peksag

Changes by Berker Peksag :


--
components:  -Installation

___
Python tracker 

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



[issue29283] duplicate README in site-packages

2017-01-30 Thread Berker Peksag

Changes by Berker Peksag :


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



[issue29283] duplicate README in site-packages

2017-01-30 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 23fcc0e51510 by Berker Peksag in branch '3.6':
Issue #29283: Delete accidentally added Lib/site-packages/README
https://hg.python.org/cpython/rev/23fcc0e51510

New changeset 3d328ee18612 by Berker Peksag in branch 'default':
Issue #29283: Merge from 3.6
https://hg.python.org/cpython/rev/3d328ee18612

--
nosy: +python-dev

___
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-01-30 Thread Berker Peksag

Berker Peksag added the comment:

Thanks for the report, Nathaniel. I agree that the documentation could be 
improved. Here is a patch. I also moved the constant table to epoll.register() 
documentation (it's already done in 
https://docs.python.org/3.7/library/select.html#polling-objects)

It would be great if you could review the patch, thanks!

--
keywords: +patch
nosy: +berker.peksag
stage:  -> patch review
type:  -> enhancement
Added file: http://bugs.python.org/file46454/issue29247.diff

___
Python tracker 

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



[issue29381] Tutorial documentation contains undefined reference to #!

2017-01-30 Thread Marco Buttu

Marco Buttu added the comment:

The patch LGTM. I think there is just one type (see review). 

By the way, looking at the PEP 0263, the sentence "To define a source code 
encoding, a magic comment must be placed into the source files either as first 
or second line in the file" actually is not true. Also because I did not see 
any point in the PEP that clarifies that the fist line has to be a comment. 
Maybe it could be deduced by the examples (all using the shebang), but maybe 
not, and the user could think this is a valid declaration:

print('très jolie')
# -*- coding: ascii -*-

If you think is worth to clarify, I open an issue with a patch for the PEP 0263.

--

___
Python tracker 

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



[issue29390] Python Tutorial should introduce iterators and generators

2017-01-30 Thread Michael Kesper

New submission from Michael Kesper:

Please look at 
http://stackoverflow.com/questions/41932287/how-can-i-create-a-loop-for-these-if-statements/41932494?noredirect=1#41932494
 

For beginners, it would be good to introduce the concepts of 'pythonic' dealing 
with sequences (iterators) and streams (generators) as soon as possible and 
everywhere where sequenceable data structures are discussed.

It is a common idiom in other languages to access members of sequences with 
counters, risking off-by-one errors or IndexErrors.

If beginners aren't introduced to the 'right' concepts soon enough, they might 
have a hard time figuring out the 'iterator' way.
Iterators should at least be mentioned in 
https://docs.python.org/3/tutorial/datastructures.html#looping-techniques.

--
assignee: docs@python
components: Documentation
messages: 286480
nosy: docs@python, mkesper
priority: normal
severity: normal
status: open
title: Python Tutorial should introduce iterators and generators
type: enhancement

___
Python tracker 

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



[issue29386] select.epoll.poll may behave differently if timeout = -1 vs timeout = None

2017-01-30 Thread Gabriel McManus

Gabriel McManus added the comment:

As mentioned in [1], Illumos will be fixed to match Linux's behaviour, so this 
problem will go away. It may still be worth changing epoll to just send -1 
though, in case this causes similar issues in other operating systems.

[1] https://github.com/joyent/illumos-joyent/issues/136

--

___
Python tracker 

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



[issue29328] struct module should support variable-length strings

2017-01-30 Thread Mark Dickinson

Changes by Mark Dickinson :


--
stage:  -> needs patch

___
Python tracker 

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



[issue29389] math.isclose signature contains incorrect start parameter

2017-01-30 Thread Shmuel Amar

Shmuel Amar added the comment:

ok thanks i think it can be closed

--

___
Python tracker 

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



[issue29389] math.isclose signature contains incorrect start parameter

2017-01-30 Thread Mark Dickinson

Mark Dickinson added the comment:

I think you're misreading the signature. The '*' is not a parameter in its own 
right; it's a piece of syntax marking the end of the positional parameters. 
Everything following that can only be passed by keyword.  See PEP 3102 for an 
explanation of the syntax.

--
nosy: +mark.dickinson

___
Python tracker 

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



[issue18842] Add float.is_finite is_nan is_infinite to match Decimal methods

2017-01-30 Thread Mark Dickinson

Mark Dickinson added the comment:

rm-finite.patch LGTM.

Once that's merged, let's close this issue as rejected. If decimal is ever 
added as a first-class type (literal support, fixed-width decimal128 or 
decimal64, etc.), we may want to reconsider, but that day is probably a long 
way off.

--

___
Python tracker 

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



[issue29389] math.isclose signature contains incorrect start parameter

2017-01-30 Thread Shmuel Amar

Shmuel Amar added the comment:

documentation of math.isclose() signature on 
https://docs.python.org/3/library/math.html#math.isclose is as follows:

math.isclose(a, b, *, rel_tol=1e-09, abs_tol=0.0)

the third star '*' argument is not allowed inside the function: 
https://hg.python.org/cpython/file/tip/Modules/clinic/mathmodule.c.h#l511

or mentioned in PEP485 here: 
https://www.python.org/dev/peps/pep-0485/#implementation

and does not work when trying provide more than 2 positional values:

>>> import math
>>> math.isclose(1,2,3, rel_tol=5.)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: Function takes at most 2 positional arguments (3 given)

So IMHO to solve this remove the positional argument on the signature of 
isclose() as it misleading.

--

___
Python tracker 

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



[issue29389] math.isclose signature contains incorrect start parameter

2017-01-30 Thread Shmuel Amar

New submission from Shmuel Amar:

documentation of math.isclose() signature on 
https://docs.python.org/3/library/math.html#math.isclose is as follows:

math.isclose(a, b, *, rel_tol=1e-09, abs_tol=0.0)

the third star '*' argument is not allowed inside the function: 
https://hg.python.org/cpython/file/tip/Modules/clinic/mathmodule.c.h#l511

or mentioned in PEP485 here: 
https://www.python.org/dev/peps/pep-0485/#implementation

and does not work when trying provide more than 2 positional values:

>>> import math
>>> math.isclose(1,2,3, rel_tol=5.)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: Function takes at most 2 positional arguments (3 given)

So IMHO to solve this remove the positional argument on the signature of 
isclose() as it misleading.

--
assignee: docs@python
components: Documentation
messages: 286474
nosy: Shmuel Amar, docs@python
priority: normal
severity: normal
status: open
title: math.isclose signature contains incorrect start parameter
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