[issue17068] peephole optimization for constant strings

2019-11-29 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- priority: normal -> low versions: +Python 3.9 -Python 3.4 ___ Python tracker ___ ___

[issue38943] Idle autocomplete window doesn't show up

2019-11-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: IDLE completes global names, attributes, and file names with various invocation methods. The main problem users have in editor windows is not running the module to update namespaces. But the claim here (and in the PR) is that there is a timing problem.

[issue35003] Provide an option to venv to put files in a bin/ directory on Windows

2019-11-29 Thread Vinay Sajip
Vinay Sajip added the comment: > so maybe proposing a simple `venv --activate ` that does nothing more > than set those key environment variables If venv is run in a child process of the shell, how does it set those variables in the parent shell? I thought that wasn't possible (on POSIX,

[issue38902] image/webp support in mimetypes

2019-11-29 Thread Florian Dahlitz
Change by Florian Dahlitz : -- nosy: +DahlitzFlorian ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38943] Idle autocomplete window doesn't show up

2019-11-29 Thread JohnnyNajera
Change by JohnnyNajera : -- keywords: +patch pull_requests: +16898 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17416 ___ Python tracker ___

[issue38943] Idle autocomplete window doesn't show up

2019-11-29 Thread JohnnyNajera
New submission from JohnnyNajera : In Ubuntu 19.10 and probably earlier versions of Ubuntu, the autocomplete window doesn't show up when expected. This is probably due to wm_geometry called in a context in which it has no effect. -- assignee: terry.reedy components: IDLE messages:

[issue38924] pathlib paths .normalize()

2019-11-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There were reasons why something like PurePath.normalize() was not added at first place. os.path.normpath() is broken by design. It does not work as you expect in case when the .. component is preceeded by a symlink. Its behvior can lead to bugs and maybe

[issue38942] Possible assertion failures in csv.Dialect()

2019-11-29 Thread Zackery Spytz
Change by Zackery Spytz : -- keywords: +patch pull_requests: +16897 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17415 ___ Python tracker ___

[issue38942] Possible assertion failures in csv.Dialect()

2019-11-29 Thread Zackery Spytz
New submission from Zackery Spytz : dialect_new() in Modules/_csv.c calls PyObject_GetAttrString() repeatedly without checking if an error occurred. If an exception (like MemoryError) is raised during one of the PyObject_GetAttrString() calls, an assertion failure will occur during the next

[issue17068] peephole optimization for constant strings

2019-11-29 Thread Batuhan
Batuhan added the comment: I think this operation is more suitable for AST optimizer then peephole but i'm still not sure if such a conversion gains anything compared to usage of old type string formattings. -- nosy: +BTaskaya ___ Python tracker

[issue38924] pathlib paths .normalize()

2019-11-29 Thread Brett Cannon
Brett Cannon added the comment: > From my experience in the past the intention has been to keep the API minimal Correct, all of os.path and shutils does not need to end up in pathlib. :) Hence why the request to add things is always tough as we have to try and strike a balance of useful but

[issue35003] Provide an option to venv to put files in a bin/ directory on Windows

2019-11-29 Thread Brett Cannon
Brett Cannon added the comment: > Surely "on native Windows you run venv-path\Scripts\activate[.ps1], on POSIX > you use source venv-path/bin/activate" isn't *that* hard for new users to > grok, and would cover the vast majority of users? Sure, but how many times do we need to make people

[issue38940] Add a new functools.cast() function

2019-11-29 Thread Brett Cannon
Brett Cannon added the comment: First off, thanks for the suggestion! But there are two things to say about this. One, that isn't actually casting as Python doesn't have the concept of casting like in statically typed languages since everything is dynamically typed. Two, the solution is so

[issue38939] Using Python as a Calculator

2019-11-29 Thread Brett Cannon
Brett Cannon added the comment: If you're using Python 2.7 then that would explain what you're seeing. You can either upgrade to Python 3 or use `from __future__ import division` to get the result you're after. -- nosy: +brett.cannon resolution: -> not a bug stage: -> resolved

[issue38936] fatal error during installation 0x80070643 during python installation

2019-11-29 Thread Steve Dower
Steve Dower added the comment: It looks like you had a previous install that wasn't cleaned up properly (all the packages are still registered). Any idea what may have caused that? The easiest workaround will be to use Programs and Features to find and repair the previous install ("Modify"

[issue38941] xml.etree.ElementTree.Element inconsistent warning for bool

2019-11-29 Thread Philip Rowlands
Philip Rowlands added the comment: It's easier to justify a change in behaviour if the warning is emitted. With no legacy concerns, I would be happy for bool() to change, but I'm not the one who would receive the grumbly tickets. How about emitting the warning in the next release, then

[issue38941] xml.etree.ElementTree.Element inconsistent warning for bool

2019-11-29 Thread Stefan Behnel
Stefan Behnel added the comment: Agreed that both should behave the same. And, we should finally decide whether this should really be changed or not. The current behaviour is counter-intuitive, but it's been like that forever and lots of code depends on it in one way or another, so …

[issue38940] Add a new functools.cast() function

2019-11-29 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38937] NameError in list comprehension within .pth file

2019-11-29 Thread Chris Billington
Chris Billington added the comment: Sorry for the spamming, realised I misunderstood further. The original behaviour isn't because the exec'd code can't create new local variables - it can - it's because of the documented behaviour of exec when it gets different dicts for globals and

[issue38941] xml.etree.ElementTree.Element inconsistent warning for bool

2019-11-29 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- components: +XML nosy: +scoder ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue38941] xml.etree.ElementTree.Element inconsistent warning for bool

2019-11-29 Thread Philip Rowlands
New submission from Philip Rowlands : Steps to reproduce: $ python3.7 Python 3.7.2 (default, May 13 2019, 13:52:56) [GCC 6.3.0 20170516] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import xml.etree.ElementTree as ET >>>

[issue38940] Add a new functools.cast() function

2019-11-29 Thread Ugra Dániel
Ugra Dániel added the comment: Currently, the closest functionality I can think of (using standard library functions only): @functools.partial(lambda func: functools.wraps(func)(lambda *args, **keywords: list(func(*args, **keywords Or without proper wrapping: @functools.partial(lambda

[issue38940] Add a new functools.cast() function

2019-11-29 Thread Ugra Dániel
New submission from Ugra Dániel : In some cases it would be really helpful to have a decorator which automagically casts returned value to a different type. Particularly, instead of writing something like this: def example(): result = [] for ...: result.append(item)

[issue38939] Using Python as a Calculator

2019-11-29 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Maybe you are looking for floor division? https://docs.python.org/3.3/reference/expressions.html#binary-arithmetic-operations > The / (division) and // (floor division) operators yield the quotient of > their arguments. The numeric arguments are

[issue30988] Exception parsing invalid email address headers starting or ending with dot

2019-11-29 Thread Cyril Nicodème
Cyril Nicodème added the comment: Hi! I confirm this problem too, also with the SMTPUTF8 policy. I was able to reproduce this error on my end (Python v3.7.5). Note that when calling `message_from_bytes` without policy, there is no errors. -- nosy: +cnicodeme

[issue38939] Using Python as a Calculator

2019-11-29 Thread dongjs
New submission from dongjs : >>> 17 / 3 # classic division returns a float 5.667 this example is error what i test is below >>> 17.0 / 3 5.667 >>> 17 / 3 5 -- messages: 357637 nosy: dongjs priority: normal severity: normal status: open title: Using Python

[issue38893] broken container/selinux integration

2019-11-29 Thread Leif Middelschulte
Leif Middelschulte added the comment: @Christian Heimes: is there anything else you need from me? Is this the wrong forum? As discussed in the referenced GitHub issue, some SELinux people suggest it might be a fault in how Python determines (?) it's running within a container environment