[issue40029] test_importlib.test_zip requires zlib but not marked

2020-03-21 Thread Karthikeyan Singaravelan


New submission from Karthikeyan Singaravelan :

I was trying to compile and run tests on a fresh ubuntu 18.03 machine that 
didn't zlib. test_importlb.test_zip seems to have some tests that depend on 
zlib but not marked as such causing test errors. Like other tests these could 
be skipped zlib is not available using test.support.requires_zlib . Tests are 
as below : 

test_zip_version
test_zip_entry_points
test_case_insensitive
test_files

--
components: Tests
messages: 364727
nosy: brett.cannon, xtreak
priority: normal
severity: normal
status: open
title: test_importlib.test_zip requires zlib but not marked
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



[issue39966] mock 3.9 bug: Wrapped objects without __bool__ raise exception

2020-03-21 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Amir, this needs a test like the initial report without preferably using 
sys.stdout and patch for cases below : 

1. Where the attribute is present on the wrapped object and uses it.
2. Where the attribute is not present on the wrapped object and uses the 
default value of the magic method.

@aviso Feel free to add in if I have missed any scenarios.

--

___
Python tracker 

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



[issue40013] CSV DictReader parameter documentation

2020-03-21 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This looks like a good clarification to me where None is clarified that it's 
the value of restval. DictWriter has a similar doc "The optional restval 
parameter specifies the value to be written if the dictionary is missing a key 
in fieldnames" at https://docs.python.org/3/library/csv.html#csv.DictWriter

--
nosy: +xtreak

___
Python tracker 

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



[issue40013] CSV DictReader parameter documentation

2020-03-21 Thread Juhana Jauhiainen


Change by Juhana Jauhiainen :


--
keywords: +patch
nosy: +Juhana.Jauhiainen
nosy_count: 3.0 -> 4.0
pull_requests: +18459
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19099

___
Python tracker 

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



[issue38945] Remove newline characters from uu encoding methods

2020-03-21 Thread Larry Hastings


Change by Larry Hastings :


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



[issue40030] Error with math.fsum() regarding float-point error

2020-03-21 Thread Mathias Talbo


New submission from Mathias Talbo :

An issue occurs when running the following code. 

import math
math.fsum([0.1, 0.2]), math.fsum([0.1, 0.7])

This should output 0.3, 0.8 respectively.

Instead, it output 0.30004, 0.7999

The very floating-point error it is trying to stop from occurring.

Thank you for your time.

--
components: Extension Modules
messages: 364730
nosy: Mathias Talbo
priority: normal
severity: normal
status: open
title: Error with math.fsum() regarding float-point error
type: behavior
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



[issue40028] Math module method to find prime factors for non-negative int n

2020-03-21 Thread Ross Rhodes

Ross Rhodes  added the comment:

Hi Tim,

Are there any open discussions or threads following the proposed “imath” 
module? I’m a relatively new entrant to the Python community, so if there’s any 
ongoing discussion on that front I’d be happy to read further.

I think as a first step it would be good to implement this logic for a limited 
range of non-negative n, imposing an upper limit (suggestions welcome) to make 
sure all provided input can be safely processed. We can then build from there 
to support larger n going forward if the demand is out there.

Ross

--

___
Python tracker 

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



[issue40028] Math module method to find prime factors for non-negative int n

2020-03-21 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> Are there any open discussions or threads following the proposed “imath” 
> module?

https://mail.python.org/archives/list/python-id...@python.org/message/YYJ5YJBJNCVXQWK5K3WSVNMPUSV56LOR/

Issue37132.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue40030] Error with math.fsum() regarding float-point error

2020-03-21 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This seems to be a similar case of 
https://docs.python.org/3/tutorial/floatingpoint.html. See also comment 
https://stackoverflow.com/questions/55534307/calculating-sum-of-float-numbers-using-math-fsum-showing-incorrect-values#comment97782231_55534307
 .

--
nosy: +mark.dickinson, xtreak

___
Python tracker 

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



[issue40029] test_importlib.test_zip requires zlib but not marked

2020-03-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +easy
stage:  -> needs patch

___
Python tracker 

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



[issue40030] Error with math.fsum() regarding float-point error

2020-03-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue40029] test_importlib.test_zip requires zlib but not marked

2020-03-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue40016] Clarify flag case in `re` module

2020-03-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I apologize if I was rude. It's only because of my bad English. There were many 
translation options for my words suggested by Google Translator and I obviously 
picked up the wrong one.

Improving documentation is always a good thing. But I leave the final decision 
to someone who is fluent in English.

--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python, mrabarnett, terry.reedy
type: behavior -> enhancement

___
Python tracker 

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



[issue40031] Python Configure IDLE 'Ok' and 'Apply' buttons do not seem to work.

2020-03-21 Thread Saaheer Purav


New submission from Saaheer Purav :

In Python 3.8.2 IDLE, when I try to select a new theme or change the font and 
font size in the Configure IDLE section, and click on 'Ok' or 'Apply', nothing 
happens. The buttons have no action. Even when I tried to press F5 to run 
module, nothing happened. In the 'config-keys.def' file, I edited the run 
module to 'F6' and tried to run module, but still nothing happened. However, 
when I edited the file back to 'F5' for run module, it worked, strangely. But 
still I am unable to select a new theme or change the font and font size as the 
buttons do not work.

--
assignee: terry.reedy
components: IDLE
messages: 364735
nosy: Vader27, terry.reedy
priority: normal
severity: normal
status: open
title: Python Configure IDLE 'Ok' and 'Apply' buttons do not seem to work.
type: behavior
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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-03-21 Thread hai shi


Change by hai shi :


--
pull_requests: +18460
pull_request: https://github.com/python/cpython/pull/19100

___
Python tracker 

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



[issue40011] Tkinter widget events become tuples

2020-03-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The problem is in ExceptionCatcher. It uses builtin function apply() which was 
outdated even in Python 2.7 and was removed in Python 3 (instead of apply(func, 
args) you can use func(*args)). So that code always failed, but all exceptions 
were logged and suppressed. You may see it in your logs at the start of the 
application.

--

___
Python tracker 

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



[issue39410] CentOS 6.10 SQLite 3.30.1 - _sqlite3 builds successfully but is removed because it cannot be imported.

2020-03-21 Thread Joshua Y


Joshua Y  added the comment:

I am hitting a possibly related issue.

System is running Centos6.9 and SQLite 3.10.0.

Python 3.8.2 built successfully (using pyenv / python-build), and I can import 
the sqlite3 lib with seemingly no issue...

% python3
Python 3.8.2 (default, Mar 21 2020, 20:15:25) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> from sqlite3.dbapi2 import *
>>> from _sqlite3 import *
>>> 


However, after I installed and ran jupyterhub, and attempted to log in, I hit 
the same 'undefined symbol' error 


[I 2020-03-21 21:42:52.465 JupyterHub spawner:1417] Spawning 
jupyterhub-singleuser --port=38433
Traceback (most recent call last):
  File 
"/opt/pyenv/versions/3.8.2/lib/python3.8/site-packages/notebook/services/sessions/sessionmanager.py",
 line 9, in 
import sqlite3
  File "/opt/pyenv/versions/3.8.2/lib/python3.8/sqlite3/__init__.py", line 23, 
in 
from sqlite3.dbapi2 import *
  File "/opt/pyenv/versions/3.8.2/lib/python3.8/sqlite3/dbapi2.py", line 27, in 

from _sqlite3 import *
ImportError: 
/opt/pyenv/versions/3.8.2/lib/python3.8/lib-dynload/_sqlite3.cpython-38-x86_64-linux-gnu.so:
 undefined symbol: sqlite3_close_v2

--
nosy: +Joshua Y

___
Python tracker 

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



[issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated

2020-03-21 Thread Stefan Behnel


Stefan Behnel  added the comment:

> I think Cython makes use of PEP-489 so unless I am missing something all 
> generated extensions use PEP-489 structures.

Cython doesn't make complete use of PEP-489 yet, specifically not of the module 
state feature (nor module subclasses). This change looks good from my side. 
Good idea, Victor.

--

___
Python tracker 

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



[issue24916] In sysconfig, don't rely on sys.version format

2020-03-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +18461
pull_request: https://github.com/python/cpython/pull/19101

___
Python tracker 

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



[issue40032] Remove explicit inheriting of object in class definitions

2020-03-21 Thread Julin


New submission from Julin :

In the source, many class definitions still explicitly inherit from `object` 
though it is no longer necessary in Python3.

Can't we change it?

--
components: Library (Lib)
messages: 364739
nosy: ju-sh
priority: normal
severity: normal
status: open
title: Remove explicit inheriting of object in class definitions
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



[issue28180] Implementation of the PEP 538: coerce C locale to C.utf-8

2020-03-21 Thread Matej Cepl

Matej Cepl  added the comment:

I have tried to port this patch to Python 3.4 (still maintained by SUSE on 
SLE-12), but I have the hardest time to debug this. All affected tests end with 
errors like this:

[  493s] ==
[  493s] FAIL: test_test_PYTHONCOERCECLOCALE_not_set 
(test.test_c_locale_coercion.LocaleCoercionTests) (PYTHONCOERCECLOCALE=None, 
env_var='LC_CTYPE', nominal_locale='invalid.ascii')
[  493s] --
[  493s] Traceback (most recent call last):
[  493s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.4.10/Lib/test/test_c_locale_coercion.py", 
line 326, in _check_c_locale_coercion
[  493s] coercion_expected)
[  493s]   File 
"/home/abuild/rpmbuild/BUILD/Python-3.4.10/Lib/test/test_c_locale_coercion.py", 
line 219, in _check_child_encoding_details
[  493s] self.assertEqual(encoding_details, expected_details)
[  493s] AssertionError: {'fse[79 chars]cii:strict', 'stderr_info': 
'ascii:backslashre[45 chars]ict'} != {'fse[79 chars]cii:surrogateescape', 
'stderr_info': 'ascii:ba[63 chars]ape'}
[  493s]   {'fsencoding': 'ascii',
[  493s]'lang': '',
[  493s]'lc_all': '',
[  493s]'lc_ctype': 'invalid.ascii',
[  493s]'stderr_info': 'ascii:backslashreplace',
[  493s] -  'stdin_info': 'ascii:strict',
[  493s] ? ^^ ^
[  493s] 
[  493s] +  'stdin_info': 'ascii:surrogateescape',
[  493s] ?++ ^^^ ^^^
[  493s] 
[  493s] -  'stdout_info': 'ascii:strict'}
[  493s] ?  ^^ ^
[  493s] 
[  493s] +  'stdout_info': 'ascii:surrogateescape'}
[  493s] ? ++ ^^^ ^^^

yes, it is always a conflict between strict and surrogateescape. I probably 
don’t have time to finish debugging this, so I am just leaving this for 
posterity.

--
nosy: +mcepl
Added file: 
https://bugs.python.org/file48991/pep538_coerce_legacy_c_locale.patch

___
Python tracker 

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



[issue39966] mock 3.9 bug: Wrapped objects without __bool__ raise exception

2020-03-21 Thread Amir Mohamadi


Change by Amir Mohamadi :


--
keywords: +patch
pull_requests: +18462
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/19102

___
Python tracker 

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



[issue40032] Remove explicit inheriting of object in class definitions

2020-03-21 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Code churn for no good reason is not a good idea. I cannot think of any good 
reasons to change this:

- it doesn't add new functionality;
- it doesn't fix bugs;
- it doesn't make the code easier to maintain;
- it makes the code LESS clear instead of more clear;
- PEP 8 doesn't have an opinion on whether to explicitly or implicitly inherit 
from object;
- but the Zen of Python ("import this") does.

Do you have any good reasons for removing the explicit inheritance from object?

--
nosy: +steven.daprano

___
Python tracker 

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



[issue40032] Remove explicit inheriting of object in class definitions

2020-03-21 Thread Julin


Julin  added the comment:

I just thought it looked different compared to the usual code that some of us 
were used to. Though it is probably familiar enough to the people who actually 
maintain the cpython code base.

I agree with everything that you mentioned with regards to what I could 
understand (No new functionality, no bug fix). Not experienced enough to know 
about what makes code more maintainable.


Why do you think it makes the code less clear, though?

--

___
Python tracker 

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



[issue40028] Math module method to find prime factors for non-negative int n

2020-03-21 Thread Ross Rhodes


Ross Rhodes  added the comment:

Hi Serhiy,

Thanks for sharing your thread. I support this proposal, and would be happy to 
help where time permits if we can gather sufficient support.

I inadvertently posted my support twice on your thread with no obvious means of 
deleting the duplicate post, since the first one had a delay appearing. 
Regardless, how can we best move forward with this idea?

Ross

--

___
Python tracker 

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



[issue40032] Remove explicit inheriting of object in class definitions

2020-03-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

We usually do not accept mass cosmetic changes. It messes the history and may 
break pending PRs. It also consumes the time of core developers for review and 
has a risk of introducing bugs.

--
nosy: +serhiy.storchaka
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



[issue40028] Math module method to find prime factors for non-negative int n

2020-03-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

> Regardless, how can we best move forward with this idea?

Provide a pull request.

--

___
Python tracker 

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



[issue24916] In sysconfig, don't rely on sys.version format

2020-03-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 684d2b9a071fa8e54749e0eec3c16aafcd642ed4 by Serhiy Storchaka in 
branch 'master':
bpo-24916: Remove an outdated comment. (GH-19101)
https://github.com/python/cpython/commit/684d2b9a071fa8e54749e0eec3c16aafcd642ed4


--

___
Python tracker 

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



[issue24916] In sysconfig, don't rely on sys.version format

2020-03-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue40028] Math module method to find prime factors for non-negative int n

2020-03-21 Thread Ross Rhodes


Ross Rhodes  added the comment:

Hi Serhiy,

> Provide a pull request.

Apologies, by "this idea" I should clarify I meant the "imath" module proposal. 
On this particular enhancement, yes, I'm happy to work on and later provide a 
pull request.

--

___
Python tracker 

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



[issue39652] sqlite3 bug handling column names that contain square braces

2020-03-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset b146568dfcbcd7409c724f8917e4f77433dd56e4 by Serhiy Storchaka in 
branch 'master':
bpo-39652: Truncate the column name after '[' only if PARSE_COLNAMES is set. 
(GH-18942)
https://github.com/python/cpython/commit/b146568dfcbcd7409c724f8917e4f77433dd56e4


--

___
Python tracker 

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



[issue39652] sqlite3 bug handling column names that contain square braces

2020-03-21 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 5.0 -> 6.0
pull_requests: +18463
pull_request: https://github.com/python/cpython/pull/19103

___
Python tracker 

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



[issue39652] sqlite3 bug handling column names that contain square braces

2020-03-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +18464
pull_request: https://github.com/python/cpython/pull/19104

___
Python tracker 

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



[issue40028] Math module method to find prime factors for non-negative int n

2020-03-21 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I don't know... To my mind, if we are going to support working with primes, the 
minimum API is:

- is_prime(n)
- next_prime(n)
- prev_prime(n)
- factorise(n)
- generate_primes(start=0)

(I trust the names are self-explanatory.)

There are various other interesting prime-related factors which can be built on 
top of those, but the above five are, in my opinion, a minimal useful set.

Factorising negative numbers is simple: just include a factor of -1 with the 
prime factors. We would probably want to also support factorising 0 and 1 even 
though they don't have prime factors. The alternative is to raise an exception, 
which I expect would be more annoying than useful.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue40028] Math module method to find prime factors for non-negative int n

2020-03-21 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Ross: 

"implement this logic for a limited range of non-negative n, imposing an upper 
limit (suggestions welcome) to make sure all provided input can be safely 
processed. We can then build from there to support larger n going forward if 
the demand is out there."

Urgh, please no! Arbitrary limits are horrible. Whatever maximum limit N you 
guess, somebody will want to factorise N+1. Consider this evidence of demand :-)

On what basis would you choose that limit? Basing it on the size of n is the 
wrong answer: factorising 2**1000 is easy, and will be found by trial 
division almost instantly, even though it's a large number with over three 
million digits.

Another question: since factorization can take a long time, should it be a 
generator that yields the factors as they are found?

--

___
Python tracker 

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



[issue40011] Tkinter widget events become tuples

2020-03-21 Thread Hênio Tierra Sampaio

Hênio Tierra Sampaio  added the comment:

Yes, you guys were right. I solved the problem by writing a new, simpler 
debugging class. I'm sorry for taking your time! Thank you!

--

___
Python tracker 

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



[issue39652] sqlite3 bug handling column names that contain square braces

2020-03-21 Thread miss-islington


miss-islington  added the comment:


New changeset 687f5921a46cf95c2a648d8031f9e99cdcc3e6b7 by Miss Islington (bot) 
in branch '3.8':
bpo-39652: Truncate the column name after '[' only if PARSE_COLNAMES is set. 
(GH-18942)
https://github.com/python/cpython/commit/687f5921a46cf95c2a648d8031f9e99cdcc3e6b7


--

___
Python tracker 

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



[issue39652] sqlite3 bug handling column names that contain square braces

2020-03-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 39680fb7043e555469e08d3c4f49073acca77b20 by Serhiy Storchaka in 
branch '3.7':
[3.7] bpo-39652: Truncate the column name after '[' only if PARSE_COLNAMES is 
set. (GH-18942). (GH-19104)
https://github.com/python/cpython/commit/39680fb7043e555469e08d3c4f49073acca77b20


--

___
Python tracker 

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



[issue40028] Math module method to find prime factors for non-negative int n

2020-03-21 Thread Ross Rhodes


Ross Rhodes  added the comment:

Hi Steven,

I agree, your set of proposed methods seem sensible to me. I'm happy to start 
with an implementation of at least some of those methods and open for review, 
taking this one step at a time for easier review and regular feedback.

> Another question: since factorization can take a long time, should it be a 
> generator that yields the factors as they are found?

Yes, I think a generator is a sensible shout. Happy to proceed with this 
suggestion.

Ross

--

___
Python tracker 

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



[issue39652] sqlite3 bug handling column names that contain square braces

2020-03-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue40032] Remove explicit inheriting of object in class definitions

2020-03-21 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Previous discussion: https://bugs.python.org/issue17351

--
nosy: +xtreak

___
Python tracker 

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



[issue40032] Remove explicit inheriting of object in class definitions

2020-03-21 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

On Sat, Mar 21, 2020 at 01:30:13PM +, Julin wrote:
> Why do you think it makes the code less clear, though?

Classes that inherit from object, and those which don't ("classic 
classes") behave differently in Python 2. But in Python 3, they are 
precisely the same.

Anyone who is familiar with Python 2, perhaps because they still have to 
deal with a legacy code base, or just because they learned using that 
version, will have to mentally adjust each time they see something which 
looks like a classic class, but actually is a new-style type.

Beginners who are only starting to learn Python may not understand the 
type hierarchy, and may believe that a class that doesn't explicitly 
inherit from object is a stand-alone class that doesn't inherit from 
object. Perhaps they have come from another language with different 
rules, or that lacks a single base object, like Python originally did.

--

___
Python tracker 

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



[issue40029] test_importlib.test_zip requires zlib but not marked

2020-03-21 Thread Roman Yurchak


Change by Roman Yurchak :


--
keywords: +patch
nosy: +rth
nosy_count: 2.0 -> 3.0
pull_requests: +18465
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/19105

___
Python tracker 

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



[issue40028] Math module method to find prime factors for non-negative int n

2020-03-21 Thread Jonathan Fine


Jonathan Fine  added the comment:

A pre-computed table of primes might be better. Of course, how long should the 
table be. There's an infinity of primes.

Consider
>>> 2**32
4294967296

This number is approximately 4 * (10**9). According to 
https://en.wikipedia.org/wiki/Prime_number_theorem, there are 50,847,534 primes 
less than 10**9. So, very roughly, there are 200,000,000 primes less than 2**32.

Thus, storing a list of all these prime numbers as 32 bit unsigned integers 
would occupy about
>>> 200_000_000 / (1024**3) * 4
0.7450580596923828
or in other words 3/4 gigabytes on disk.

A binary search into this list, using as starting point the expected location 
provided by the prime number theorem, might very well require on average less 
than two block reads into the file that holds the prime number list on disk. 
And if someone needs to find primes of this size, they've probably got a spare 
gigabyte or two.

I'm naturally inclined to this approach because by mathematical research 
involves spending gigahertz days computing tables. I then use the tables to 
examine hypotheses. See https://arxiv.org/abs/1011.4269. This involves subsets 
of the vertices of the 5-dimensional cube. There are of course 2**32 such 
subsets.

--
nosy: +jfine2358

___
Python tracker 

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



[issue39824] Multi-phase extension module (PEP 489): don't call m_traverse, m_clear nor m_free before the module state is allocated

2020-03-21 Thread STINNER Victor


STINNER Victor  added the comment:

> Cython doesn't make complete use of PEP-489 yet, specifically not of the 
> module state feature (nor module subclasses). This change looks good from my 
> side. Good idea, Victor.

Thanks for the confirmation Stefan ;-)

--

___
Python tracker 

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



[issue40033] Just defined class missing from scope

2020-03-21 Thread Damian Yurzola


New submission from Damian Yurzola :

In the following example the last line throws as 'NameError: name 'Level1A' is 
not defined' for both 3.7 and 3.8

I assumed that Level1A should already be in scope while defining the insides of 
Level1B. But it isn't.
Is this a bug, or am I missing something?


from typing import List, Union


class Level0A:
pass


class Level0B:
class Level1A:
subs: List[Level0A]

class Level1B:
subs: List[Level1A]

--
components: Interpreter Core
messages: 364759
nosy: yurzo
priority: normal
severity: normal
status: open
title: Just defined class missing from scope
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



[issue28180] Implementation of the PEP 538: coerce C locale to C.utf-8

2020-03-21 Thread STINNER Victor


STINNER Victor  added the comment:

Python 3.4 is no longer supported upstream. Python 3 got tons of Unicode fixes 
between Python 3.4 and Python 3.8.

--

___
Python tracker 

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



[issue40033] Just defined class missing from scope

2020-03-21 Thread Damian Yurzola


Damian Yurzola  added the comment:

This is even a better example:

Level1A is available to inherit from, but not to type with.

Example:

from typing import List


class Level0A:
pass


class Level0B:
class Level1A:
pass

class Level1B(Level1A):
pass

class Level1C:
test: Level1A

--

___
Python tracker 

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



[issue40034] cgi.parse() does not work with multipart POST requests.

2020-03-21 Thread San


New submission from San :

The cgi.parse stdlib function works in most cases but never works when given a 
multipart/form-data POST request because it does not set up pdict in a way 
cgi.parse_multipart() likes (boundary as bytes (not str) and including content 
length).




$ pwd
/tmp
$
$ /tmp/cpython/python --version
Python 3.9.0a4+
$
$ cat cgi-bin/example.cgi
#!/tmp/cpython/python
import sys, cgi
query_dict = cgi.parse()
write = sys.stdout.buffer.write
write("Content-Type: text/plain; charset=utf-8\r\n\r\n".encode("ascii"))
write(f"Worked, query dict is {query_dict}.\n".encode())
$
$ /tmp/cpython/python -m http.server --cgi & sleep 1
[1] 30201
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
$
$ # GET (url-encoded) requests work:
$ curl localhost:8000/cgi-bin/example.cgi?example_key=example_value
127.0.0.1 - - [20/Mar/2020 23:33:48] "GET 
/cgi-bin/example.cgi?example_key=example_value HTTP/1.1" 200 -
Worked, query dict is {'example_key': ['example_value']}.
$
$ # POST (multipart) requests do not:
$ curl localhost:8000/cgi-bin/example.cgi -F example_key=example_value
127.0.0.1 - - [20/Mar/2020 23:34:15] "POST /cgi-bin/example.cgi HTTP/1.1" 200 -
Traceback (most recent call last):
  File "/tmp/cgi-bin/example.cgi", line 3, in 
query_dict = cgi.parse()
  File "/tmp/cpython/Lib/cgi.py", line 159, in parse
return parse_multipart(fp, pdict)
  File "/tmp/cpython/Lib/cgi.py", line 201, in parse_multipart
boundary = pdict['boundary'].decode('ascii')
AttributeError: 'str' object has no attribute 'decode'
127.0.0.1 - - [20/Mar/2020 23:34:16] CGI script exit status 0x100
$
$ $EDITOR /tmp/cpython/Lib/cgi.py
$
$ # After changing cgi.parse POST (multipart) requests work:
$ curl localhost:8000/cgi-bin/example.cgi -F example_key=example_value
127.0.0.1 - - [20/Mar/2020 23:35:10] "POST /cgi-bin/example.cgi HTTP/1.1" 200 -
Worked, query dict is {'example_key': ['example_value']}.
$

--
components: Library (Lib)
messages: 364762
nosy: sangh
priority: normal
severity: normal
status: open
title: cgi.parse() does not work with multipart POST requests.
type: behavior
versions: Python 3.5, Python 3.6, 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



[issue40035] ilteration of the .txt file

2020-03-21 Thread Hamed Elahi


New submission from Hamed Elahi :

Hello,

I saw a problem when this line of code is used in Python 3:

settings = [line for line in settings if (line!='' and line[0] != '#')]

Before updating windows, this line of code filtered the texts from the 
beginning of .txt file, so only the first lines remained after filtration, but 
now, after windows update, it filters the texts so that the last rows of .txt 
file will remain after filtration.
Shouldn't a line of code acts the same in different updates?

--
components: Windows
messages: 364763
nosy: Hamed, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: ilteration of the .txt file
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



[issue40035] Filtration of the .txt file

2020-03-21 Thread Hamed Elahi


Hamed Elahi  added the comment:

Hello,

I saw a problem when this line of code is used in Python 3:

settings = [line for line in settings if (line!='' and line[0] != '#')]

Before updating windows, this line of code filtered the texts from the 
beginning of .txt file, so only the first lines remained after filtration, but 
now, after windows update, it filters the texts so that the last rows of .txt 
file will remain after filtration.
Shouldn't a line of code acts the same in different updates?

--
title: ilteration of the .txt file -> Filtration of the .txt file

___
Python tracker 

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



[issue40035] Filtration of the .txt file

2020-03-21 Thread Hamed Elahi


Hamed Elahi  added the comment:

Hello,

I saw a problem when this line of code is used in Python 3:

settings = [line for line in settings if (line!='' and line[0] != '#')]

Before updating windows, this line of code filtered the texts from the 
beginning of .txt file, so only the first lines remained after filtration, but 
now, after windows update, it filters the texts so that the last rows of .txt 
file will remain after filtration.
Shouldn't a line of code act the same in different updates?

--

___
Python tracker 

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



[issue40035] Filtration of the .txt file

2020-03-21 Thread Eric V. Smith


Eric V. Smith  added the comment:

What versions of Windows were involved? Are the versions of Python the same? 
What's the exact version? Best would be the 2 lines you get after running 
python, like:

$ python3
Python 3.7.4 (default, Jul 21 2019, 14:43:25)
[GCC 7.4.0] on cygwin

Please provide a short text file that shows this problem.

Also, show us how you're opening the file.

I've never heard of a Windows update causing a problem like this, so I suspect 
there's something else going on.

--
nosy: +eric.smith

___
Python tracker 

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



[issue28180] Implementation of the PEP 538: coerce C locale to C.utf-8

2020-03-21 Thread Matej Cepl

Matej Cepl  added the comment:

> Python 3.4 is no longer supported upstream. Python 3 got tons of Unicode 
> fixes between Python 3.4 and Python 3.8.

Of course, I know that, but I just didn’t want to throw all my effort away, 
when I spent some hours on making it. And I guess, there may be somebody else 
who cares for 3.4 (ehm, RHEL-7 has 3.3, doesn’t it?).

--

___
Python tracker 

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



[issue40035] Filtration of the .txt file

2020-03-21 Thread Hamed Elahi


Hamed Elahi  added the comment:

Windows 10 Home

Python 3.7.3 [MSC v.1916 64 bit (AMD64)] on win32

I open the file so etc.:

settings_file = open('settings.txt','r')
settings = [line.strip() for line in settings_file.readlines()]
# Filter out comments and empties
settings = [line for line in settings if (line!='' and line[0] != '#')]

I attach the .txt file.

I think the problem can be because of that line, because, before windows 
update, I used this .txt file and the first 4 parts of its content has been 
used to begin the program, but now, it sees that as None. The problem is with 
my new folders, when I create a new folder. It works different there, but in 
the old folders, it works as before.

--
Added file: https://bugs.python.org/file48992/settings.txt

___
Python tracker 

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



[issue40035] Filtration of the .txt file

2020-03-21 Thread Eric V. Smith


Eric V. Smith  added the comment:

So are you saying that you see this problem on the current version of Windows 
that you're running, but whether or not you see the problem depends on if the 
file was created before or after you updated Windows? How are you creating 
these files?

Does the file you attached show the problem or not? And could you explain 
exactly what you're seeing, versus what you're expecting to see? It's not clear 
from your last message. For example, what is the value of the variable 
"settings", and what do you expect it to be?

If you have two files on your system which currently show the problem, please 
attach them both, with different names, and tell us which one shows the problem 
and which one doesn't.

My only guess is that this is related to encodings or line endings.

--

___
Python tracker 

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



[issue28180] Implementation of the PEP 538: coerce C locale to C.utf-8

2020-03-21 Thread STINNER Victor


STINNER Victor  added the comment:

RHEL 7.7 and RHEL 8 provides Python 3.6. PEP 538 was implemented in Python 3.7. 
PEP 538 feature was backported in RHEL 7.7 and RHEL 8 Python 3.6.

--

___
Python tracker 

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



[issue40035] Filtration of the .txt file

2020-03-21 Thread Hamed Elahi


Hamed Elahi  added the comment:

I don't have any other windows to run on them, too. But, now, when I run .py 
file from older folders before updating windows, then I've got this problem or 
when I copy the folders and run .py file from these newly created folders.

See here:

I ran both files. See the result of filter:

First file:

['sampling:rate 0', 'sampling:depth 3', 'ch1:mapping 2', 'shared 1', 
'ch1:range_i 2', 'ch2:mapping 0', 'ch2:range_i 1', 'ch1:mapping 0', 
'ch1:range_i 0']


Second file:

['sampling:rate 0', 'sampling:depth 3', 'ch1:mapping 2', 'shared 1', 
'ch1:range_i 2', 'ch2:mapping 0', 'ch2:range_i 1', 'ch1:mapping 0', 
'ch1:range_i 0']

So, both of them give the same result after filtering, but see the result of 
program here:

First file:

0 0.000 -0.00 -0.000788


Second file:

0 0.000 160095.125000 -0.000525


So, as you see, the first file has None values, because of that, I'm getting 
that line of code with these values: -0.00 -0.000788

I sent an attachment before which is the file that give me the wrong result.

When I use a .txt file with 4 parts like the attachment, the program works 
correctly, but I wanted to know how I received different results from two 
folders from different times. So, It is not a big problem.

Sorry that I cannot give you more information, because I wrote this program for 
university, it is forbidden to send for others. And currently, I'm writing my 
thesis and testing new programs, so please do not reply to my message. Because 
I don't have time to answer the questions, now. But, when my thesis finishes 
after two months and I saw the problem is disturbing me another time, thus I 
will give you more information about it.
Thank you for your help.

--
Added file: https://bugs.python.org/file48993/settings.txt

___
Python tracker 

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



[issue40035] Filtration of the .txt file

2020-03-21 Thread Eric V. Smith


Eric V. Smith  added the comment:

I don't see a problem here. Your first file has more lines, so it produces more 
output than the second file. Presumably the difference in output you see when 
you run your program is a result of this. But since we can't see the code, we 
can't know for sure.

I don't see anything to make me think this is related to what version of 
Windows your program is running under, or that there's a bug in python. So I'm 
going to close this issue. If you can produce a program that demonstrates a bug 
in python, you can provide more details (including the full source code) and 
re-open this issue.

I suggest you look for help on the python-list mailing list: 
https://mail.python.org/mailman/listinfo/python-list

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



[issue40016] Clarify flag case in `re` module

2020-03-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The root confusion is that re compilation has several variations with two sets 
of indicators, each with an unhelpful exception, and each combined and used in 
different ways.

1. Module constants with uppercase English words or word pairs, also 
abbreviated by uppercase letters that are the first letter of the word -- 
except for S-DOTALL and X-VERBOSE.  As arguments for the flags parameter of 
functions other than escape and purge, they are combined with '|'.

2. Syntax letters within '(?...)', itself within an regex string, that are the 
single letter module constants lowercased b -- except that L is not lowercased 
because some fonts make l and 1 look nearly the same or even identical.  
Multiple syntax letters are combined by concatenation.

The additional issue for docstrings is the extreme compression, including the 
omission (here) of 're.' prefixes.  They are intended as reminders for those 
who have read and understood the full doc, but we try to make them as clear as 
possible.  I am working on an alternate revision.

--

___
Python tracker 

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



[issue40016] Clarify flag case in `re` module docstring

2020-03-21 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
title: Clarify flag case in `re` module -> Clarify flag case in `re` module 
docstring

___
Python tracker 

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



[issue40035] Filtration of the .txt file

2020-03-21 Thread Hamed Elahi


Hamed Elahi  added the comment:

No, the .txt files were the same, when I sent the results.

I send another .txt file to show the different, but the results were
created with the same .txt file for both runs.

Unfortunately, it is forbidden to send .py files.

On Sat, Mar 21, 2020 at 9:05 PM Eric V. Smith 
wrote:

>
> Eric V. Smith  added the comment:
>
> I don't see a problem here. Your first file has more lines, so it produces
> more output than the second file. Presumably the difference in output you
> see when you run your program is a result of this. But since we can't see
> the code, we can't know for sure.
>
> I don't see anything to make me think this is related to what version of
> Windows your program is running under, or that there's a bug in python. So
> I'm going to close this issue. If you can produce a program that
> demonstrates a bug in python, you can provide more details (including the
> full source code) and re-open this issue.
>
> I suggest you look for help on the python-list mailing list:
> https://mail.python.org/mailman/listinfo/python-list
>
> --
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue40031] Python Configure IDLE 'Ok' and 'Apply' buttons do not seem to work.

2020-03-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I have no problem with 3.8.2 on Windows 10.  Tal and Cheryl, what about your 
systems?

Saaheer, what OS, and if macOS, what version are you using?  (macOS Catalina 
has had some problems.)  How did you install or upgrade to 3.8.2?

--
nosy: +cheryl.sabella, taleinat

___
Python tracker 

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



[issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto()

2020-03-21 Thread Jonathan Hsu


Jonathan Hsu  added the comment:

While the current behavior may be initially unexpected, it does match the way 
that python normally behaves when defining class variables. For example, the 
following class will throw an exception because the function number_two() is 
called before it is defined:


class Numbers:
one = 1
two = number_two()

def number_two():
return 2

# NameError: name 'number_two' is not defined


However, this version is fine:


class Numbers:
one = 1

def number_two():
return 2

two = number_two()

--
nosy: +Jonathan Hsu

___
Python tracker 

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



[issue40036] Deleting duplicates in itertoolsmodule.c

2020-03-21 Thread AlphaHot


Change by AlphaHot :


--
nosy: AlphaHot
priority: normal
pull_requests: 18466
severity: normal
status: open
title: Deleting duplicates in itertoolsmodule.c
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



[issue36144] Dictionary union. (PEP 584)

2020-03-21 Thread Curtis Bucher


Change by Curtis Bucher :


--
pull_requests: +18467
pull_request: https://github.com/python/cpython/pull/19106

___
Python tracker 

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



[issue36144] Dictionary union. (PEP 584)

2020-03-21 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue40016] Clarify flag case in `re` module docstring

2020-03-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The docstring line in question is
  (?aiLmsux) Set the A, I, L, M, S, U, or X flag for the RE (see below).

This is exceptional in that other syntaxes in the special characters list use 
lower case only for syntax variables (m, n, name, id/name, yes, no).  Here, 
each letter is a separate and literal special character.  (Also exceptional is 
that the syntax given is illegal, as 'a', 'L', and 'u' are mutually exclusive.)

The corresponding doc entry starts
"(One or more letters from the set 'a', 'i', 'L', 'm', 's', 'u', 'x'.)
... the letters set the corresponding flags:" followed by 6 more lines.

I suggest the following as the replacement here (followed by more 'below').
  (?aiLmsux) The letters set the corresponding flags defined below.

I think 'letters' pretty clearly refers to 'a', 'i', ..., and 'x' as given, and 
that each 'corresponds' to and sets a flag that is a separate entity.

The more complicated inline flags syntax, "(?aiLmsux-imsx:...)", is omitted 
from the docstring.  Perhaps this is intentional.

The flag constants are currently introduced by
Some of the functions in this module takes flags as optional parameters:

My suggested more accurate and expanded replacement:
"Each function other than purge and escape can take an optional 'flags'  
argument consisting of one or more of the following module constants, joined by 
"|".  A, L, and U are mutually exclusive."

--

___
Python tracker 

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



[issue40016] Clarify flag case in `re` module docstring

2020-03-21 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

The docstring is currently 103 lines. I intentionally replaced 1 line with 1 
line that I believe to be more informative and kept the expansion of the other 
line to 3 lines.

--

___
Python tracker 

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



[issue24916] In sysconfig, don't rely on sys.version format

2020-03-21 Thread STINNER Victor


STINNER Victor  added the comment:

Since this issue has been closed, I closed PR 10321 and PR 18487.

--
nosy: +vstinner

___
Python tracker 

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



[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-03-21 Thread Paulo Henrique Silva


Change by Paulo Henrique Silva :


--
pull_requests: +18468
pull_request: https://github.com/python/cpython/pull/19107

___
Python tracker 

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



[issue40037] py_compile.py quiet undefined in main function

2020-03-21 Thread Vikash Balasubramanian


New submission from Vikash Balasubramanian :

I just had a random crash while using the autocomplete feature of Emacs.

The error message was basically thrown by py_compile.py:213

quiet is undefined. I tracked down the code and sure enough, there is a 
comparison

if quiet < 2:


Please confirm this.

--
components: Library (Lib)
messages: 364780
nosy: Vikash Balasubramanian
priority: normal
severity: normal
status: open
title: py_compile.py quiet undefined in main function
type: crash
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



[issue40037] py_compile.py quiet undefined in main function

2020-03-21 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This is a duplicate of https://bugs.python.org/issue38731

--
nosy: +xtreak

___
Python tracker 

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



[issue37207] Use PEP 590 vectorcall to speed up calls to range(), list() and dict()

2020-03-21 Thread Paulo Henrique Silva


Change by Paulo Henrique Silva :


--
nosy: +phsilva

___
Python tracker 

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



[issue39410] CentOS 6.10 SQLite 3.30.1 - _sqlite3 builds successfully but is removed because it cannot be imported.

2020-03-21 Thread Joshua Y


Joshua Y  added the comment:

It always a good idea to sleep on these things before I comment.

Because I compiled SQLite3 under prefix /usr/local, I rebuilt Python 3.8.2 with 
`-L /usr/local/lib64` added to my LDFLAGS and now things are working fine (so 
far).

--

___
Python tracker 

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



[issue40038] pathlib: remove partial support for preserving accessor when modifying a path

2020-03-21 Thread Barney Gale


New submission from Barney Gale :

`pathlib.Path._init()` accepts a 'template' argument that pathlib uses - in 
some cases - to preserve the current accessor object when creating modified 
path objects. This works for `resolve()`, `absolute()` and `readlink()`, *but 
no other cases*!

As customizing the accessor is not something we support (yet! see 
https://discuss.python.org/t/make-pathlib-extensible/3428), and the majority of 
path methods do not call `_init()` with a 'template' argument (and so do not 
preserve the accessor), I suggest this internal functionality be removed. 
Together with bpo-39682 / gh-18846, I believe this would allow us to remove 
`Path._init()` entirely, which would be a small performance win and a 
simplification of the code.

Demo:

```
import pathlib


class CustomAccessor(pathlib._NormalAccessor):
pass


def print_accessor(path):
if isinstance(path._accessor, CustomAccessor):
print("%r: custom" % path)
else:
print("%r: normal" % path)


print("Here's a path with a custom accessor:")
p = pathlib.Path("/tmp")
p._accessor = CustomAccessor()
print_accessor(p)

print("Our accessor type is retained in resolve(), absolute() and readlink():")
print_accessor(p.absolute())
print_accessor(p.resolve())
#print_accessor(p.readlink())

print("But not in any other path-creating methods!")
print_accessor(p.with_name("foo"))
print_accessor(p.with_suffix(".foo"))
print_accessor(p.relative_to("/"))
print_accessor(p / "foo")
print_accessor(p.joinpath("foo"))
print_accessor(p.parent)
print_accessor(p.parents[0])
print_accessor(list(p.iterdir())[0])
print_accessor(list(p.glob("*"))[0])
print_accessor(list(p.rglob("*"))[0])
#print_accessor(p.expanduser())
```

--
components: Library (Lib)
messages: 364783
nosy: barneygale
priority: normal
severity: normal
status: open
title: pathlib: remove partial support for preserving accessor when modifying a 
path
type: performance
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



[issue40025] enum: _generate_next_value_ is not called if its definition occurs after calls to auto()

2020-03-21 Thread Ethan Furman


Ethan Furman  added the comment:

Jonathan Hsu, you are correct -- and "don't do that" was my initial response; 
but Enum takes many pains to make sure the user doesn't shoot themselves in the 
foot, so raising a TypeError is appropriate instead of silently doing the wrong 
thing.

--

___
Python tracker 

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



[issue40039] [CVE-2020-10796] Python multiprocessing Remote Code Execution vulnerability

2020-03-21 Thread Junyu Zhang


Change by Junyu Zhang :


--
components: Library (Lib)
files: Python-multiprocessing-RCE-vulnerability.pdf
nosy: Junyu Zhang
priority: normal
severity: normal
status: open
title: [CVE-2020-10796] Python multiprocessing Remote Code Execution  
vulnerability
type: security
versions: Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.8
Added file: 
https://bugs.python.org/file48994/Python-multiprocessing-RCE-vulnerability.pdf

___
Python tracker 

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



[issue40028] Math module method to find prime factors for non-negative int n

2020-03-21 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I would just call gnu's gfactor for this task.

--
nosy: +rhettinger

___
Python tracker 

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



[issue40039] [CVE-2020-10796] Python multiprocessing Remote Code Execution vulnerability

2020-03-21 Thread Junyu Zhang


New submission from Junyu Zhang :

description:
When we were using python to develop a distributed process service, I noticed 
that the default serialization parameter of Manager and ManagerBase in 
multiprocessing was pickl, and it didn't seem to be mentioned in the official 
website's documentation. This is unsafe unless our server is completely You can 
trust recv data, but if authkey is not set or leaked, it will cause RCE on the 
server side, so I applied for a CVE-ID to remind everyone to use this security 
issue. For details of the vulnerability and the poc code, please refer to the 
pdf file.

--

___
Python tracker 

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



[issue26527] CGI library - Using unicode in header fields

2020-03-21 Thread Martin Panter

Martin Panter  added the comment:

I’m not an expert on the topic, but it sounds like this might be a duplicate of 
Issue 23434, which has more discussion.

--
nosy: +martin.panter
resolution:  -> duplicate
status: open -> pending
superseder:  -> support encoded filename in Content-Disposition for HTTP in 
cgi.FieldStorage

___
Python tracker 

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