[issue36230] Please sort assertSetEqual's output

2019-03-07 Thread Windson Yang


Change by Windson Yang :


--
versions: +Python 2.7, 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



[issue36230] Please sort assertSetEqual's output

2019-03-07 Thread Windson Yang


Windson Yang  added the comment:

Just to be clear, as Raymond said, when we have two non-sortable objects (for 
instance, two instances which their class didn't implement the __lt__ and 
__gt__ methods), we should compare their repr() without sort() like now.

--
nosy: +Windson Yang

___
Python tracker 

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



[issue36228] Support coercion of complex to float/int

2019-03-07 Thread Марат Нагаев

Марат Нагаев  added the comment:

I think math.floor should raise TypeError if complex argument passed,
but we need cmath.floor(and ceil).
As I know floor complex number is just floor real part and floor imag.
Example:
z=1.1+2.5j
floor(z) #2+3j
I think it's correct.
But I don't know about complex to float and to int.
Maybe you are right

--

___
Python tracker 

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



[issue36230] Please sort assertSetEqual's output

2019-03-07 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> I think it should require only a a sort 

It's possible to have non-sortable elements in the set, so you'll either need 
to sort on the repr of the elements or have a fallback:

assertSetEqual({10, None, 'abc'}, {20, 3+4j, 10})

--
assignee:  -> michael.foord
nosy: +rhettinger

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2019-03-07 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +12218

___
Python tracker 

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



[issue36227] Add default_namespace argument to xml.etree.ElementTree.tostring()

2019-03-07 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +eli.bendersky, scoder, serhiy.storchaka

___
Python tracker 

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



[issue35967] Better platform.processor support

2019-03-07 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
keywords: +patch
pull_requests: +12217
stage:  -> patch review

___
Python tracker 

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



[issue35967] Better platform.processor support

2019-03-07 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
assignee:  -> jaraco
versions: +Python 3.8

___
Python tracker 

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



[issue36230] Please sort assertSetEqual's output

2019-03-07 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +ezio.melotti, michael.foord, rbcollins

___
Python tracker 

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



[issue35435] Discourage external links to old docs.

2019-03-07 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

James Lu today posted to python-ideas
'Make Python 2.7’s online docs optionally redirect to  Python 3 online docs'

Andra Roberge: There exists browser extensions that do this:
https://addons.mozilla.org/en-US/firefox/addon/py3direct/
https://chrome.google.com/webstore/detail/py3redirect/codfjigcljdnlklcaopdciclmmdandig?hl=en

Steven D'Aprano pointed to this issue and gave some 3 first and 2 first 
examples.  I discovered that the only first page 3.x link for me for
https://www.startpage.com/do/search?q=python+docs+netrc
only points
to https://docs.python.org/3.1/library/netrc.html
with no clicky way to get to the current .../3/..., so we still need links 
added.

Julien, do we still need this issue open, or is this superceded by
https://github.com/python/python-docs-theme/issues/24 ?

--

___
Python tracker 

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



[issue36230] Please sort assertSetEqual's output

2019-03-07 Thread Jess


Jess  added the comment:

Wow!  Thank you, very fast and the precise snippet of info I needed.  Will try 
to send something off today.  Very exciting.

--

___
Python tracker 

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



[issue33944] Deprecate and remove pth files

2019-03-07 Thread Thomas Kluyver


Thomas Kluyver  added the comment:

As a lurker on this issue: I think a lot of energy is being expended arguing 
about what is and isn't legitimate use cases, when there's actually more stuff 
that people agree about than not.

I think this issue should be broken down into two, neither of which will 
actually result in removing pth files:

1. Better ways to inspect and control the sys.path extension feature (as per 
Barry's message https://bugs.python.org/issue33944#msg337417 ).
2. Designing a replacement for the arbitrary-code-at-startup feature (or even 
several replacements to meet different needs), leading to its eventual 
deprecation.

If you like the ability for packages to install interpreter-startup hooks, then 
pth files are an ugly way to do it. If you don't, then you want better ways to 
control it. So let's see what we can come up with.

At least several important use cases (coverage and debugging) would probably 
work with an environment variable to specify startup code. The coverage hooks 
already check an environment variable themselves, so it's clearly a control 
mechanism that works. It's also familiar from things like LD_PRELOAD that 
environment variables can affect code in powerful ways.

But the PYTHONSTARTUP variable is not suitable for this, because it only 
affects interactive shell sessions. So maybe one useful step would be to 
specify a new environment variable, maybe PYTHONPRELOAD, and figure out how it 
will interact with all the other options.

Then we can re-evaluate the use cases Anthony described 
(https://bugs.python.org/issue33944#msg337406 ) and debate the need for other 
startup-code mechanisms to go along with that.

--

___
Python tracker 

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



[issue35975] Put back the ability to parse files where async/await aren't keywords

2019-03-07 Thread Guido van Rossum


Change by Guido van Rossum :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue36230] Please sort assertSetEqual's output

2019-03-07 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

Hi Jess, I think this could be added.

I think it should require only a a sort in 
https://github.com/python/cpython/blob/0f221d09cad46bee38d1b7a7822772df66c53028/Lib/unittest/case.py#L1127-L1138,
 to update the tests and add a blurb.

You will need to get Python source code at https://github.com/python/cpython 
and you can get information about how to contribute to Python in the dev guide 
: https://devguide.python.org/

If you need help, I would be happy to assist you and to review your pull 
request.

If you don't have time to work on this issue, I think we could keep it for the 
next mentored sprint.

--
components: +Library (Lib) -Tests
nosy: +remi.lapeyre
versions: +Python 3.8

___
Python tracker 

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



[issue36226] multipart/related header causes false positive StartBoundaryNotFoundDefect and MultipartInvariantViolationDefect

2019-03-07 Thread Martin Panter


Martin Panter  added the comment:

Probably the same as Issue 29353. I remember than enabling "headersonly" can 
create inconsistencies in the message object. But I don't remember the details.

According to Issue 29991 (another duplicate), my patch for Issue 24363 might 
help. But I don't think I got much enthusiasm reviewing that (and I don't have 
time to spend on it now).

--
nosy: +martin.panter

___
Python tracker 

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



[issue36230] Please sort assertSetEqual's output

2019-03-07 Thread Jess


New submission from Jess :

Currently 
https://docs.python.org/2/library/unittest.html#unittest.TestCase.assertSetEqual
 returns a random list, but I'd like to see it sorted for ease of reading which 
running tests.

Should be small, but useful.  Happy to make the edit myself, but have no clue 
how to send you changes.

--
components: Tests
messages: 337443
nosy: Jess
priority: normal
severity: normal
status: open
title: Please sort assertSetEqual's output
type: enhancement

___
Python tracker 

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



[issue36229] Linear-time ops for some mutable collections.

2019-03-07 Thread Brandt Bucher


New submission from Brandt Bucher :

Binary operations on collections are, in general, of quadratic complexity. 
However, we can sometimes operate in-place if we know that we hold the only 
reference to the object. This allows us to avoid making many intermediate 
copies when summing many lists (or dicts ;), taking the union of many sets, or 
working with literals.

The attached PR adds a simple 2-line refcount check which delegates to the 
corresponding in-place operation for: list_concat, list_repeat, set_and, 
set_or, set_xor, set_sub, bytearray_concat, and bytearray_repeat.

--
components: Interpreter Core
messages: 337442
nosy: brandtbucher
priority: normal
severity: normal
status: open
title: Linear-time ops for some mutable collections.
type: performance
versions: Python 3.8

___
Python tracker 

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



[issue36229] Linear-time ops for some mutable collections.

2019-03-07 Thread Brandt Bucher


Change by Brandt Bucher :


--
keywords: +patch
pull_requests: +12216
stage:  -> patch review

___
Python tracker 

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



[issue36228] Support coercion of complex to float/int

2019-03-07 Thread Mark Dickinson


Mark Dickinson  added the comment:

Agreed with the closure.

--

___
Python tracker 

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



[issue36228] Support coercion of complex to float/int

2019-03-07 Thread Zachary Ware


Zachary Ware  added the comment:

Agreed with Josh and closing the issue as rejected.  I'm adding our math 
experts just in case they disagree or want to provide further clarity.

--
components: +Interpreter Core -Extension Modules, Library (Lib)
nosy: +lemburg, mark.dickinson, rhettinger, stutzbach, zach.ware
resolution:  -> rejected
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



[issue33944] Deprecate and remove pth files

2019-03-07 Thread Steve Dower

Steve Dower  added the comment:

> You mean extra junk like .pth files? I don't see the difference between a .py 
> file and a .pth file, except I can’t opt out of .pth files.

And you get multiple lines of code, and syntax highlighting, and linting, and 
all the other goodness in a genuine source file :)

--

___
Python tracker 

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



[issue36228] Support coercion of complex to float/int

2019-03-07 Thread Josh Rosenberg


Change by Josh Rosenberg :


--
title: Add function to complex object -> Support coercion of complex to 
float/int

___
Python tracker 

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



[issue36228] Add function to complex object

2019-03-07 Thread Josh Rosenberg


Josh Rosenberg  added the comment:

They already have a .real attribute to extract the real part, which you can 
call int on. I suspect the lack of support for float/int coercion is 
intentional; coercing float to int loses precision, but it's still a 
fundamentally similar value. Implicitly dropping the imaginary component of a 
complex number isn't just losing precision, it's fundamentally altering the 
value (in a way that isn't necessarily obvious).

Similarly, there is no meaningful concept of floor/ceil for complex ( 
https://math.stackexchange.com/q/2095674/332927 ), so implementing it would 
involve the same data loss as float/int coercion.

complex numbers are complex, and silently ignoring that just makes it easier to 
write incorrect code. People can do whatever they want with .real explicitly, 
but we shouldn't be helping them make mistakes.

--
nosy: +josh.r

___
Python tracker 

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



[issue30831] Inconsistent or wrong documentation around Asynchronous Context Manager

2019-03-07 Thread Yury Selivanov


Yury Selivanov  added the comment:

I also recommend reading this page 
https://docs.python.org/3/library/asyncio-task.html to get a better grasp on 
coroutines and how they are evaluated.

--

___
Python tracker 

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



[issue33944] Deprecate and remove pth files

2019-03-07 Thread Eric V. Smith

Eric V. Smith  added the comment:

>> I should have to start that package somehow.
>
> `pip install` is a pretty good opt-in already imo

I think that’s where we disagree. Like others, I don’t want this to affect 
every python script in a given installation. 

>> Instead of just shipping "my_module.foo", you ship "my_module.py" and 
>> "_my_module.foo", where "my_module.py" looks like:
>
> but that's exactly my point, now you have to ship extra junk python files 
> when it's a way better experience to have the hooks _just work_


You mean extra junk like .pth files? I don’t see the difference between a .py 
file and a .pth file, except I can’t opt out of .pth files. 

We’re just looking for some way to control the behavior, without giving the 
.pth file unlimited capabilities before the user script starts. If it’s “just” 
some extra .py files, then maybe that’s great. If we need some other new 
mechanism, then I’d be okay with that, too.

--

___
Python tracker 

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



[issue30831] Inconsistent or wrong documentation around Asynchronous Context Manager

2019-03-07 Thread Yury Selivanov


Yury Selivanov  added the comment:

There's no inconsistency here and the docs are correct.

If you have a function:

  async def foo():
pass

Then "foo()" call returns a "coroutine", which is an awaitable.  So

  async def __aenter__():
...

always returns an awaitable (regardless if there's a return statement or not).


> On the other hand, actual CPython implementation won't do that; it won't 
> await the returned objects.

If always does await the returned object.

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



[issue35975] Put back the ability to parse files where async/await aren't keywords

2019-03-07 Thread miss-islington


miss-islington  added the comment:


New changeset 495da292255b92dd73758fdd0e4c7d27d82b1e57 by Miss Islington (bot) 
(Guido van Rossum) in branch 'master':
bpo-35975: Support parsing earlier minor versions of Python 3 (GH-12086)
https://github.com/python/cpython/commit/495da292255b92dd73758fdd0e4c7d27d82b1e57


--
nosy: +miss-islington

___
Python tracker 

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



[issue30831] Inconsistent or wrong documentation around Asynchronous Context Manager

2019-03-07 Thread Andrés Delfino

Change by Andrés Delfino :


--
nosy: +adelfino, yselivanov
versions: +Python 3.8

___
Python tracker 

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



[issue36228] Add function to complex object

2019-03-07 Thread Марат Нагаев

Change by Марат Нагаев :


--
title: Add function to complex objectf -> Add function to complex object

___
Python tracker 

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



[issue36228] Add function to complex objectf

2019-03-07 Thread Марат Нагаев

New submission from Марат Нагаев :

I think complex object should have methods __float__ (returns real part) and 
__int__ (returns int(real)).
Also I think we need floor and ceil methods om cmath module.
I think, these functions are useful.

--
components: Extension Modules, Library (Lib)
messages: 337431
nosy: nagayev
priority: normal
severity: normal
status: open
title: Add function to complex objectf
versions: Python 3.8

___
Python tracker 

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



[issue36078] argparse: positional with type=int, default=SUPPRESS raise ValueError

2019-03-07 Thread paul j3


Change by paul j3 :


--
priority: normal -> high

___
Python tracker 

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



[issue33944] Deprecate and remove pth files

2019-03-07 Thread Steve Dower


Steve Dower  added the comment:

Nonetheless, it's still something that we could support better. If telling 
someone to set PYTHONSTARTUP is too hard, then we can design another way that 
can work well without relying on a barely documented (mis)feature.

As one idea, we could add a way to register new -X options that would translate 
into an import/function call after doing site, which then means you could do 
"python -X coverage ..." and if you don't then you don't get code injected at 
all, regardless of bugs in any libraries you've installed.

--

___
Python tracker 

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



[issue36140] An incorrect check in _msi.c's msidb_getsummaryinformation()

2019-03-07 Thread Steve Dower


Change by Steve Dower :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue36227] Add default_namespace argument to xml.etree.ElementTree.tostring()

2019-03-07 Thread Bernt Røskar Brenna

Change by Bernt Røskar Brenna :


--
keywords: +patch
pull_requests: +12215
stage:  -> patch review

___
Python tracker 

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



[issue36219] Add edit option in IDLE to convert smart quotes to ascii quotes

2019-03-07 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

Would it be worthwhile to automatically convert the text when it's being pasted 
or would there be a scenario where it would be desirable to keep these 
characters in the text?  It seems the point here is that the user wouldn't even 
realize that the quotes (or dashes) being copied aren't the right ones and they 
would have to learn to take the extra step of formatting the text.  That seems 
annoying, so maybe automatic conversion would eliminate that?

For the menu option route, in the editor there is an additional 'Format' menu 
which has some text manipulation options, but the Shell doesn't have this menu 
available.  There isn't any formatting options on the 'Edit' menu currently.  
Would it be better to add a 'Format' menu to the Shell or have this on the 
'Edit' menu (which is already getting long)?

For the actual text conversion, I pasted some smart quotes on Windows and it 
pasted as \u2018\u2018 (two single left quotations marks) and \u2019\u2019 (two 
single right quotation marks) instead of \u201C (double left) and \u201D 
(double right). \u0060 (grave accent) and \u00B4 (acute accent) also seem to be 
possible values that are used for quotes, although converting them 
automatically may be more problematic.

I think for starters the idea would be:
text.replace('\u2018\u2018', '"')  
text.replace('\u2019\u2019', '"')  
text.replace('\u2018, "'")
text.replace('\u2019, "'")
text.replace('\u201C, '"')
text.replace('\u201D, '"')

The dash may be more complicated since there are more of them.  Unless the 
category could be used.

--
nosy: +cheryl.sabella

___
Python tracker 

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



[issue36227] Add default_namespace argument to xml.etree.ElementTree.tostring()

2019-03-07 Thread Bernt Røskar Brenna

New submission from Bernt Røskar Brenna :

default_namespace is often used when serializing ET elements. tostring() is 
mainly a wrapper around ElementTree.write(), and it is therefore natural that 
it mirrors write's argument. tostring() already passes encoding, method and 
short_empty_elements to write.

--
components: Library (Lib)
messages: 337428
nosy: Bernt.Røskar.Brenna
priority: normal
severity: normal
status: open
title: Add default_namespace argument to xml.etree.ElementTree.tostring()
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue33944] Deprecate and remove pth files

2019-03-07 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

On Mar 7, 2019, at 10:46, Ionel Cristian Mărieș  wrote:
> 
> There's a simple `if 'COVSOMETHING' in os.environ` check to activate it.
> That can't cost a significant amount of time. This is rather another bad
> actor argument.

You’re overlooking the significant cost of loading the module that does the 
check in the first place.

--

___
Python tracker 

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



[issue33944] Deprecate and remove pth files

2019-03-07 Thread Ionel Cristian Mărieș

Ionel Cristian Mărieș  added the comment:

What module? That check should be done directly in the pth file.

--

___
Python tracker 

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



[issue36140] An incorrect check in _msi.c's msidb_getsummaryinformation()

2019-03-07 Thread miss-islington


miss-islington  added the comment:


New changeset b19943ec97b80db97dd93ed714615f757cc12ad3 by Miss Islington (bot) 
in branch '2.7':
bpo-36140: Fix an incorrect check in msidb_getsummaryinformation() (GH-12074)
https://github.com/python/cpython/commit/b19943ec97b80db97dd93ed714615f757cc12ad3


--

___
Python tracker 

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



[issue33944] Deprecate and remove pth files

2019-03-07 Thread Ionel Cristian Mărieș

Ionel Cristian Mărieș  added the comment:

> because you’re on the same machine and you pip installed it, I have no
> choice but to pay those costs, which I haven’t explicitly opted in to.
>
> At least for the coverage plugins there is a required opt in from
> environment variable (as shown above).

There's a simple `if 'COVSOMETHING' in os.environ` check to activate it.
That can't cost a significant amount of time. This is rather another bad
actor argument.

--

___
Python tracker 

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



[issue36140] An incorrect check in _msi.c's msidb_getsummaryinformation()

2019-03-07 Thread miss-islington


miss-islington  added the comment:


New changeset 6ba95c38c556ad4d254c5af34f439a1307ed585c by Miss Islington (bot) 
in branch '3.7':
bpo-36140: Fix an incorrect check in msidb_getsummaryinformation() (GH-12074)
https://github.com/python/cpython/commit/6ba95c38c556ad4d254c5af34f439a1307ed585c


--
nosy: +miss-islington

___
Python tracker 

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



[issue33944] Deprecate and remove pth files

2019-03-07 Thread Brett Cannon

Brett Cannon  added the comment:

RE: " So basically you'd remove the whole feature just cause one package no
one installs abuses it. Doesn't make sense."

No, the point being made is *at least* one package that was found on PyPI
is abusing it, so it exists and we need to consider the possibility others
are also abusing the feature.

On Thu, Mar 7, 2019 at 10:22 AM Anthony Sottile 
wrote:

>
> Anthony Sottile  added the comment:
>
> >>> I should have to start that package somehow.
> >>
> >> `pip install` is a pretty good opt-in already imo
> >
> > Except that it conflates responsibilities.  I may not want to opt into
> coverage even being loaded in my application because I’m not going to use
> it and it has a negative impact on my application’s start up time.  Yet
> because you’re on the same machine and you pip installed it, I have no
> choice but to pay those costs, which I haven’t explicitly opted in to.
>
> At least for the coverage plugins there is a required opt in from
> environment variable (as shown above).

For the ones you know about. Dealing with abuse of functionality isn't
about what common practice is, but what a bad actor may do.

> Though the startup cost is a good point.  Perhaps I'm of the minority but
> I use virtualenvs for everything so I haven't even been considering the
> system python.
>

Trust me, from my perspective of the Python extension for VS Code you
cannot ignore system installs.

--

___
Python tracker 

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



[issue36216] urlsplit does not handle NFKC normalization

2019-03-07 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +12214

___
Python tracker 

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



[issue36216] urlsplit does not handle NFKC normalization

2019-03-07 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +12213

___
Python tracker 

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



[issue33944] Deprecate and remove pth files

2019-03-07 Thread Anthony Sottile

Anthony Sottile  added the comment:

>>> I should have to start that package somehow.
>> 
>> `pip install` is a pretty good opt-in already imo
>
> Except that it conflates responsibilities.  I may not want to opt into 
> coverage even being loaded in my application because I’m not going to use it 
> and it has a negative impact on my application’s start up time.  Yet because 
> you’re on the same machine and you pip installed it, I have no choice but to 
> pay those costs, which I haven’t explicitly opted in to.

At least for the coverage plugins there is a required opt in from environment 
variable (as shown above).  Though the startup cost is a good point.  Perhaps 
I'm of the minority but I use virtualenvs for everything so I haven't even been 
considering the system python.

--

___
Python tracker 

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



[issue36140] An incorrect check in _msi.c's msidb_getsummaryinformation()

2019-03-07 Thread Steve Dower


Steve Dower  added the comment:

Thanks for the patch! Once the backports merge, I (or someone else) will close 
the issue.

--

___
Python tracker 

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



[issue36140] An incorrect check in _msi.c's msidb_getsummaryinformation()

2019-03-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12211

___
Python tracker 

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



[issue36140] An incorrect check in _msi.c's msidb_getsummaryinformation()

2019-03-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12212

___
Python tracker 

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



[issue36140] An incorrect check in _msi.c's msidb_getsummaryinformation()

2019-03-07 Thread Steve Dower


Steve Dower  added the comment:


New changeset bf94cc7b496a379e1f604aa2e4080bb70ca4020e by Steve Dower (Zackery 
Spytz) in branch 'master':
bpo-36140: Fix an incorrect check in msidb_getsummaryinformation() (GH-12074)
https://github.com/python/cpython/commit/bf94cc7b496a379e1f604aa2e4080bb70ca4020e


--

___
Python tracker 

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



[issue33944] Deprecate and remove pth files

2019-03-07 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

On Mar 7, 2019, at 09:32, Anthony Sottile  wrote:
> 
>> I should have to start that package somehow.
> 
> `pip install` is a pretty good opt-in already imo

Except that it conflates responsibilities.  I may not want to opt into coverage 
even being loaded in my application because I’m not going to use it and it has 
a negative impact on my application’s start up time.  Yet because you’re on the 
same machine and you pip installed it, I have no choice but to pay those costs, 
which I haven’t explicitly opted in to.

--

___
Python tracker 

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



[issue33944] Deprecate and remove pth files

2019-03-07 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

On Mar 7, 2019, at 07:38, Steve Dower  wrote:
> 
> Steve Dower  added the comment:
> 
> There are two features here, let's be clear about what we're removing.
> 
> * extending sys.path with static (perhaps relative) directories
> * arbitrary code execution (following "import " statements)
> 
> Only Barry wants to remove the first one, and the rest of us will push back 
> hard enough to keep him in check ;)

Not true!  I’m okay with keeping the path extension feature, albeit with 
improvements:

* Loading of .pth files and path extension should be expressed in verbose 
(`python -v`) output
* It should be possible to much more easily debug .pth file loading (I believe 
there is a PR for this but
  I haven’t had time to look at it yet)
* It should be possible to prevent .pth file loading, likely via interpreter 
switch or environment
  variable, akin to -s/-S

--

___
Python tracker 

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



[issue36108] Avoid failing the build on race condition in clean

2019-03-07 Thread miss-islington


miss-islington  added the comment:


New changeset 34b398559fc47745473a39313a9e2ec17fe1d9ad by Miss Islington (bot) 
in branch '3.7':
bpo-36108: Avoid failing the build on race condition in clean (GH-12217)
https://github.com/python/cpython/commit/34b398559fc47745473a39313a9e2ec17fe1d9ad


--
nosy: +miss-islington

___
Python tracker 

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



[issue33944] Deprecate and remove pth files

2019-03-07 Thread Anthony Sottile


Anthony Sottile  added the comment:

> What I'm dismissing is that "pip install some-package" can define a global 
> startup task for your interpreter. I shouldn't get debugging or code coverage 
> enabled every time I run "python" just because I installed some package

At least for the coverage tools they all play nice and require an environment 
variable to be set for them to take.  For example, `coverage-enable-subprocess` 
requires `COVERAGE_PROCESS_START=...` in order to start: 
https://github.com/bukzor/coverage_enable_subprocess/blob/9a0f4df99f0d008eba305c673dfae4269c6c5642/setup.py#L14

> I should have to start that package somehow.

`pip install` is a pretty good opt-in already imo

> Instead of just shipping "my_module.foo", you ship "my_module.py" and 
> "_my_module.foo", where "my_module.py" looks like:

but that's exactly my point, now you have to ship extra junk python files when 
it's a way better experience to have the hooks _just work_

--

___
Python tracker 

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



[issue8075] Windows (Vista/7) install error when choosing to compile .py files

2019-03-07 Thread Steve Dower


Change by Steve Dower :


--
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

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



[issue35978] test_venv fails in Travis with GCC

2019-03-07 Thread Steve Dower


Change by Steve Dower :


--
keywords: +patch
pull_requests: +12210
stage:  -> patch review

___
Python tracker 

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



[issue36108] Avoid failing the build on race condition in clean

2019-03-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12209

___
Python tracker 

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



[issue36108] Avoid failing the build on race condition in clean

2019-03-07 Thread Steve Dower


Change by Steve Dower :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue36108] Avoid failing the build on race condition in clean

2019-03-07 Thread Steve Dower


Steve Dower  added the comment:


New changeset 2f8f56499c20af70ff5037fdbc5d738e56d9eab0 by Steve Dower in branch 
'master':
bpo-36108: Avoid failing the build on race condition in clean (GH-12217)
https://github.com/python/cpython/commit/2f8f56499c20af70ff5037fdbc5d738e56d9eab0


--

___
Python tracker 

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



[issue36216] urlsplit does not handle NFKC normalization

2019-03-07 Thread Steve Dower


Steve Dower  added the comment:


New changeset e37ef41289b77e0f0bb9a6aedb0360664c55bdd5 by Steve Dower in branch 
'2.7':
bpo-36216: Add check for characters in netloc that normalize to separators 
(GH-12201)
https://github.com/python/cpython/commit/e37ef41289b77e0f0bb9a6aedb0360664c55bdd5


--

___
Python tracker 

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



[issue36216] urlsplit does not handle NFKC normalization

2019-03-07 Thread Steve Dower


Steve Dower  added the comment:


New changeset daad2c482c91de32d8305abbccc76a5de8b3a8be by Steve Dower in branch 
'3.7':
bpo-36216: Add check for characters in netloc that normalize to separators 
(GH-12201)
https://github.com/python/cpython/commit/daad2c482c91de32d8305abbccc76a5de8b3a8be


--

___
Python tracker 

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



[issue33944] Deprecate and remove pth files

2019-03-07 Thread Steve Dower


Steve Dower  added the comment:

> I don't think there would be an alternative to how these tools function if 
> this feature were removed.

Right now, maybe, which is why we haven't just removed it :)

The point of the discussion is to say "this functionality is irreplaceable so 
we need to design a replacement". If a package can't do monkeypatching when 
imported for some reason, we should explore what those reasons are and provide 
a supported way to achieve their goals (or document the existing ways).

--

___
Python tracker 

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



[issue33944] Deprecate and remove pth files

2019-03-07 Thread Steve Dower


Steve Dower  added the comment:

Here's a trivial workaround for the import hook problem:

Assume we have "my_module.foo", and the import hook enables importing foo files.

Instead of just shipping "my_module.foo", you ship "my_module.py" and 
"_my_module.foo", where "my_module.py" looks like:

import my_import_hook
my_import_hook.install()

from _my_module import *

This really isn't hard to do. As a bonus, you don't even need a full import 
hook anymore - you can use any kind of loader you want. And it should be fully 
backwards compatible (assuming special tricks weren't part of your public API), 
so your users won't even notice the upgrade.

--

___
Python tracker 

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



[issue33944] Deprecate and remove pth files

2019-03-07 Thread Steve Dower


Steve Dower  added the comment:

> Elaborate please, as it sounds like you're simply dismissing my usecase.

I'm suggesting that to enable this functionality at startup, the 
user/application should have to do something like executing code or setting 
PYTHONSTARTUP.

What I'm dismissing is that "pip install some-package" can define a global 
startup task for your interpreter. I shouldn't get debugging or code coverage 
enabled every time I run "python" just because I installed some package - I 
should have to start that package somehow.

--

___
Python tracker 

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



[issue35978] test_venv fails in Travis with GCC

2019-03-07 Thread Steve Dower


Steve Dower  added the comment:

I'm on this. I'll make a new (or possibly complete replacement) for @skipInVenv 
that is @requireVenvCreate, since that's the common piece that doesn't work in 
a venv (except on Windows).

--
assignee:  -> steve.dower
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



[issue33944] Deprecate and remove pth files

2019-03-07 Thread Anthony Sottile


Anthony Sottile  added the comment:

I think nearly all of the use cases in the packages are valid (except 
module-layout) -- or at least if this feature were removed without having a 
startup-time site-packages code execution feature there would be no possible 
replacement.  I'll elaborate a little more on the titles I've chosen:

* backport: provide features that are not available to that python version, but 
were ratified peps in later versions.  These necessarily must happen at startup 
as to affect the application being used
* demo: these are fine to ignore, the two packages that were classified here 
were merely demoing how to use `.pth` files can be packaged with setuptools
* coverage: almost all of these were "automatically instrument coverage in 
subprocesses under test", basically the need to enable coverage tracing in 
subprocesses triggered by the application under test.  It is not possible to do 
this in any other way than an initialization hook in the interpreter (or 
monkeypatching the subprocess module, which I'd argue is significantly worse 
than what this is doing)
* debugging: these provide additional introspection tools to analyze an 
application, these also need to be interpreter level as you cannot customize 
code outside of your control but may need to debug such code.
* except-hook: these also seem necessary as well, from the few I looked into 
more detail they seemed to be setting hooks such that $foreign-application 
could be used within another framework -- looking very similar to ubuntu's 
`sitecustomize.py` which sends traces to apport on crash (bug reporting for 
python-based packages).  If you had ownership of this application sure you 
could add an except hook, but these seem t be for cases where you do not 
control the application
* monkeypatch: I don't think we should be so swift to banish this category, 
sure the name is scary but there were many legitimate cases here.  Many of 
these were to patch limitations in packages outside of control (dead, no longer 
accepting patches, not willing to support other platforms, etc.).  the patches 
necessarily happen at startup because there's no other place to influence the 
code of these third party tools.  Don't get me wrong, monkeypatching is usually 
bad, but I don't think there would be an alternative to how these tools 
function if this feature were removed.
* import-hook: I also don't see an easy way to work around these, most of these 
added alternate filetypes that python could import, but you need *something* to 
make importing work in the first place


> Basically everyone wants to remove the second one, but we can't do that until 
> there is replacement functionality for its legitimate use cases.

Without a poll I don't think assuming a majority is fair ;)

--

___
Python tracker 

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



[issue33898] pathlib issues with Windows device paths

2019-03-07 Thread Steve Dower


Steve Dower  added the comment:

Eryk - I've got the PR ready as far as I'm concerned. Have you had a look to 
see if you're happy with its logic for these cases?

--

___
Python tracker 

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



[issue36086] Split IDLE into separate feature in Windows installer

2019-03-07 Thread Steve Dower


Steve Dower  added the comment:

For the dependency you'll need to modify the bootstrapper to manually enforce 
checkbox selection. It'll also need to force the variable at planning time to 
support command line installs, so the checkbox is really just to help prevent 
users from becoming confused, but we'll want both.

IIRC, there's already something along those lines in there for another 
component (maybe file associations requiring the launcher?), so you can copy 
from that.

--

___
Python tracker 

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



[issue24322] Hundreds of linker warnings on Windows

2019-03-07 Thread Steve Dower


Change by Steve Dower :


--
resolution:  -> out of date
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



[issue35740] openssl version 1.1.1 need to be there in cpython-source-deps for windows ARM64

2019-03-07 Thread Steve Dower


Steve Dower  added the comment:

It's there now (and about to move to 1.1.1b :) )

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



[issue35978] test_venv fails in Travis with GCC

2019-03-07 Thread Steve Dower


Steve Dower  added the comment:

I guess we need a "skipInLinuxVenv", since it works fine on Windows :)

--

___
Python tracker 

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



[issue10009] Automated MSI installation does not work

2019-03-07 Thread Steve Dower


Change by Steve Dower :


--
resolution:  -> out of date
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



[issue36108] Avoid failing the build on race condition in clean

2019-03-07 Thread Steve Dower


Change by Steve Dower :


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



[issue36108] Avoid failing the build on race condition in clean

2019-03-07 Thread Steve Dower


Change by Steve Dower :


--
keywords: +patch
pull_requests: +12208
stage:  -> patch review

___
Python tracker 

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



[issue36216] urlsplit does not handle NFKC normalization

2019-03-07 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +12207

___
Python tracker 

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



[issue36226] multipart/related header causes false positive StartBoundaryNotFoundDefect and MultipartInvariantViolationDefect

2019-03-07 Thread Christian Schmidbauer


Christian Schmidbauer  added the comment:

Apologies, here are the correct commit IDs:

https://github.com/python/cpython/commit/89285439c7f94a3e62cee3d15e343218903c2af8

https://github.com/python/cpython/pull/12214/commits/a82e662ab3339072d7b86a8090989fba60ef9c37

--

___
Python tracker 

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



[issue36216] urlsplit does not handle NFKC normalization

2019-03-07 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +12205

___
Python tracker 

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



[issue36226] multipart/related header causes false positive StartBoundaryNotFoundDefect and MultipartInvariantViolationDefect

2019-03-07 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
pull_requests: +12204
stage:  -> patch review

___
Python tracker 

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



[issue33944] Deprecate and remove pth files

2019-03-07 Thread Ionel Cristian Mărieș

Ionel Cristian Mărieș  added the comment:

> * coverage, debugging, demo, except-hook - application/user
responsibility, not a package's

Elaborate please, as it sounds like you're simply dismissing my usecase.

--

___
Python tracker 

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



[issue36216] urlsplit does not handle NFKC normalization

2019-03-07 Thread Steve Dower


Change by Steve Dower :


--
pull_requests: +12203

___
Python tracker 

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



[issue36216] urlsplit does not handle NFKC normalization

2019-03-07 Thread Steve Dower


Steve Dower  added the comment:


New changeset 16e6f7dee7f02bb81aa6b385b982dcdda5b99286 by Steve Dower in branch 
'master':
bpo-36216: Add check for characters in netloc that normalize to separators 
(GH-12201)
https://github.com/python/cpython/commit/16e6f7dee7f02bb81aa6b385b982dcdda5b99286


--

___
Python tracker 

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



[issue32477] Move jumps optimization from the peepholer to the compiler

2019-03-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

After analyzing the difference between bytecodes generated by the current 
peepholer and the new optimizer I have found that he peepholer do not optimizes 
jumps in case of some multiline expressions. For example:

[x
 for x in a if x]

  1   0 BUILD_LIST   0
  2 LOAD_FAST0 (.0)
>>4 FOR_ITER12 (to 18)

  2   6 STORE_FAST   1 (x)
  8 LOAD_FAST1 (x)
 10 POP_JUMP_IF_FALSE   16

  1  12 LOAD_FAST1 (x)
 14 LIST_APPEND  2
>>   16 JUMP_ABSOLUTE4
>>   18 RETURN_VALUE

if x:
if (y and
z):
foo()
else:
bar()

  1   0 LOAD_NAME0 (x)
  2 POP_JUMP_IF_FALSE   20

  2   4 LOAD_NAME1 (y)
  6 POP_JUMP_IF_FALSE   18

  3   8 LOAD_NAME2 (z)

  2  10 POP_JUMP_IF_FALSE   18

  4  12 LOAD_NAME3 (foo)
 14 CALL_FUNCTION0
 16 POP_TOP
>>   18 JUMP_FORWARD 6 (to 26)

  6 >>   20 LOAD_NAME4 (bar)
 22 CALL_FUNCTION0
 24 POP_TOP
>>   26 LOAD_CONST   0 (None)
 28 RETURN_VALUE

It preserves jumps to jump instructions. I do not know the cause. All works 
with single-line expressions.

The new optimizer does not have this bug.

--

___
Python tracker 

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



[issue33944] Deprecate and remove pth files

2019-03-07 Thread Steve Dower


Steve Dower  added the comment:

There are two features here, let's be clear about what we're removing.

* extending sys.path with static (perhaps relative) directories
* arbitrary code execution (following "import " statements)

Only Barry wants to remove the first one, and the rest of us will push back 
hard enough to keep him in check ;)

Basically everyone wants to remove the second one, but we can't do that until 
there is replacement functionality for its legitimate use cases.

Looking at Anthony's list (and making some assumptions about what the titles 
mean), I'd propose that only encodings require a way to register them from an 
installed package. And maybe this is as simple as making "encodings" a 
namespace package?

For the others:

* backport, demo - no idea what these look like
* coverage, debugging, demo, except-hook - application/user responsibility, not 
a package's
* monkey-patching - kill it with fire
* import-hook, module-layout - easy enough to work around

(For those who are confused about the last, using a package __init__.py is how 
to modify these *when your package is actually loaded* and not on startup.)

--

___
Python tracker 

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



[issue36226] multipart/related header causes false positive StartBoundaryNotFoundDefect and MultipartInvariantViolationDefect

2019-03-07 Thread Christian Schmidbauer


Change by Christian Schmidbauer :


--
hgrepos: +381

___
Python tracker 

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



[issue36226] multipart/related header causes false positive StartBoundaryNotFoundDefect and MultipartInvariantViolationDefect

2019-03-07 Thread Christian Schmidbauer


New submission from Christian Schmidbauer :

The current implementation of `multipart/related` in urllib triggers header 
defects even though the headers are valid:
`[StartBoundaryNotFoundDefect(), MultipartInvariantViolationDefect()]`

The example header is valid according to RFC 2387 
(https://tools.ietf.org/html/rfc2387):
```
Content-Type: multipart/related; boundary="==="

```

Both defects are triggered by the fact that httplib only passes on headers to 
the underlying email parser, while the email parser assumes to receive a full 
message. The simple fix is to tell the underlying email parser that we are only 
passing the header: 0a89fc15c93c271eb08e46e2cda9a72adb97d633

The second issue is related, but independent: The underlying email parser 
checks if the parsed message is of type multipart by checking of the object 
"root" is of type list. As we only passed the header (and set 
`headersonly=True`), the check does makes no sense anymore at this point, 
creating a false positive: fdc7c47b77e330a36255fd00dc36accd72824e5b

--
components: Library (Lib)
messages: 337395
nosy: Christian Schmidbauer
priority: normal
severity: normal
status: open
title: multipart/related header causes false positive 
StartBoundaryNotFoundDefect and MultipartInvariantViolationDefect
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



[issue26470] Make OpenSSL module compatible with OpenSSL 1.1.0

2019-03-07 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +12202

___
Python tracker 

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



[issue36225] Lingering subinterpreters should be implicitly cleared on shutdown

2019-03-07 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
nosy: +nanjekyejoannah

___
Python tracker 

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



[issue36224] Python quit unexpectedly error

2019-03-07 Thread Ned Deily

Ned Deily  added the comment:

Based on the macOS traceback you provide, this is a very different problem from 
the one in the other issue. Here the crash is occuring in a third-party C 
extension module, not something provided by Python or its standard library:

0  algos.cpython-37m-darwin.so  0x0001132d2520 
__pyx_pf_6pandas_5_libs_5algos_600__defaults__ + 32

I’m not familiar with that name but it suggests that it is part of the pandas 
package. Further, the path name for the interpreter suggests you are using a 
Python installed from the Homebrew project. I suggest you ask on either or both 
of pandas and Homebrew support forums.  If the problem can be isolated to a 
problem within Python itself, please reopen this issue with updated 
information. Good luck!

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



[issue32856] Optimize the `for y in [x]` idiom in comprehensions

2019-03-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue32856] Optimize the `for y in [x]` idiom in comprehensions

2019-03-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution: fixed -> rejected

___
Python tracker 

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



[issue32856] Optimize the `for y in [x]` idiom in comprehensions

2019-03-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Closed in favor of PEP 572.

--

___
Python tracker 

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



[issue36225] Lingering subinterpreters should be implicitly cleared on shutdown

2019-03-07 Thread Nick Coghlan

New submission from Nick Coghlan :

https://docs.python.org/3/c-api/init.html#c.Py_EndInterpreter states that 
"Py_FinalizeEx() will destroy all sub-interpreters that haven’t been explicitly 
destroyed at that point."

As discussed in https://github.com/hexchat/hexchat/issues/2237, Python 3.7+ 
doesn't currently do that - it calls Py_FatalError instead.

That change came from https://github.com/python/cpython/pull/1728, which was 
based on my initial PEP 432 refactoring work, and I didn't realise that 
implicitly cleaning up lingering subinterpreters was a documented behaviour.

So I think we should just fix it to behave as documented, and add a new 
regression test to make sure it doesn't get broken again in the future.

--
keywords: 3.7regression
messages: 337392
nosy: eric.snow, ncoghlan, petr.viktorin
priority: normal
severity: normal
stage: needs patch
status: open
title: Lingering subinterpreters should be implicitly cleared on shutdown
type: crash
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue11614] import __hello__ is broken in Python 3

2019-03-07 Thread Solomon Ucko


Solomon Ucko  added the comment:

> It changes the semantics of Python.

When would the return value actually matter? Would it affect the value of the 
variable `__hello__`?

--

___
Python tracker 

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



[issue36220] LOAD_NAME and LOAD_GLOBAL handle dict subclasses for globals() differently

2019-03-07 Thread STINNER Victor


STINNER Victor  added the comment:

Oops sorry, it was the PEP 416: Add a frozendict builtin type. I wanted to 
write a sandbox for Python.

--

___
Python tracker 

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



[issue36220] LOAD_NAME and LOAD_GLOBAL handle dict subclasses for globals() differently

2019-03-07 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote bpo-14385 when I was working on my PEP 410. The PEP has been rejected, 
I'm not sure anymore that it was a good idea to modify ceval.c :-( But I never 
tried to measure the overhead of the additional "if (PyDict_CheckExact(...))".

--

___
Python tracker 

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



[issue11614] import __hello__ is broken in Python 3

2019-03-07 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
nosy: +pablogsal

___
Python tracker 

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



[issue36139] release GIL on mmap dealloc

2019-03-07 Thread STINNER Victor


STINNER Victor  added the comment:

Yeah! Roundup is fixed, thanks Ezio!

--

___
Python tracker 

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



[issue36139] release GIL on mmap dealloc

2019-03-07 Thread STINNER Victor


STINNER Victor  added the comment:

4th attempt (sorry for the spam, it's just to check the Roundup fix!):
https://github.com/python/cpython/pull/12073/files#r263026496

--

___
Python tracker 

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



[issue11614] import __hello__ is broken in Python 3

2019-03-07 Thread STINNER Victor


STINNER Victor  added the comment:

> The byte code could be further optimized (because this is such a 
> speed-critical module! :)): (...)

You propose to replace

  8 CALL_FUNCTION1
 10 POP_TOP
 12 LOAD_CONST   2 (None)
 14 RETURN_VALUE

with:

 12 CALL_FUNCTION1 
 15 RETURN_VALUE

It changes the semantics of Python. Technically, you *can* override the print() 
builtin function:

vstinner@apu$ ./python
Python 3.8.0a2+ (heads/master:dc078947a5, Mar  7 2019, 12:23:23) 
>>> import builtins
>>> def mock(*args, **kw): return 3
... 
>>> builtins.print=mock
>>> print("hello")
3
>>> import __phello__
>>> # doesn't print anything
... 

It would be possible if you ensure that print() isn't replaced.

Longer explanation:
https://fatoptimizer.readthedocs.io/en/latest/semantics.html

To use more efficient bytecode without modying the Python semantics, you need 
to deoptimize if print() is replaced. I implemented that in my old FAT Python 
project :-)
https://fatoptimizer.readthedocs.io/en/latest/optimizations.html#call-pure

--

I would be more interested by a tool to update/regenerate M___hello__ in 
Python/frozen.c.

--

___
Python tracker 

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



[issue36223] Execution sequence for print function

2019-03-07 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Agreed with @remi.lapeyre. There is no delayed evaluation in Python and this is 
not only related to print but it's the general evaluation model in Python. 
Another example as below since foo(1) is used as an argument it's evaluated 
first and then the return value is passed.

def bar(a, b):
print("bar ", a, b)
return (a, b)

def foo(b):
print("foo ", b)
return b

bar(foo(1), 2) # foo is first evaluated to pass 1 bar


$ python3 /tmp/foo.py
foo  1
bar  1 2

Closing this as not a bug.

--
nosy: +xtreak
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



[issue36216] urlsplit does not handle NFKC normalization

2019-03-07 Thread STINNER Victor


STINNER Victor  added the comment:

FYI I added this vulnerability to:
https://python-security.readthedocs.io/vuln/urlsplit-nfkc-normalization.html

--

___
Python tracker 

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



  1   2   >