[issue37623] namedtuple integration for importlib.abc.Loader

2019-07-19 Thread Andrew Yurisich


Andrew Yurisich  added the comment:

This issue was raised due to a misunderstanding of the namedtuple creation 
process. After creating the fields, but before assigning them, __spec__ is 
trivially added to namedtuple class' definition as a property.

Thanks again @serhiy.storchaka

--
resolution:  -> works for me
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



[issue30618] readlink for pathlib paths

2019-07-19 Thread Girts Folkmanis


Change by Girts Folkmanis :


--
versions: +Python 3.9 -Python 3.8

___
Python tracker 

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



[issue37635] Using constant for whence arg in seek()

2019-07-19 Thread Kyle Stanley


Change by Kyle Stanley :


--
assignee:  -> docs@python
components: +Documentation, Tests
nosy: +docs@python

___
Python tracker 

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



[issue37635] Using constant for whence arg in seek()

2019-07-19 Thread Kyle Stanley

New submission from Kyle Stanley :

In Python 3.1, three constants were added to the IO module to be used for the 
whence argument of seek():

SEEK_SET or 0 – start of the stream
SEEK_CUR or 1 – current stream position
SEEK_END or 2 – end of the stream

However, there are at least 102 occurrences across CPython where the integer 
values are used instead. This only includes instances when a value for the 
whence arg is explicitly specified. All of the occurrences can be easily found 
with the usage of git grep:

git grep -E "seek\(-?[0-9]+, [0-2]\)"

This doesn't affect functionality in any way, but it would result in 
significant readability improvement if these were all replaced with constants. 
The only requirement would be importing IO or manually specifying the value of 
constants. 

For simplicity, I would probably start with anything that directly involves IO. 
The largest number of occurrences are in Lib/test/test_io, so that probably 
would be the best place to begin. Also, this module already imports io anyways, 
so it would be a straightforward find and replace. 

It would also be quite useful to make this change in the documentation, in 
Doc/tutorial/inputoutput there are 4 occurrences. If anything, anyone less 
familiar with the IO module in general would be the most likely to benefit from 
this change so modifying the tutorial would likely be the most useful change 
for the majority of users.

As a single example of what I'm talking about, here's line 334 of 
Lib/test/test_io:

self.assertEqual(f.seek(-1, 1), 5)

I would propose changing it to:

self.assertEqual(f.seek(-1, io.SEEK_CUR), 5)

--
components: IO
messages: 348207
nosy: aeros167, benjamin.peterson, stutzbach
priority: normal
severity: normal
status: open
title: Using constant for whence arg in seek()
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue37609] support "UNC" device paths in ntpath.splitdrive

2019-07-19 Thread Ngalim Siregar


Ngalim Siregar  added the comment:

I was unsure about implementation in the patch, do you have UNC format 
specification?

--
nosy: +nsiregar

___
Python tracker 

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



[issue32912] Raise non-silent warning for invalid escape sequences

2019-07-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> In other words, it seems to me that getting in the way of 
> this broken end-user strategy is a *good* thing, since it
> warns of possible mistakes.

Here's an example from the current version of Bottle (0.12.17):

/Users/raymond/Dropbox/Public/sj205/notes2/bottle.py:3433: SyntaxWarning: 
invalid escape sequence \[
  _re_tok += '|([\[\{\(])'
/Users/raymond/Dropbox/Public/sj205/notes2/bottle.py:3434: SyntaxWarning: 
invalid escape sequence \]
  _re_tok += '|([\]\}\)])

These warnings would spew out during a recent Python course where we used 
3.8b2.  It mae it difficult to teach building templates in an iterative style.  
We had to abandon 3.8 and go back to 3.7 to proceed with the templating lesson.

IMO, spewing out these warnings for things users can't do anything about is a 
usability travesty.

--

___
Python tracker 

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



[issue36161] Use thread-safe functions instead of unsafe ones (crypt, ttyname)

2019-07-19 Thread Antonio Gutierrez


Change by Antonio Gutierrez :


--
keywords: +patch
pull_requests: +14655
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/14868

___
Python tracker 

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



[issue37620] str.split(sep=None, maxsplit=-1,any=False)

2019-07-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Harry, thanks for the suggestion but we're going to pass for now.

For the most part, str.split() has stood the test of time and we use regexes 
for more customized or complicated variants.  In general, adding API options 
increases complexity for users, making the basic methods harder to learn and 
remember.  Fewer choices tends to make for easier programming. Guido has 
repeatedly given guidance to prefer separate functions and methods over putting 
multiple algorithmic flags in a single function or method.

If you want to pursue this further, consider posting to the python-ideas list.  
You'll find more traction if you're able to find real-world code that would 
benefit from the new API.

One other thought: the API for the strip/lstrip/rstrip methods has the 
equivalent of the *any* option when *chars* are specified.  That has not worked 
out well -- people get surprised when the methods strip more than the exact 
string specified: 'there'.rstrip('re') --> 'th'.

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



[issue34624] -W option and PYTHONWARNINGS env variable does not accept module regexes

2019-07-19 Thread daniel hahler


daniel hahler  added the comment:

Note that "module" might also be the filename (with ".py" removed).

I've just created issue37634 - might be worth including in your PR if it makes 
sense to only document this.

--
nosy: +blueyed

___
Python tracker 

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



[issue37634] doc: "module" of a warning might be its filename

2019-07-19 Thread daniel hahler


New submission from daniel hahler :

With e.g. DeprecationWarnings for "invalid escape sequence" the "module" part 
is the file name (with ".py" removed), because it calls 
PyErr_WarnExplicitObject directly:
https://github.com/python/cpython/blob/3cba3d3c55f230a59174a0dfcafb1d4685269e60/Python/ast.c#L4668-L4692

While this properly cannot be fixed to have the module name (yet), it should at 
least be documented then.

With `warnings.warn` the module is set via `setup_context` 
(https://github.com/python/cpython/blob/3cba3d3c55f230a59174a0dfcafb1d4685269e60/Python/_warnings.c#L932-L933).

This conflicts with https://github.com/python/cpython/pull/9358 (issue34624), 
which enables the documented behavior to not escape the pattern there.

--
components: Library (Lib)
messages: 348201
nosy: blueyed
priority: normal
severity: normal
status: open
title: doc: "module" of a warning might be its filename
type: behavior
versions: Python 3.9

___
Python tracker 

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



[issue35476] _imp_create_dynamic_impl() does not clear error.

2019-07-19 Thread Brett Cannon


Brett Cannon  added the comment:

Why would was want to swallow an exception? I think it would be better to let 
the exception propagate.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue29446] Improve tkinter 'import *' situation

2019-07-19 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I agree that for python x.y, the names imported by 'import *' should be fixed 
and *not* depend on other imports.

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



[issue37633] Py_CompileString and PyParser_SimpleParseString not exported in python38.dll

2019-07-19 Thread PyScripter


New submission from PyScripter :

Py_CompileString and PyParser_SimpleParseString and possibly other related 
functions are not exported in Python 3.8 b2 DLL.  This is unintentional, not 
documented and unnecessarily breaks backward compatibility.

Issue 37189 was similar and related to PyRun_String.  This was fixed in Python 
3.8b2. Please provide fixes to the above two functions as well.  

To confirm the error:
>>> import ctypes
>>> api = ctypes.pythonapi
>>> hasattr(api, "PyParser_SimpleParseString")
False
>>> hasattr(api2, "Py_CompileString")
False

--
components: Windows
messages: 348198
nosy: paul.moore, pyscripter, steve.dower, tim.golden, vstinner, zach.ware
priority: normal
severity: normal
status: open
title: Py_CompileString and PyParser_SimpleParseString not exported in 
python38.dll
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



[issue37623] namedtuple integration for importlib.abc.Loader

2019-07-19 Thread Andrew Yurisich

Andrew Yurisich  added the comment:

You're right, I was invoking the namedtuple on the same line that I was
defining it, freezing it in the process.

I split it to into two statements, and snuck the __spec__ attribute between
the definition and the instantiation.

I'll update the examples on my GitHub issue in the morning, and probably
close the issue out unless I find something else that is blocking me.

Thanks for the input 

On Fri, Jul 19, 2019, 22:08 Serhiy Storchaka  wrote:

>
> Serhiy Storchaka  added the comment:
>
> It is not hard to set __spec__ (as well as any other attributes) after
> creating a namedtuple class.
>
> A = namedtuple(...)
> A.__spec__ = ...
>
> or
>
> class A(namedtuple(...)):
> __spec__ = ...
>
> __spec__ do not have anything to namedtuple. It is not like __module__ or
> __doc__ setting which would benefit almost every public namedtuple class.
> It is not even special for types.
>
> --
> nosy: +serhiy.storchaka
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue37618] Docs: Code example locations in stdtypes

2019-07-19 Thread Kyle Stanley


Kyle Stanley  added the comment:

>In my opinion the current documentation is correctly formed since the 
>bytearray and str are two different classes in Python they could have 
>different set of functions supported and hence the grouping of functions like 
>islower() to be kept separated for different object types.

This could justify the grouping of the functions themselves, but doesn't 
explain why the code examples are contained in bytearray instead of str. New 
users of the language are far more likely to check the docs for the string 
functions, and thus benefit significantly more from seeing the code examples.

--

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2019-07-19 Thread Stefan Behnel


Stefan Behnel  added the comment:

I created a PR that adds a couple of paragraphs to the documentation. Comments 
welcome.

--
versions: +Python 3.9

___
Python tracker 

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



[issue34160] ElementTree not preserving attribute order

2019-07-19 Thread Stefan Behnel


Change by Stefan Behnel :


--
pull_requests: +14654
pull_request: https://github.com/python/cpython/pull/14867

___
Python tracker 

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



[issue37623] namedtuple integration for importlib.abc.Loader

2019-07-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is not hard to set __spec__ (as well as any other attributes) after creating 
a namedtuple class.

A = namedtuple(...)
A.__spec__ = ...

or

class A(namedtuple(...)):
__spec__ = ...

__spec__ do not have anything to namedtuple. It is not like __module__ or 
__doc__ setting which would benefit almost every public namedtuple class. It is 
not even special for types.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue35625] Comprehension doc doesn't mention buggy class scope behavior

2019-07-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

As a documentation issue this is a duplicate of issue26951.

--
stage:  -> resolved
status: open -> closed
superseder:  -> Unintuitive error when using generator expression in class 
property

___
Python tracker 

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



[issue37620] str.split(sep=None, maxsplit=-1,any=False)

2019-07-19 Thread Harry Coin

Harry Coin  added the comment:

I suspect the number of times the str.split builtin was examined for use 
and rejected in favor of the much more complex and 'heavy' re module 
far, far exceeds the number of times it found use with more than one 
character in the split string.

The str.split documentation 'feels like' the python equivalent of the 
linux 'tr' utility that treats the separator characters as a set instead 
of a sequence.   Notice the default and the help(str.split) 
documentation tends to encourage that intuition as no sep= has a very 
different behavior:  no argument 'removes any whitespace and discards 
empty strings from the result'.  That leads one to suspect each 
character in a string would do the same.

Mostly it's a use-case driven obviousness, you'd think python would 
naturally do that in str.split. So very many cases seek to resolve a 
string into a list of the interesting bits without regard to any mix of 
separators  (tabs, spaces, etc to increase the readability of the file).

I think it would be a heavily used enhancement to add the 'any=True' 
parameter.

Or,  in the alternative, allow the argument to sep to be an iterable so 
that:

'ab, cd'.split(sep=' ,') -->  ['ab, cd']

but

'ab, cd'.split(sep=[' ',',']) -> ['ab', 'cd']

On 7/19/19 1:34 PM, Serhiy Storchaka wrote:
> Serhiy Storchaka  added the comment:
>
> An alternative is to use regular expressions.
>
 re.split('[\t ]+', 'ab\t cd ef')
> ['ab', 'cd', 'ef']
> .
>
> --
> nosy: +serhiy.storchaka
>
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue22367] Add open_file_descriptor parameter to fcntl.lockf() (use the new F_OFD_SETLK flag)

2019-07-19 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



[issue26951] Unintuitive error when using generator expression in class property

2019-07-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

See also issue3692.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue37632] generator expression doesn't find subclass

2019-07-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

This is a duplicate of issue3692.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> improper scope in list comprehension, when used in class 
declaration

___
Python tracker 

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



[issue37620] str.split(sep=None, maxsplit=-1,any=False)

2019-07-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

An alternative is to use regular expressions. 

>>> re.split('[\t ]+', 'ab\t cd ef')
['ab', 'cd', 'ef']
.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue29446] Improve tkinter 'import *' situation

2019-07-19 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I prefer Eric's approach. It excludes tkinter submodules (like tkinter.ttk). 
Currently the result of the star import depends on what submodules were 
imported before. I think it would be better to make it more stable.

--

___
Python tracker 

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



[issue36044] PROFILE_TASK for PGO build is not a good workload

2019-07-19 Thread Neil Schemenauer


Neil Schemenauer  added the comment:

I changed configure.in to use AC_ARG_VAR instead.  So, you can override it as 
you suggest:

  ./configure [..] PROFILE_TASK="-m test --pgo-extended"

--

___
Python tracker 

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



[issue9216] FIPS support for hashlib

2019-07-19 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

Providing a simple keyword as a workaround for bypassing the FIPS restrictions, 
could potentially violate the standard, as there is no way from the python side 
to verify if the code in question is used for security purposes or not.

Thus I would close this issue as wontfix. Application distributors who would 
like their code to work under FIPS should preferably use the FIPS approved 
ciphers.

--

___
Python tracker 

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



[issue34396] Certain methods that heap allocated subtypes inherit suffer a 50-80% performance penalty

2019-07-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Some thoughs:

* Lib/sets.py benefitted significantly from itertools and METH_COEXIST.

* The dunder methods are part of the public API.  Serhiy's persona tastes 
aside, there is no reason not to use them like any other method.

* Given a performance trade-off between classes and subclasses, almost 
universally we give preference to the parent class.

* The folks who use itertools with __getitem__ and __contains__ almost always 
do so because they care about speed and have a preference for a functional 
style.  Removing the current optimization would directly hit those folks and 
their style of coding, resulting in code that used to be fast and elegant 
becoming slow.

--

___
Python tracker 

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



[issue37632] generator expression doesn't find subclass

2019-07-19 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I think it's about a class being defined inside another class and not about 
subclass. This seems to be similar to https://bugs.python.org/issue3692 that 
discusses about class attribute scope for comprehension.

--
nosy: +xtreak

___
Python tracker 

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



[issue37631] EXTRA_CFLAGS get overrided by CFLAGS_NODIST

2019-07-19 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

Could you provide more info, e.g. comparison between the proper and the 
erroneous output, as well as what it affects (test_gdb if I recall correctly)?

--
nosy: +cstratak

___
Python tracker 

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



[issue37496] Support annotations in signature strings.

2019-07-19 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

You might want to look into how PEP 563 is implemented, it has a utility to 
turn an AST back into a string (I assume this is what you want).

--

___
Python tracker 

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



[issue29446] Improve tkinter 'import *' situation

2019-07-19 Thread Flavian Hautbois


Change by Flavian Hautbois :


--
keywords: +patch
pull_requests: +14653
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/14864

___
Python tracker 

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



[issue34396] Certain methods that heap allocated subtypes inherit suffer a 50-80% performance penalty

2019-07-19 Thread Jeroen Demeyer


Change by Jeroen Demeyer :


--
keywords: +patch
pull_requests: +14652
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/14863

___
Python tracker 

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



[issue37632] generator expression doesn't find subclass

2019-07-19 Thread Ákos Tompos

New submission from Ákos Tompos :

The following code does work on python 2.7 but fails on python 3.7. The code 
seems correct.

class A:
class B:
def __init__(self, param):
self.param = param

l = [B(i) for i in range(10)]

The result on:
3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)]

Traceback (most recent call last):
  File "test.py", line 6, in 
class A:
  File "test.py", line 11, in A
l = [B(i) for i in range(10)]
  File "test.py", line 11, in 
l = [B(i) for i in range(10)]
NameError: name 'B' is not defined

B can be accessed if not inside a generator expression

--
messages: 348181
nosy: Ákos Tompos
priority: normal
severity: normal
status: open
title: generator expression doesn't find subclass
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



[issue37611] Improve the "Dealing with Bugs" documentation, include guidelines on how to report bugs

2019-07-19 Thread Mariatta


Mariatta  added the comment:

Sure, moving it up is a good start.

--

___
Python tracker 

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



[issue16512] imghdr doesn't recognize variant jpeg formats

2019-07-19 Thread Pierre Chopin


Change by Pierre Chopin :


--
pull_requests: +14651
pull_request: https://github.com/python/cpython/pull/14862

___
Python tracker 

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



[issue37629] Imghdr doesnt recognise some jpeg

2019-07-19 Thread Pierre Chopin


Pierre Chopin  added the comment:

This is actually a duplicate of bpo-16512, i am closing this.

--
resolution:  -> duplicate
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



[issue37625] Class variable is still accessible after class instance has been overwritten out

2019-07-19 Thread Daniel


Daniel  added the comment:

Thanks, just didn't expect that behavior.

--

___
Python tracker 

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



[issue27873] multiprocessing.pool.Pool.map should take more than one iterable

2019-07-19 Thread Flavian Hautbois


Flavian Hautbois  added the comment:

Are you going to open a PR for this patch? I think that would be a nice addition

--
nosy: +flavianhautbois

___
Python tracker 

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



[issue37611] Improve the "Dealing with Bugs" documentation, include guidelines on how to report bugs

2019-07-19 Thread Krishna Oza


Krishna Oza  added the comment:

Mariatta,
Would it be okay for now just to move the existing bug filing guidelines to be 
moved up.

--
nosy: +Krishna Oza

___
Python tracker 

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



[issue37618] Docs: Code example locations in stdtypes

2019-07-19 Thread Krishna Oza


Krishna Oza  added the comment:

Kyle
In my opinion the current documentation is correctly formed since the bytearray 
and str are two different classes in Python they could have different set of 
functions supported and hence the grouping of functions like islower() to be 
kept separated for different object types.

--
nosy: +Krishna Oza, Mariatta

___
Python tracker 

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



[issue37588] Py_DEPRECATED and unavoidable warnings

2019-07-19 Thread Inada Naoki

Inada Naoki  added the comment:

2019年7月19日(金) 22:00 Phil Thompson :

>
> If I fail to protect against using a feature when it is no longer
> present then it's a bug in my code and it won't compile. Providing a
> deprecation warning gives me some notice that my code needs to be
> changed. That is helpful but not strictly necessary as I will soon find
> out when testing against the new version. There is nothing "dangerous"
> here.
>

You are proposing to change Python, so it's not only your option.  It may
be safe for you, but may be not safe for all authors who creating extension
and share it on PyPI.

If it's only your problem, you can manually suppress the warning, like you
manually enabled missing initializer warning.  No need to add an option to
CPython.

>

--

___
Python tracker 

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



[issue37629] Imghdr doesnt recognise some jpeg

2019-07-19 Thread Krishna Oza


Krishna Oza  added the comment:

Victor
I have debugged the issue and found that the jpg file shared doesnt have the 
information in its header to identify the file format of this file.
The imghdr module needs file format information in first 32 bytes when the jpg 
file is read in binary mode. However for the  file 
"e2006bd7-51d7-4554-9738-ea13207fd104.jpg" there is no such information present 
and hence I would like to suggest that the issue be closed appropriately.

P.S. Attaching the dump of file "e2006bd7-51d7-4554-9738-ea13207fd104.jpg" when 
read in binary mode.

--
nosy: +vstinner
Added file: https://bugs.python.org/file48492/cpython_imghdr_issue.txt

___
Python tracker 

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



[issue37588] Py_DEPRECATED and unavoidable warnings

2019-07-19 Thread Phil Thompson


Phil Thompson  added the comment:

>> Which is why I protect the initialisation with #if PY_VERSION_HEX <
> 0x0309
> 
> It is your specific case.  We can not assume people do it, or even you
> never forget it.  So this is not the "right thing" we can recommend to
> all users.
> 
> Once you or other people suppress the deprecation warning and forget
> the protect, compatibility issue happen again.  Why such dangerous
> option is needed?

If I fail to protect against using a feature when it is no longer 
present then it's a bug in my code and it won't compile. Providing a 
deprecation warning gives me some notice that my code needs to be 
changed. That is helpful but not strictly necessary as I will soon find 
out when testing against the new version. There is nothing "dangerous" 
here.

--

___
Python tracker 

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



[issue37629] Imghdr doesnt recognise some jpeg

2019-07-19 Thread Krishna Oza


Change by Krishna Oza :


--
components: +Library (Lib)
type:  -> behavior

___
Python tracker 

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



[issue37629] Imghdr doesnt recognise some jpeg

2019-07-19 Thread Krishna Oza


Krishna Oza  added the comment:

The documentation at 
https://docs.python.org/3/library/imghdr.html?highlight=imghdr#module-imghdr 
says that JPEG files with JPEG data in JFIF or Exif formats are only supported 
as of now. Pierre Chopin could help with what format of jpeg you have uploaded.

--
nosy: +Krishna Oza

___
Python tracker 

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



[issue37588] Py_DEPRECATED and unavoidable warnings

2019-07-19 Thread Inada Naoki


Inada Naoki  added the comment:

> Which is why I protect the initialisation with #if PY_VERSION_HEX < 
0x0309

It is your specific case.  We can not assume people do it, or even you never 
forget it.  So this is not the "right thing" we can recommend to all users.

Once you or other people suppress the deprecation warning and forget the 
protect, compatibility issue happen again.  Why such dangerous option is needed?


Note that we don't use `-Wextra` or `-Wmissing-field-initializers`.  The 
missing initializer warning is specific to you.  You manually enabled the 
warning.

So why should we provide the way to suppress the warning we never recommend to 
enable?

--

___
Python tracker 

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



[issue37588] Py_DEPRECATED and unavoidable warnings

2019-07-19 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

I support the patch proposed in https://bugs.python.org/file48478/pyport.h.diff 
but it's not up to me to make that decision.

--

___
Python tracker 

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



[issue36167] DOC: Incorrect capitalization in Programming FAQ

2019-07-19 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +14650
pull_request: https://github.com/python/cpython/pull/14860

___
Python tracker 

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



[issue37631] EXTRA_CFLAGS get overrided by CFLAGS_NODIST

2019-07-19 Thread Marcel Plch


New submission from Marcel Plch :

Problem:
If you want to override CFLAGS by setting EXTRA_CFLAGS, they may have no effect 
if there are contrary flags in the CFLAGS_NODIST variable.

How to reproduce:
make CFLAGS_NODIST="-O2" EXTRA_CFLAGS="-Og"

If you look at GCC arguments, there is -O2 present *after* the -Og flag. This 
means -Og gets ignored.

--
components: Build
messages: 348168
nosy: Dormouse759
priority: normal
severity: normal
status: open
title: EXTRA_CFLAGS get overrided by CFLAGS_NODIST
type: behavior
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue37226] Asyncio Fatal Error on SSL Transport - IndexError Deque Index Out Of Range

2019-07-19 Thread Ben Brown


Ben Brown  added the comment:

With some more research it looks like the issue is flow related, I experimented 
with the StreamWriter in a simple server and using that plus drain() appears to 
have worked an I no longer get the error. I have added my new server to the 
gist I posted above.

--

___
Python tracker 

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



[issue37588] Py_DEPRECATED and unavoidable warnings

2019-07-19 Thread Phil Thompson


Phil Thompson  added the comment:

On 19/07/2019 11:37, Jeroen Demeyer wrote:
> Jeroen Demeyer  added the comment:
> 
>> We have some reserved/deprecated/unused fields.  Setting 0 to them 
>> makes forward incompatible code.
> 
> Good point. tp_print is removed in 3.9

Which is why I protect the initialisation with #if PY_VERSION_HEX < 
0x0309

As far as I can see this is the "right thing" to do. However doing the 
"right thing" means I cannot avoid warnings without resorting to 
compiler-specific build system changes.

With the change I am asking for I can suppress the warning (because I 
have explicitly dealt with the issue) in the code itself without 
affecting the rest of the system.

--

___
Python tracker 

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



[issue37630] Investigate replacing SHA3 code with OpenSSL

2019-07-19 Thread Christian Heimes


New submission from Christian Heimes :

Recent OpenSSL comes with SHA3. Now that Python is going to drop support for 
old OpenSSL, we can consider to use OpenSSL's SHA3 and drop the reference 
implementation from Python.

For variable length SHAKE API, OpenSSL added EVP_MD_CTRL_XOF_LEN and 
EVP_DigestFinalXOF().

--
assignee: christian.heimes
components: Extension Modules
messages: 348165
nosy: christian.heimes, gregory.p.smith
priority: normal
severity: normal
status: open
title: Investigate replacing SHA3 code with OpenSSL
type: behavior
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue36182] Path.write_text() docs do not include the case that a file exists

2019-07-19 Thread Lysandros Nikolaou


Lysandros Nikolaou  added the comment:

Pinging for review.

--

___
Python tracker 

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



[issue37588] Py_DEPRECATED and unavoidable warnings

2019-07-19 Thread Jeroen Demeyer


Jeroen Demeyer  added the comment:

> We have some reserved/deprecated/unused fields.  Setting 0 to them makes 
> forward incompatible code.

Good point. tp_print is removed in 3.9

--

___
Python tracker 

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



[issue37629] Imghdr doesnt recognise some jpeg

2019-07-19 Thread Pierre Chopin


New submission from Pierre Chopin :

the imghdr library only checks for the presence of (b'JFIF', b'Exif') in the 
header, which is excluding some valid JPEG file. This is an example of not 
recognised ile

--
files: e2006bd7-51d7-4554-9738-ea13207fd104.jpg
messages: 348161
nosy: pchopin
priority: normal
severity: normal
status: open
title: Imghdr doesnt recognise some jpeg
versions: Python 3.7
Added file: 
https://bugs.python.org/file48491/e2006bd7-51d7-4554-9738-ea13207fd104.jpg

___
Python tracker 

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



[issue37588] Py_DEPRECATED and unavoidable warnings

2019-07-19 Thread Inada Naoki


Inada Naoki  added the comment:

> I am not "touching" tp_print. I am simply defining it as 0 to avoid the 
> missing initialiser warning.

I meant it.  `tp_print = 0` touches the deprecated `tp_print` field.
It is not forward compatible.  Note that we need to re-add tp_print only for C 
code which does `tp_print = 0`.


>  My point is that it should be possible to write code that doesn't trigger 
> warnings (whether or not you suppress them).

There is a simple solution: don't use `-Wextra`.

We have some reserved/deprecated/unused fields.  Setting 0 to them makes 
forward incompatible code.  It bothers us to remove or reuse these fields.

There are some other solutions, suppress the missing initializer warning as I 
wrote above, or use PyType_FromSpec instead of static type.

--

___
Python tracker 

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



[issue37623] namedtuple integration for importlib.abc.Loader

2019-07-19 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think using a dataclass here would be easier, since you can control class 
variables. Is there some reason that your loader must be a namedtuple?

Something like:

from typing import ClassVar
from dataclasses import dataclass

@dataclass
class MyLoader:
__spec__: ClassVar["Any"] = None
name: str

l = MyLoader('test')

I'm not sure of the actual type of __spec__, I'm just using "Any" as a 
convenient placeholder. I'm also not sure if your intention is to inherit from 
importlib.abc.Loader, but that's easy enough.

--

___
Python tracker 

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



[issue37588] Py_DEPRECATED and unavoidable warnings

2019-07-19 Thread Phil Thompson


Phil Thompson  added the comment:

I am not "touching" tp_print. I am simply defining it as 0 to avoid the missing 
initialiser warning. My point is that it should be possible to write code that 
doesn't trigger warnings (whether or not you suppress them).

--

___
Python tracker 

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



[issue37623] namedtuple integration for importlib.abc.Loader

2019-07-19 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue37624] random.choices has unexpected behavior with negative weights

2019-07-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Misc side notes:

* There is no expected behavior for negative a negative weight.  Arguably, the 
only reasonable interpretation is what it already does (reduce the cumulative 
total).

* Running simulations is a primary use case for choices().  Generally, running 
time there is important. 

* During the design phase, none of the other implementations studied had 
incorporated a scan of the inputs for negative weights.

*  bisect() does not check to make sure its inputs are sorted.  The results for 
unsorted data are undefined.  It is a documented precondition.

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



[issue36546] Add quantiles() to the statistics module

2019-07-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset e5bfd1ce9da51b64d157392e0a831637f7335ff5 by Raymond Hettinger 
(Miss Islington (bot)) in branch '3.8':
bpo-36546:  Clean-up comments (GH-14857) (#14859)
https://github.com/python/cpython/commit/e5bfd1ce9da51b64d157392e0a831637f7335ff5


--

___
Python tracker 

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



[issue37624] random.choices has unexpected behavior with negative weights

2019-07-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset a50a6225a06e5a83ce2a880a7eb4496043fdbb55 by Raymond Hettinger 
(Miss Islington (bot)) in branch '3.8':
bpo-37624: Document weight assumptions for random.choices() (GH-14855) 
(GH-14858)
https://github.com/python/cpython/commit/a50a6225a06e5a83ce2a880a7eb4496043fdbb55


--

___
Python tracker 

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



[issue36546] Add quantiles() to the statistics module

2019-07-19 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14649
pull_request: https://github.com/python/cpython/pull/14859

___
Python tracker 

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



[issue37624] random.choices has unexpected behavior with negative weights

2019-07-19 Thread miss-islington


Change by miss-islington :


--
pull_requests: +14648
pull_request: https://github.com/python/cpython/pull/14858

___
Python tracker 

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



[issue36546] Add quantiles() to the statistics module

2019-07-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset eed5e9a9562d4dcd137e9f0fc7157bc3373c98cc by Raymond Hettinger in 
branch 'master':
bpo-36546:  Clean-up comments (GH-14857)
https://github.com/python/cpython/commit/eed5e9a9562d4dcd137e9f0fc7157bc3373c98cc


--

___
Python tracker 

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



[issue37624] random.choices has unexpected behavior with negative weights

2019-07-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset 8dbe563aa6bd18b8c581951537dfb406d36e8063 by Raymond Hettinger in 
branch 'master':
bpo-37624: Document weight assumptions for random.choices() (GH-14855)
https://github.com/python/cpython/commit/8dbe563aa6bd18b8c581951537dfb406d36e8063


--

___
Python tracker 

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



[issue13153] IDLE 3.x on Windows exits when pasting non-BMP unicode

2019-07-19 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Closed #37614 in favor of this.  

We now have only Python with FSR and mostly only tcl 8.6 to worry about.  But I 
presume the Windows clipboard still uses uft-16le.  Experimenting with pasting 
Ң or 'Ң', I usually get the 'ed' message as before, but with the quoted astral, 
IDLE somethings hangs.  If I wait before trying to close, I get a message from 
Windows about waiting or closing.

Currently, an attempt to print an astral char, as opposed to paste, results in
>>> print('\U0001')
Traceback (most recent call last):
  File "", line 1, in 
print('\U0001')
UnicodeEncodeError: 'UCS-2' codec can't encode character '\U0001' in 
position 0: Non-BMP character not supported in Tk
Improving this is a separate issue, as is editing a .py file with an astral 
char in the name or test.

--
title: IDLE 3.x on Windows crashes when pasting non-BMP unicode -> IDLE 3.x on 
Windows exits when pasting non-BMP unicode
versions: +Python 3.9 -Python 3.6

___
Python tracker 

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



[issue36546] Add quantiles() to the statistics module

2019-07-19 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
pull_requests: +14647
pull_request: https://github.com/python/cpython/pull/14857

___
Python tracker 

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



[issue37399] XML text behaviour change if there are comments

2019-07-19 Thread Stefan Behnel


Change by Stefan Behnel :


--
keywords: +patch
pull_requests: +14646
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/14856

___
Python tracker 

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



[issue37588] Py_DEPRECATED and unavoidable warnings

2019-07-19 Thread Inada Naoki


Inada Naoki  added the comment:

I think it's bad idea that suppressing deprecation warning to suppress the 
warning for deprecated member.

It is highly recommended to "not" touching tp_print.
Why you want to suppress deprecation warning, not missing field initialisers?

You can suppress the warninb by `-Wno-missing-field-initializers` compiler 
option or `#pragma GCC diagnostic ignored "-Wmissing-field-initializers"`.

--
nosy: +inada.naoki

___
Python tracker 

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



[issue37624] random.choices has unexpected behavior with negative weights

2019-07-19 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
pull_requests: +14645
pull_request: https://github.com/python/cpython/pull/14855

___
Python tracker 

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



[issue36044] PROFILE_TASK for PGO build is not a good workload

2019-07-19 Thread Inada Naoki


Inada Naoki  added the comment:

>./configure [...] --with-profile-task='-m test --pgo-extended'

I think this is abusing of `--with` options.  `--with-*` is for external 
software [1].  But `--with-lto` option abuses it already.

How about `./configure PROFILE_TASKS="-m test --pgo-extend"`?


[1]: 
https://www.gnu.org/software/autoconf/manual/autoconf-2.66/html_node/External-Software.html#External-Software

--

___
Python tracker 

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



[issue37628] IDLE Font Sample distracting and too large

2019-07-19 Thread Raymond Hettinger


New submission from Raymond Hettinger :

The "font sample" bar on the General tab in Preferences is problematio.  With 
some font sizes, it grows so large that there is no way to mouse downward to 
click "accept".  Making the window smaller and perhaps only showing one or two 
samples would be a big win.

Also consider having the window off by default and having a button to turn make 
it visible.  I've need seen a single user benefit from this garish display.

--
assignee: terry.reedy
components: IDLE
messages: 348150
nosy: rhettinger, terry.reedy
priority: normal
severity: normal
status: open
title: IDLE Font Sample distracting and too large
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue37627] Minor improvements to IDLE's "Run Customized"

2019-07-19 Thread Raymond Hettinger


New submission from Raymond Hettinger :

Today, I did some user testing for the 3.8 beta when teaching the argparse 
module.  The new "Run Customized" option needs two usability tweaks.  1) Move 
the menu option up by one so that the regular F5 "run" is last -- learners we 
having a hard time finding and mouse targeting the more commonly used regular 
"run" option.  2)  The text input widget should be pre-populated with the most 
recently run command-line.  This makes it easier to test variants of the same 
command rather retyping it on every invocation.  Even more desirable would be 
to have a multi-command history, but in the absence of that an editable single 
command history would suffice.

--
assignee: terry.reedy
components: IDLE
messages: 348149
nosy: rhettinger, terry.reedy
priority: normal
severity: normal
status: open
title: Minor improvements to IDLE's "Run Customized"
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue37614] Pasteing into idle makes it crash

2019-07-19 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

As said multiple times on #13153, IDLE exits with a traceback that is visible 
when it is started from a command line (python -m idlelib).  It usually ends 
with
  File "F:\dev\3x\lib\tkinter\__init__.py", line 1420, in mainloop
self.tk.mainloop(n)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 3: invalid 
continuation byte

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> IDLE 3.x on Windows crashes when pasting non-BMP unicode
type: crash -> behavior
versions: +Python 3.9 -Python 3.7

___
Python tracker 

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



[issue37620] str.split(sep=None, maxsplit=-1,any=False)

2019-07-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

This API is already overloaded with two distinct algorithms -- see 
https://stackoverflow.com/questions/16645083 .  If new functionality is truly 
needed, it should be in a separate method rather than feature creeping in 
additional variants.

Also, the OP's post seems to be grounded in an initial misreading of the docs 
rather than in compelling use cases for a new option.  So, there may be room 
for improving the documentation, especially the examples.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python, rhettinger
versions: +Python 3.9

___
Python tracker 

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



[issue37623] namedtuple integration for importlib.abc.Loader

2019-07-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Brett, do you have any thoughts on this?  My initial take is that __spec__ is 
primarily about import logic and that it likely shouldn't creep into exec'd 
code like dataclasses and named tuples.  Also, I'm reluctant to expand the API 
for something that looks like a one time use, especially when other 
alternatives are possible.

--
nosy: +brett.cannon
versions:  -Python 3.5, Python 3.6, 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



[issue31689] random.choices does not work with negative weights

2019-07-19 Thread Aldwin Pollefeyt


Aldwin Pollefeyt  added the comment:

issue37624: not adding an extra O(n) step to check for unusual inputs with 
undefined meaning -- that would just impair the normal use cases for near zero 
benefit.

--
nosy: +aldwinaldwin

___
Python tracker 

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



[issue37624] random.choices has unexpected behavior with negative weights

2019-07-19 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

We can add a note the the docs that weights are assumed to be non-negative, but 
I don't want to add an extra O(n) step to check for unusual inputs with 
undefined meaning -- that would just impair the normal use cases for near zero 
benefit.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python
priority: normal -> low

___
Python tracker 

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



[issue37547] Add _PyObject_CallMethodOneArg()

2019-07-19 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset d3952096537d9d2706e10af0c0596daeee6a58c9 by Inada Naoki (Zackery 
Spytz) in branch 'master':
bpo-37547: Fix a compiler warning in winconsoleio.c (GH-14785)
https://github.com/python/cpython/commit/d3952096537d9d2706e10af0c0596daeee6a58c9


--

___
Python tracker 

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



[issue37626] Documentation:conflict between docs

2019-07-19 Thread Inada Naoki


Inada Naoki  added the comment:

https://docs.python.org/3/library/inspect.html#inspect.Parameter.replace

"""
Changed in version 3.4: In Python 3.3 Parameter objects were allowed to have 
name set to None if their kind was set to POSITIONAL_ONLY. This is no longer 
permitted.
"""

--
nosy: +inada.naoki

___
Python tracker 

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