[issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved

2021-04-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Sure. Thanks for the reminder.

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



[issue43695] Improve `=` in f-strings

2021-04-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think there is a slim chance of implementing similar feature in future. If 
once we implement pytest-like asserts, we will need to add special expression 
evaluator which saves all intermediate results of subexpressions and pass them 
to some hook (together with string representation of subexpressions). The same 
evaluator with different hook could be used for "="-substitutions in f-strings. 
So {a+b-c=} could be evaluated to "a=20, b=40, a+b=60, c=10, a+b-c=50". But it 
is too early to talk about it.

--

___
Python tracker 

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



[issue26053] regression in pdb output between 2.7 and 3.5

2021-04-01 Thread Irit Katriel

Irit Katriel  added the comment:

It’s fixed now. The tests failed when we merged this old PR. I guess they 
passed a few months ago but something changed in the meantime.
I don’t know if there’s something to do in the CI to prevent this (expire the 
test run after a while?)

If we want to backport then we need both PRs.

--

___
Python tracker 

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



[issue37804] Remove Thread.isAlive in Python 3.9

2021-04-01 Thread Jelle Zijlstra


Jelle Zijlstra  added the comment:

The threading documentation for 3.9 still claims "While they are not listed 
below, the camelCase names used for some methods and functions in this module 
in the Python 2.x series are still supported by this module." It would be 
better to mention when isAlive was removed.

The method is still used in some major libraries, like NLTK 
(https://github.com/nltk/nltk/blob/637af5380d6071517a5f0d224649e5c3560b5f91/nltk/inference/api.py#L536).
 Documenting the removal clearly in the threading docs would make it easier for 
developers to upgrade.

--
nosy: +Jelle Zijlstra

___
Python tracker 

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



[issue43702] [Windows] correctly sort and remove duplicates in _winapi getenvironment()

2021-04-01 Thread Eryk Sun


New submission from Eryk Sun :

getenvironment() in Modules/_winapi.c needs to sort variables in the 
environment block and remove duplicates case insensitively [1]. 

The sort order used to matter with SetEnvironmentVairableW(). As soon as it 
reached a name in the environment block that compared greater than the target 
name, it would insert a new variable. Nowadays, SetEnvironmentVairableW() 
searches the entire environment block before inserting a new value. Regardless, 
at the very least, getenvironment() is not well-behaved and not setting the 
environment in the documented sort order that users, and possibly other 
programs, expect.

Case-insensitive sorting in Windows uses upper case. The variable names in the 
mapping can be added to a list and sorted with a key function that's based on 
LCMapStringEx() [2], with the flag LCMAP_UPPERCASE. Loop over the sorted list 
to create the environment block. Remove duplicates by skipping a name that 
compares equal to the previously stored name according to 
CompareStringOrdinal() [3].

_winapi.LCMapStringEx(src, flags=LCMAP_UPPERCASE, locale=LOCALE_NAME_INVARIANT) 
could also be used in ntpath.normcase(), which would resolve bpo-42658.

---

[1] 
https://docs.microsoft.com/en-us/windows/win32/procthread/changing-environment-variables
[2] 
https://docs.microsoft.com/en-us/windows/win32/api/winnls/nf-winnls-lcmapstringex
[3] 
https://docs.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-comparestringordinal

--
components: Extension Modules, Windows
messages: 390038
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: [Windows] correctly sort and remove duplicates in _winapi 
getenvironment()
type: behavior
versions: Python 3.10, 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



[issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib

2021-04-01 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +23892
pull_request: https://github.com/python/cpython/pull/25145

___
Python tracker 

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



[issue43567] regen.vcxproj cannot regenerate some necessary files

2021-04-01 Thread Guido van Rossum


Guido van Rossum  added the comment:

Jiaxin: "Resolution: works for me" is meant for the triager to indicate that 
there is no bug, or at least that the repro given in the bug report doesn't 
trigger the bug in the triager's environment. It does *not* mean that a patch 
works for the submitter of the issue. But thanks for letting us know that 
Steve's patch works for you! :-)

--
resolution: works for me -> 

___
Python tracker 

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



[issue43700] Replace Zulip badge with Discourse badge in README

2021-04-01 Thread Zachary Ware


Zachary Ware  added the comment:

Thanks for the patch!

--
nosy: +zach.ware
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.10, 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



[issue43700] Replace Zulip badge with Discourse badge in README

2021-04-01 Thread miss-islington


miss-islington  added the comment:


New changeset 154f86f056c0f68cadd310e68fd2855f9fc9a5a8 by Miss Islington (bot) 
in branch '3.8':
bpo-43700: Replace Zulip badge with Discourse badge (GH-25141)
https://github.com/python/cpython/commit/154f86f056c0f68cadd310e68fd2855f9fc9a5a8


--

___
Python tracker 

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



[issue43700] Replace Zulip badge with Discourse badge in README

2021-04-01 Thread miss-islington


miss-islington  added the comment:


New changeset a217e0ab98e883a550da001e95cb3452c1a6b9da by Miss Islington (bot) 
in branch '3.9':
bpo-43700: Replace Zulip badge with Discourse badge (GH-25141)
https://github.com/python/cpython/commit/a217e0ab98e883a550da001e95cb3452c1a6b9da


--

___
Python tracker 

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



[issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib

2021-04-01 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 8bbfeb3330c10d52274bb85fce59ae614f0500bf by Inada Naoki in branch 
'master':
bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25142)
https://github.com/python/cpython/commit/8bbfeb3330c10d52274bb85fce59ae614f0500bf


--

___
Python tracker 

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



[issue43701] Add this optionality

2021-04-01 Thread Masoud Azizi


New submission from Masoud Azizi :

I want to rediuse two var togeder!
When i do that buy sum is rediuse to zero and not effect the sellsum
buySum[pair] -= sellSum[pair]
sellSum[pair] -= buySum[pair]

Cuz of that i try this statment but its not work!
Its a simple code that will python support it:

buySum[pair],sellSum[pair] -= sellSum[pair], buySum[pair]

Please add this optionallity to python

--
messages: 390032
nosy: mablue
priority: normal
severity: normal
status: open
title: Add this optionality
type: enhancement
versions: Python 3.10, 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



[issue43700] Replace Zulip badge with Discourse badge in README

2021-04-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23891
pull_request: https://github.com/python/cpython/pull/25144

___
Python tracker 

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



[issue43700] Replace Zulip badge with Discourse badge in README

2021-04-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +23890
pull_request: https://github.com/python/cpython/pull/25143

___
Python tracker 

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



[issue43700] Replace Zulip badge with Discourse badge in README

2021-04-01 Thread miss-islington


miss-islington  added the comment:


New changeset bef7b26f7229f8b7cde843118a7bc7e2b00f0372 by Erlend Egeberg 
Aasland in branch 'master':
bpo-43700: Replace Zulip badge with Discourse badge (GH-25141)
https://github.com/python/cpython/commit/bef7b26f7229f8b7cde843118a7bc7e2b00f0372


--
nosy: +miss-islington

___
Python tracker 

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



[issue43691] Comparison of OrderedDict() and dict()

2021-04-01 Thread Марк Коренберг

Марк Коренберг  added the comment:

Shame on me. You are right.

--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue43691] Comparison of OrderedDict() and dict()

2021-04-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

> There are no specifications regarding the question.

>From the OrderedDict docs:

"""
Equality tests between OrderedDict objects are order-sensitive and are 
implemented as list(od1.items())==list(od2.items()). Equality tests between 
OrderedDict objects and other Mapping objects are order-insensitive like 
regular dictionaries. This allows OrderedDict objects to be substituted 
anywhere a regular dictionary is used.
"""

Also, there are tests to verify these behaviors.  From 
Lib/test/test_ordered_dict.py:

def test_equality(self):
OrderedDict = self.OrderedDict
pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)]
shuffle(pairs)
od1 = OrderedDict(pairs)
od2 = OrderedDict(pairs)
self.assertEqual(od1, od2)  # same order implies equality
pairs = pairs[2:] + pairs[:2]
od2 = OrderedDict(pairs)
self.assertNotEqual(od1, od2)   # different order implies inequality
# comparison to regular dict is not order sensitive
self.assertEqual(od1, dict(od2))
self.assertEqual(dict(od2), od1)
# different length implied inequality
self.assertNotEqual(od1, OrderedDict(pairs[:-1]))



> Raising exception is the best thing since it will show 
> real bug in applications.

Changing the implementation now will break correct code that relies the 
documented behavior.  The change would also violate an intentional day one 
design goal to have ordered dictionaries be substitutable for regular dicts in 
existing code that may not have any concept of order.  Per PEP 372:

"""
Is the ordered dict a dict subclass? Why?

Yes. Like defaultdict, an ordered dictionary subclasses dict. Being a dict 
subclass make some of the methods faster (like __getitem__ and __len__). More 
importantly, being a dict subclass lets ordered dictionaries be usable with 
tools like json that insist on having dict inputs by testing isinstance(d, dict)
"""



> I don't agree.

That's not relevant.  The time to debate the merits of this API passed 13 years 
ago.  Guido made the final decision on the equality logic.  And now that the 
code is deployed and widely adopted, it is far too late to change it.

--

___
Python tracker 

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



[issue43691] Comparison of OrderedDict() and dict()

2021-04-01 Thread Марк Коренберг

Марк Коренберг  added the comment:

https://mail.python.org/pipermail/python-ideas/2015-December/037472.html

--

___
Python tracker 

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



[issue43691] Comparison of OrderedDict() and dict()

2021-04-01 Thread Марк Коренберг

Марк Коренберг  added the comment:

I don't agree. There are no specifications regarding the question. Since 
anything relying on specific implementation (not specification) should not be 
considered as something we should support or take care of.

Raising exception is the best thing since it will show real bug in applications.

--
resolution: not a bug -> 
status: closed -> open

___
Python tracker 

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



[issue26053] regression in pdb output between 2.7 and 3.5

2021-04-01 Thread Guido van Rossum


Guido van Rossum  added the comment:

Do you need my help here?

--

___
Python tracker 

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



[issue43549] Outdated descriptions for configuring valgrind.

2021-04-01 Thread Xinmeng Xia


Change by Xinmeng Xia :


--
type: behavior -> enhancement

___
Python tracker 

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



[issue27129] Wordcode, part 2

2021-04-01 Thread David Bolen


David Bolen  added the comment:

Unfortunately, not at the moment - what's in the buildbot log is what's 
available.  The RTL assertion aborts the process.

The tests involved (such as test_clinic) do seem reproducible in a few separate 
tries, though again, all they do is terminate.

As the assertion should be correct, I'm guessing it's reflecting an earlier 
corruption.  There's some other oddities, such as the "Leaf" related failures 
in test_peg_generator that showed up at the same time, in case that offers any 
hint.  Since Leaf and StringLeaf are almost next to each other in grammar.py I 
can't see how it can be undefined.

The worker only has the core build tools version of VS so can't directly debug 
this further locally.  I can look into using a different machine to try to get 
some details, but I'm not sure as to timing.

--

___
Python tracker 

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



[issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib

2021-04-01 Thread Inada Naoki


Change by Inada Naoki :


--
pull_requests: +23889
pull_request: https://github.com/python/cpython/pull/25142

___
Python tracker 

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



[issue27129] Wordcode, part 2

2021-04-01 Thread Mark Shannon


Mark Shannon  added the comment:

That assertion is correct, and hasn't changed.

Do you have a traceback?
The buildbot just shows the assertion message with no context.

--

___
Python tracker 

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



[issue43677] Descriptor.rst - Reference to Py_MethodType is not up to date

2021-04-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for the bug report.

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



[issue43677] Descriptor.rst - Reference to Py_MethodType is not up to date

2021-04-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset d104a786fff5980360056d908a2d952b42306171 by Miss Islington (bot) 
in branch '3.9':
bpo-43677: Fix a minor error in Doc/howto/descriptor.rst (GH-25123) (#25140)
https://github.com/python/cpython/commit/d104a786fff5980360056d908a2d952b42306171


--

___
Python tracker 

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



[issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib

2021-04-01 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 80017752ba938852d53f9d83a404b4ecd9ff2baa by Inada Naoki in branch 
'master':
bpo-43651: Fix test_compileall with PEP 597 (GH-25128)
https://github.com/python/cpython/commit/80017752ba938852d53f9d83a404b4ecd9ff2baa


--

___
Python tracker 

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



[issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib

2021-04-01 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset c0ec4486dc7dd70fea39d1473ac9a9ac568378fe by Inada Naoki in branch 
'master':
bpo-43651: Fix EncodingWarning in lib2to3/pgen2/pgen.py (GH-25127)
https://github.com/python/cpython/commit/c0ec4486dc7dd70fea39d1473ac9a9ac568378fe


--

___
Python tracker 

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



[issue43651] PEP 597: Fix EncodingWarning warnings in the Python stdlib

2021-04-01 Thread Inada Naoki


Inada Naoki  added the comment:


New changeset 036fc7de24cc961d65b60fba266104009feb2797 by Inada Naoki in branch 
'master':
bpo-43651: Fix EncodingWarning in test_warnings (GH-25126)
https://github.com/python/cpython/commit/036fc7de24cc961d65b60fba266104009feb2797


--

___
Python tracker 

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



[issue43695] Improve `=` in f-strings

2021-04-01 Thread Eric V. Smith


Eric V. Smith  added the comment:

I'm going to close this. I agree with Serhiy that it's pushing f-strings too 
far.

If you really want to pursue this, you'll need to specify the semantics much 
more clearly, and then bring it up on the python-ideas mailing list. But I 
don't want to give you false hope: I really don't think we'd ever accept this, 
given how complex it would be.

That said, thanks for making me think about how this would work!

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



[issue27129] Wordcode, part 2

2021-04-01 Thread David Bolen


David Bolen  added the comment:

Note that this commit appears to be causing exceptions for the Win10 buildbot, 
failing the PyCode_Addr2Line assertion in codeobject.c line 1252.

The assertion seems to pop up at differing points during each test run, but the 
builder has yet to complete a full test run successfully.

--
nosy: +db3l

___
Python tracker 

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



[issue43700] Replace Zulip badge with Discourse badge in README

2021-04-01 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


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

___
Python tracker 

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



[issue43700] Replace Zulip badge with Discourse badge in README

2021-04-01 Thread Erlend Egeberg Aasland


New submission from Erlend Egeberg Aasland :

Suggesting to follow the dev guide and replace the Zulip badge with a Discourse 
badge in README.rst.

Quoting the dev guide, section 2.4. Zulip:
"This is no longer actively monitored by core devs. Consider asking your 
questions on Discourse or on the python-dev mailing list."


See also:
- https://python.zulipchat.com
- https://devguide.python.org/help/#zulip
- https://discuss.python.org/t/discourse-github-integration/355
- https://github.com/python/devguide/issues/625
- https://github.com/python/devguide/pull/630

--
assignee: docs@python
components: Documentation
messages: 390016
nosy: Mariatta, docs@python, erlendaasland, willingc
priority: normal
severity: normal
status: open
title: Replace Zulip badge with Discourse badge in README

___
Python tracker 

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



[issue43699] ERROR: Could not find a version that satisfies the requirement MetaTrader5

2021-04-01 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> third party
status: open -> pending

___
Python tracker 

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



[issue43699] ERROR: Could not find a version that satisfies the requirement MetaTrader5

2021-04-01 Thread Irit Katriel


Irit Katriel  added the comment:

Why do you think this is a python bug?

--
nosy: +iritkatriel

___
Python tracker 

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



[issue43697] Importlib documentation does not cover how meta path finders should handle namespace packages

2021-04-01 Thread Brett Cannon

Brett Cannon  added the comment:

> What I've never really got clear in my mind is how dotted names get handled.

Essentially:

1. Check if parent is imported; if not then import (working your way all the 
way back to the top if necessary)
2. Ask the sys.meta_path finders if they can handle the module
3. Use the loader from the spec
4. Add the imported module as an attribute on the parent

If you start from 
https://github.com/python/cpython/blob/master/Lib/importlib/__init__.py#L108 
you can see how it all works. The Python code is actually not that complicated, 
especially if you ignore all the old PEP 302 compatibility code 😉.

--

___
Python tracker 

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



[issue41638] Error message: sqlite3.ProgrammingError: You did not supply a value for binding # might be improved

2021-04-01 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Can this be closed, Serhiy?

--
nosy: +erlendaasland

___
Python tracker 

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



[issue43697] Importlib documentation does not cover how meta path finders should handle namespace packages

2021-04-01 Thread Paul Moore


Paul Moore  added the comment:

> if they return a spec they can, if they don't then they can't

What I've never really got clear in my mind is how dotted names get handled. 
But that's probably just a matter of needing to experiment a bit (I don't think 
it's particularly complicated, I just need to get a better feel for it).

> https://docs.python.org/3/reference/import.html#namespace-packages

Ouch. I'd completely missed how much there is in there. Sorry about that, I 
should have done my research.

Thanks for the help.

--

___
Python tracker 

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



[issue17519] unittest should not try to run abstract classes

2021-04-01 Thread Stephen Thorne


Stephen Thorne  added the comment:

I have done some experimentation here and thought through this feature request.

The concept we are trying to deliver is: "I would like to share functionality 
between test classes, by having an abstract parent, with concrete leaves"

The metaclass abc.ABCMeta provides functionality that means two things:

 - any class with this metaclass (so the class and all its subclasses, 
typically) that have @abc.abstractmethod or @abc.abstractproperty decorated 
methods will be treated as abstract
 - any class that is treated as abstract will raise an exception immediately, 
to make it clear to the programmer (and unit tests) that a programming error 
has occured.

Following this through, we end up with two ways in which this can go  wrong in 
unit testing if we ask our unit testing framework to not test abstract classes.

This is a complete example, with both failure modes illustrated:

Consider:

class AbstractTestCase(unittest.TestCase, metaclass=abc.ABCMeta):
  ...

class FooTest(AbstractTestCase):
  def foo(self):
return 1

In this case, AbstractTestCase will not be skipped: this is because without any 
abstract methods inside it: it's not actually considered 'abstract', and is a 
concrete class.

In the second case:

class AbstractTestCase(unittest.TestCase, metaclass=abc.ABCMeta):
  @abc.abstractmethod
  def foo(self):
...

  @abc.abstractmethod
   def bar(self):
...

class FooTest(AbstractTestCase):
  def foo(self):
return 1

In this case, because AbstractTestCase has 2 abstract methods, it will be 
skipped. No tests run. But also FooTest will be skipped because it has 1 
abstract method, and is therefore also abstract.

If this were a 'normal' program, we would see an exception raised when FooTest 
is instanciated, but because we're skipping tests in abstract classes, we skip 
all the tests and exit with success.

My gut feeling on this is that what we really want is a decorator that says: 
Skip this class, and only this class, explicitly. All subclasses are concrete, 
only this one is abstract.

--
nosy: +sthorne

___
Python tracker 

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



[issue43699] ERROR: Could not find a version that satisfies the requirement MetaTrader5

2021-04-01 Thread André Luís Lopes da Silva

New submission from André Luís Lopes da Silva :

Dear,

I am trying to install MetaTrader5 via pip. But this return this message:

Defaulting to user installation because normal site-packages is not writeable
WARNING: Keyring is skipped due to an exception: Failed to unlock the keyring!
ERROR: Could not find a version that satisfies the requirement MetaTrader5
ERROR: No matching distribution found for MetaTrader5

I use linux ubuntu.

Thanks

--
components: Installation
messages: 390010
nosy: andre_luis
priority: normal
severity: normal
status: open
title: ERROR: Could not find a version that satisfies the requirement 
MetaTrader5
versions: Python 3.6

___
Python tracker 

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



[issue43697] Importlib documentation does not cover how meta path finders should handle namespace packages

2021-04-01 Thread Brett Cannon


Change by Brett Cannon :


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

___
Python tracker 

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



[issue43694] Tkinter scaling does not work on some linux systems

2021-04-01 Thread A_D


A_D  added the comment:

Thanks so much for your help. To anyone in the future trying to figure this 
out: Apparently the default opensuse fonts (which are noto) are _not_ scalable. 
In my testing the following is enough to solve the issue.

```
tk.font.nametofont('TkDefaultFont').configure(family='DejaVu Sans', size=10)
```

--

___
Python tracker 

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



[issue43697] Importlib documentation does not cover how meta path finders should handle namespace packages

2021-04-01 Thread Brett Cannon

Brett Cannon  added the comment:

> I'm not sure where namespace packages are documented

https://docs.python.org/3/reference/import.html#namespace-packages

> I'm not at all sure what would happen if we have meta path finders A and B  
> on sys.meta_path in that order, and A.find_spec("foo.bar") returns a spec, 
> but A.find_spec("foo") doesn't and B.find_spec("foo") does.

Nothing special. The import system just asks the meta path finder whether they 
can handle a module, and if they return a spec they can, if they don't then 
they can't. So it is of no concern whether two different meta path importers 
handle the same package for whatever reason. A successful import is a 
successful import. 😁

--

___
Python tracker 

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



[issue43692] Raise SyntaxError on implicit string concatentation in list

2021-04-01 Thread Carsten Docktor


Carsten Docktor  added the comment:

I'd consider this a bug, because I find it quite error prone.  But I get the 
point that it might be currently used.

Thank you for your response. 
I'll rely on third party checkers for this.

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



[issue26053] regression in pdb output between 2.7 and 3.5

2021-04-01 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset bd4ab8e73906a4f12d5353f567228b7c7497baf7 by Irit Katriel in 
branch 'master':
bpo-26053: Fix test_pdb.test_issue26053() (GH-25139)
https://github.com/python/cpython/commit/bd4ab8e73906a4f12d5353f567228b7c7497baf7


--
nosy: +vstinner

___
Python tracker 

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



[issue43694] Tkinter scaling does not work on some linux systems

2021-04-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

AFAIK X Window uses two font systems: for bitmap fonts and for scalable fonts. 
If default fonts on your system are bitmap fonts, they are not scaled.

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



[issue43698] Use syntactically correct examples on abc package page

2021-04-01 Thread Vladimir Ryabtsev


New submission from Vladimir Ryabtsev :

There are code snippets on the package's page 
(https://docs.python.org/3.10/library/abc.html) like this:

class C(ABC):
@classmethod
@abstractmethod
def my_abstract_classmethod(cls, ...):
...

Here, the author probably wanted to demonstrate that the method may have _any 
other arguments_ in addition to `cls`, but it makes the code not compilable:

def my_abstract_classmethod(cls, ...):
 ^
SyntaxError: invalid syntax

Additionally it uses the same Ellipsis as in the method's body (that is 
supposed to indicate a stub), which is confusing.

I think that all code samples must be syntactically correct, so that if a 
reader copypastes them into their code editor they would work right away. I 
suggest to remove ellipsis in the argument lists everywhere on the page and 
replace them with one of the following:

- sample parameters such as `a, b, c` or `my_arg1, my_arg2`,
- `*args, **kwargs`,
- nothing.

--
assignee: docs@python
components: Documentation
messages: 390004
nosy: Vladimir Ryabtsev, docs@python
priority: normal
severity: normal
status: open
title: Use syntactically correct examples on abc package page
type: compile error
versions: Python 3.10, 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



[issue43697] Importlib documentation does not cover how meta path finders should handle namespace packages

2021-04-01 Thread Paul Moore


Paul Moore  added the comment:

OK, cool. That might be worth explaining somewhere in the docs (although I 
don't really know where, as I'm not sure where namespace packages are 
documented, either :-))

I'm not at all sure what would happen if we have meta path finders A and B  on 
sys.meta_path in that order, and A.find_spec("foo.bar") returns a spec, but 
A.find_spec("foo") doesn't and B.find_spec("foo") does. I think the honest 
answer is "I get a headache" ;-)

--

___
Python tracker 

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



[issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF)

2021-04-01 Thread STINNER Victor


Change by STINNER Victor :


Added file: https://bugs.python.org/file49927/bench.patch

___
Python tracker 

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



[issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF)

2021-04-01 Thread STINNER Victor


Change by STINNER Victor :


Added file: https://bugs.python.org/file49926/bench_testcapi.py

___
Python tracker 

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



[issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF)

2021-04-01 Thread STINNER Victor


Change by STINNER Victor :


Added file: https://bugs.python.org/file49925/bench_limited.py

___
Python tracker 

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



[issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF)

2021-04-01 Thread STINNER Victor


STINNER Victor  added the comment:

I wrote a microbenchmark on Py_INCREF()+Py_DECREF():

$ python3 -m pyperf compare_to ref.json limited.json 
Mean +- std dev: [ref] 3.45 ns +- 0.17 ns -> [limited] 6.03 ns +- 0.21 ns: 
1.75x slower

If a function is only made of Py_INCREF() and Py_DECREF(), it can be up to 1.8x 
slower in the worst case. But in practice, I don't think that functions are 
only made of Py_INCREF() and Py_DECREF(). They do a few other things.

I'm not sure how to run a "macro benchmark" on my PR 25131, since I don't know 
any C extension doing anything useful. There is xxlimited, but it does almost 
nothing.

What would be a fair benchmark for this change?

--

To run my microbenchmark:

git apply bench.patch
./configure --with-lto --enable-optimizations
make
./python -m venv env
./env/bin/python -m pip install pyperf
./env/bin/python ../bench_limited.py -o ../limited.json -v
./env/bin/python ../bench_testcapi.py -o ../ref.json -v

--

___
Python tracker 

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



[issue43677] Descriptor.rst - Reference to Py_MethodType is not up to date

2021-04-01 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue43677] Descriptor.rst - Reference to Py_MethodType is not up to date

2021-04-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:


New changeset e689cdca3c14aab8d2d454b79ddd661b238fd301 by Zackery Spytz in 
branch 'master':
bpo-43677: Fix a minor error in Doc/howto/descriptor.rst (#25123)
https://github.com/python/cpython/commit/e689cdca3c14aab8d2d454b79ddd661b238fd301


--

___
Python tracker 

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



[issue43697] Importlib documentation does not cover how meta path finders should handle namespace packages

2021-04-01 Thread Brett Cannon


Brett Cannon  added the comment:

There is no mechanism as the entire concept of a namespace package is 
implemented in importlib.machinery.PathFinder itself and not the generic import 
system (see 
https://github.com/python/cpython/blob/652bfdee9495dca241d48278742fe035b7a82bdb/Lib/importlib/_bootstrap_external.py#L1339-L1369).
 So at the sys.meta_path level, the entire concept of namespace packages isn't 
even a thing; namespace packages only exist because FileFinder itself makes 
namespace package possible.

--

___
Python tracker 

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



[issue43677] Descriptor.rst - Reference to Py_MethodType is not up to date

2021-04-01 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee: docs@python -> rhettinger

___
Python tracker 

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



[issue43691] Comparison of OrderedDict() and dict()

2021-04-01 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Unfortunately, the existing behaviors are guaranteed and cannot be changing 
without breaking code — the OrderedDict class was designed to be mostly 
substitutable for regular dicts in existing code.

Personally, I think it would have been better if OrderedDict equality always 
worked the same way a dict equality, but I was overruled and that ship sailed 
long ago.  It is what it is.

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



[issue43694] Tkinter scaling does not work on some linux systems

2021-04-01 Thread A_D


A_D  added the comment:

Okay that makes sense to me. But then my next question is, why does this work 
on some linux systems and not others without having a specified font? 

Something funky about the font size? because I'd expect the platform defaults 
to at least be the same on different linux systems.

--

___
Python tracker 

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



[issue26053] regression in pdb output between 2.7 and 3.5

2021-04-01 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +23886
pull_request: https://github.com/python/cpython/pull/25139

___
Python tracker 

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



[issue43697] Importlib documentation does not cover how meta path finders should handle namespace packages

2021-04-01 Thread Eric V. Smith


Change by Eric V. Smith :


--
nosy: +eric.smith

___
Python tracker 

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



[issue43697] Importlib documentation does not cover how meta path finders should handle namespace packages

2021-04-01 Thread Paul Moore


New submission from Paul Moore :

I am trying to write a meta path finder that "redirects" module loads to a 
different part of the filesystem. There's not much information in the importlib 
documentation, but PEP 451 says "find_spec() must return a spec with "loader" 
set to None (a.k.a. not set) and with submodule_search_locations set to the 
same portions as would have been provided by find_loader()".

I have done that, and it does work as long as all parts of the namespace 
package are handled by the *same* metapath loader. But if I have (for instance) 
one portion of the namespace package handled by my finder, and want to leave 
the filesystem finder to handle other parts, that doesn't work.

Is there a supported way to set up a finder on sys.meta_path which will expose 
just one "portion" of a namespace package?

--
assignee: brett.cannon
components: Documentation
messages: 389997
nosy: brett.cannon, paul.moore
priority: normal
severity: normal
status: open
title: Importlib documentation does not cover how meta path finders should 
handle namespace packages
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



[issue12657] Cannot override JSON encoding of basic type subclasses

2021-04-01 Thread Samuel Freilich


Samuel Freilich  added the comment:

A fully general solution for this might require a separate way to override the 
behavior for serializing dict keys (since those have to be serialized as 
strings).

--

___
Python tracker 

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



[issue26053] regression in pdb output between 2.7 and 3.5

2021-04-01 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 652bfdee9495dca241d48278742fe035b7a82bdb by Irit Katriel in 
branch 'master':
bpo-26053: Fix args echoed by pdb run command (#22033)
https://github.com/python/cpython/commit/652bfdee9495dca241d48278742fe035b7a82bdb


--
nosy: +gvanrossum

___
Python tracker 

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



[issue12657] Cannot override JSON encoding of basic type subclasses

2021-04-01 Thread Samuel Freilich


Samuel Freilich  added the comment:

> A modern solution for this is to define a singledispatch function (with 
> implementations for your custom types) and pass it as the `default` parameter 
> to the dump functions.

Does that work? I thought the default function only got called for 
non-serializable types.

I'm running into the same issue with some code that would like to do round-trip 
serialization of a datastructure (which doesn't need 100% generality of 
supported values but would like to deal with the existing structure of types). 
Dealing with set is easy, for example:

def default(obj):  # pass to default parameter of json.dumps
  if isinstance(obj, frozenset):
return {'_class': 'set', 'items': list(obj)}
  ...

def object_hook(obj):  # pass to object_hook parameter of json.loads
  if obj.get('_class') == 'set':
return set(decoded_dict['items'])
  ...

But you can't do the equivalent thing for tuple, even if you override 
encode/iterencode. It seems like the JSON module is making performance versus 
generality tradeoffs, it doesn't make a fresh call to encode/iterencode for 
every dict key/value for example. Which is fine, but it would be nice if there 
was a mode that allowed getting custom behavior for every type, taking the 
performance cost.

--
nosy: +sfreilich

___
Python tracker 

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



[issue43683] Handle generator (and coroutine) state in the bytecode.

2021-04-01 Thread Mark Shannon


Change by Mark Shannon :


--
pull_requests: +23885
pull_request: https://github.com/python/cpython/pull/25138

___
Python tracker 

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



[issue31466] No easy way to change float formatting when subclassing encoder.JSONEncoder

2021-04-01 Thread Samuel Freilich


Samuel Freilich  added the comment:

I think the less-minor issue, of which this is a small subset, is that 
JSONEncoder doesn't allow changing the behavior for default-serializable types 
at all. That means you can't choose to lose less information in round-trip 
serialization/deserialization, if that's what you want (e.g. there's no way to 
round-trip serialize a tuple with JSONEncoder, though it's trivial to do that 
for a set).

--
nosy: +sfreilich

___
Python tracker 

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



[issue43692] Raise SyntaxError on implicit string concatentation in list

2021-04-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is valid Python syntax, so SyntaxErorr cannot be raised.

SyntaxWarning is an option, but the Python compiler only emits it if we 
absolutely sure that the code contains a bug (either it does not work as 
intended or can work differently on other implementations or in future Python 
releases). And I am afraid that a lot of correct code (including the stdlib) 
contains implicit string concatentation in list.

It is better to left such warning on third-party checkers which have options to 
control what warnings to emit, and not enable it by default.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue27129] Wordcode, part 2

2021-04-01 Thread Mark Shannon


Mark Shannon  added the comment:


New changeset fcb55c0037baab6f98f91ee38ce84b6f874f034a by Mark Shannon in 
branch 'master':
bpo-27129: Use instruction offsets, not byte offsets, in bytecode and 
internally. (GH-25069)
https://github.com/python/cpython/commit/fcb55c0037baab6f98f91ee38ce84b6f874f034a


--

___
Python tracker 

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



[issue43694] Tkinter scaling does not work on some linux systems

2021-04-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The size of of the window is determined by the size of its components. The size 
of the label and the munu is determined by the size of the font. If font has 
the same size and you output the same string (or string containing characters 
of the same proportion) you will get windows with the same size.

--

___
Python tracker 

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



[issue43694] Tkinter scaling does not work on some linux systems

2021-04-01 Thread A_D


A_D  added the comment:

I'd expect the windows themselves to change size based on the percentage 
requested. eg as shown here 
https://user-images.githubusercontent.com/4589845/95577562-0a794500-0a3b-11eb-914e-9a5afc500b65.png
 (semirelated issue: https://github.com/EDCD/EDMarketConnector/issues/750 )

--

___
Python tracker 

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



[issue43694] Tkinter scaling does not work on some linux systems

2021-04-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

What did you expect to get?

--

___
Python tracker 

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



[issue43694] Tkinter scaling does not work on some linux systems

2021-04-01 Thread A_D


A_D  added the comment:

I wasnt referring to fonts, I was refering to window scaling in general, which 
includes widgets and other things. Which are _also_ not being scaled correctly.

The example code doesnt mess with fonts at all either, which either means the 
default behaves in an unexpected manner, or just that as I said scaling just 
straight doesnt work.

--

___
Python tracker 

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



[issue43695] Improve `=` in f-strings

2021-04-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think it goes too far. It was initially designed as a simple for 
implementation and use feature which covers a large amount of use cases of 
using f-strings for debugging. You propose to add syntactically a new postfix 
operator which is valid only in "="-substisutions in f-strings, with complex 
semantic. It would be difficult to implement, and it would significantly 
complicate Python grammar. Also it will prevent using ? for other purposes in 
Python expressions in future.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue43694] Tkinter scaling does not work on some linux systems

2021-04-01 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

>From "man font":

FONT OPTIONS

   -size size
  The desired size of the font.  If the size argument is  a  posi‐
  tive  number, it is interpreted as a size in points.  If size is
  a negative number, its absolute value is interpreted as  a  size
  in pixels.  If a font cannot be displayed at the specified size,
  a nearby size will be chosen.  If size is unspecified or zero, a
  platform-dependent default size will be chosen.

  Sizes  should normally be specified in points so the application
  will remain the same ruler size on the screen, even when  chang‐
  ing screen resolutions or moving scripts across platforms.  How‐
  ever, specifying pixels is useful in certain circumstances  such
  as  when  a  piece of text must line up with respect to a fixed-
  size bitmap.  The mapping between points and pixels is set  when
  the  application  starts,  based  on properties of the installed
  monitor, but it can be overridden by calling the tk scaling com‐
  mand.

If the font size is specified in absolute pixels the scaling factor does not 
affect it.

See fix_scaling() in Lib/idlelib/run.py for example how to handle this problem.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue43695] Improve `=` in f-strings

2021-04-01 Thread Eric V. Smith


Eric V. Smith  added the comment:

I don't see how this would be possible in general. What would you do with a 
function call that has side effects?

f'{a()+b+c=}'

?

You'd end up calling a() twice, or inventing your own expression evaluator.

--
nosy: +eric.smith

___
Python tracker 

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



[issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF)

2021-04-01 Thread STINNER Victor


STINNER Victor  added the comment:

> New changeset baf10da75072d1f8ec714d3c2c8550d34db343a9 by Victor Stinner in 
> branch 'master':
> bpo-43688: Run make regen-limited-abi (GH-25134)

With this change, "Tests / Check if generated files are up to date" job started 
fails (on PR 25135): "Some symbols from the limited API are missing: 
PyType_HasFeature".

I fixed this issue in bpo-43690 which removes PyType_HasFeature from 
Doc/data/stable_abi.dat.

--

___
Python tracker 

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



[issue23979] Multiprocessing Pool.map pickles arguments passed to workers

2021-04-01 Thread Socob


Change by Socob <206a8...@opayq.com>:


--
nosy: +Socob

___
Python tracker 

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



[issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF)

2021-04-01 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 2ac0515027699b5694d9a6ff40f1ddaba82c74c2 by Victor Stinner in 
branch 'master':
bpo-43688: Fix Py_LIMITED_API version of xxlimited (GH-25135)
https://github.com/python/cpython/commit/2ac0515027699b5694d9a6ff40f1ddaba82c74c2


--

___
Python tracker 

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



[issue43696] High cpu usage using asyncio streams

2021-04-01 Thread Роман Коптев

New submission from Роман Коптев :

Hi. I have a high cpu usage using asyncio streams/sockets with connection pool 
(I tried on cpython 3.8-3.9 on mac and debian). Seems some noop handler is 
continously called polling ports in selectors.
Here is a simple example to reproduce 
https://github.com/romikforest/asyncio_streams_high_cpu_usage2

Thank you a lot if you can take a look.

--
components: asyncio
messages: 389981
nosy: asvetlov, romikforest, yselivanov
priority: normal
severity: normal
status: open
title: High cpu usage using asyncio streams
type: performance
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



[issue43695] Improve `=` in f-strings

2021-04-01 Thread wyz23x2


wyz23x2  added the comment:

Well, it's:
>>> f'{a+b-c=?}'  # Suffix `=` to apply to all?
20+40-10=50


P.S. When will the bug tracker enable message editing?

--

___
Python tracker 

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



[issue43695] Improve `=` in f-strings

2021-04-01 Thread wyz23x2


New submission from wyz23x2 :

In Python 3.8, `=` was added into f-strings:
>>> a, b, c = 20, 40, 10
>>> f'{a+b-c=}'
a+b-c=50
But if `20+40-10` is wanted, this needs to be written:
>>> f'{a}+{b}-{c}={a+b-c}'
20+40-10=50
So something could be added. For example, `?` (this doesn't mean I recommend 
the question mark):
>>> f'{a?+b?-c?=}'
20+40-10=50
>>> f'{a+b?-c=}'
a+40-c=50
>>> f'{a+b-c=?}'  # Suffix `=` to apply to all?
20+40-10

Suggestions?

--
components: Interpreter Core
messages: 389979
nosy: wyz23x2
priority: normal
severity: normal
status: open
title: Improve `=` in f-strings
type: enhancement
versions: Python 3.10

___
Python tracker 

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



[issue43690] [C API] stable_abi.py script must not include PyType_HasFeature() static inline function in the stable ABI

2021-04-01 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, I forgot the mention "Tests / Check if generated files are up to date" job 
error message:

LD_LIBRARY_PATH=/home/runner/work/cpython/cpython:/opt/hostedtoolcache/Python/3.9.2/x64/lib
 ./python ./Tools/scripts/stable_abi.py check ./Doc/data/stable_abi.dat
Some symbols from the limited API are missing: PyType_HasFeature

This error means that there are some missing symbols among the ones exported
in the Python library ("libpythonx.x.a" or "libpythonx.x.so"). This normally
means that some symbol, function implementation or a prototype, belonging to
a symbol in the limited API has been deleted or is missing.

Check if this was a mistake and if not, update the file containing the limited
API symbols. This file is located at:

./Doc/data/stable_abi.dat

You can read more about the limited API and its contracts at:

https://docs.python.org/3/c-api/stable.html

And in PEP 384:

https://www.python.org/dev/peps/pep-0384/

--

___
Python tracker 

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



[issue43690] [C API] stable_abi.py script must not include PyType_HasFeature() static inline function in the stable ABI

2021-04-01 Thread STINNER Victor


STINNER Victor  added the comment:

Pablo: My previous commit added PyType_HasFeature to Doc/data/stable_abi.dat. 
But it prevented me to fix another bug, PR 25135. So I merged this change (PR 
25136) to unblock the CI. Feel free to revert/adjust my change as soon as it 
doesn't add PyType_HasFeature back into Doc/data/stable_abi.dat :-)

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



[issue43690] [C API] stable_abi.py script must not include PyType_HasFeature() static inline function in the stable ABI

2021-04-01 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 61092a99c4840f36dbde8457cb566fc3c012930f by Victor Stinner in 
branch 'master':
bpo-43690: stable_abi.py no longer parses macros (GH-25136)
https://github.com/python/cpython/commit/61092a99c4840f36dbde8457cb566fc3c012930f


--

___
Python tracker 

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



[issue43694] Tkinter scaling does not work on some linux systems

2021-04-01 Thread A_D


New submission from A_D :

When using scaling (as in root.tk.call('scaling', somenum)), some linux systems 
appear to simply disregard the change. 

I recently reinstalled from Ubuntu to OpenSUSE Tumbleweed and found that 
scaling straight up did not work in the application I tried or the test 
application -- https://github.com/Athanasius/tk-scaling. (image attached)

Tested on python 3.8.8 and 3.9.2 (pyenv)

--
components: Tkinter
files: Screenshot_20210401_132045.png
messages: 389975
nosy: aunderscored
priority: normal
severity: normal
status: open
title: Tkinter scaling does not work on some linux systems
type: behavior
versions: Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file49924/Screenshot_20210401_132045.png

___
Python tracker 

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



[issue43693] Logically merge cell and locals array. They are already contiguous in memory

2021-04-01 Thread Mark Shannon


New submission from Mark Shannon :

In the interpreter and compiler, the "fast" locals array and cells array are 
treated separately. By merging them in the compiler, the interpreter can be 
simplified a bit.

--
assignee: Mark.Shannon
components: Interpreter Core
messages: 389974
nosy: Mark.Shannon
priority: normal
severity: normal
stage: needs patch
status: open
title: Logically merge cell and locals array. They are already contiguous in 
memory
type: performance

___
Python tracker 

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



[issue43683] Handle generator (and coroutine) state in the bytecode.

2021-04-01 Thread Mark Shannon


Change by Mark Shannon :


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

___
Python tracker 

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



[issue43024] improve signature (in help, etc) for functions taking sentinel defaults

2021-04-01 Thread Irit Katriel


Irit Katriel  added the comment:

Marking as a 3.10 regression because the sentinel was added in 3.10.

--
keywords: +3.10regression

___
Python tracker 

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



[issue40092] Crash in _PyThreadState_DeleteExcept() at fork in the process child

2021-04-01 Thread Michael Felt


Michael Felt  added the comment:

OK. Please explain. Looking at tstate assignment

In posixmodule.c:PyOSAfterFork_Child()
PyStatus status;
_PyRuntimeState *runtime = &_PyRuntime;

...
PyThreadState *tstate = _PyThreadState_GET();

and later calls
status = _PyRuntimeState_ReInitThreads(runtime);

Yet in Posix/ceval.c
PyStatus
_PyEval_ReInitThreads(PyThreadState *tstate)
{
_PyRuntimeState *runtime = tstate->interp->runtime;

** this looks like runtime->interp->runtime

And then we get down to:
/* Destroy all threads except the current one */
_PyThreadState_DeleteExcept(runtime, tstate);

Is this correct - as it looks like:
_PyThreadState_DeleteExcept(runtime->interp->runtime, runtime) -- where runtime 
== &_PyRuntime;

--

___
Python tracker 

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



[issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF)

2021-04-01 Thread Petr Viktorin


Petr Viktorin  added the comment:

If you do this, please check the performance impact. Py_INCREF/Py_DECREF are 
very common.

--

___
Python tracker 

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



[issue43690] [C API] stable_abi.py script must not include PyType_HasFeature() static inline function in the stable ABI

2021-04-01 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue43692] Raise SyntaxError on implicit string concatentation in list

2021-04-01 Thread Carsten Docktor


New submission from Carsten Docktor :

I recently found several bugs, which came from the "feature" shown below.
Is python supposed to use string concatenation in a list environment like this? 
Why would this be appreciated?

## Expected Behavior

The example below should raise a SyntaxErorr for a missing comma.
String concatenation in a list should require brackets.

## Current Behavior

Missing commas in a string list lead to unnoticed concatenated strings.


## Steps to Reproduce

```python
my_list = [
  "a",
  "b"
  "c",
  "d"
]
interpreted_list = [
  "a",
  "bc",
  "d",
]
assert my_list == interpreted_list  # unwanted behavior
```

--
components: Interpreter Core
messages: 389970
nosy: carsten.docktor
priority: normal
severity: normal
status: open
title: Raise SyntaxError on implicit string concatentation in list
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



[issue40092] Crash in _PyThreadState_DeleteExcept() at fork in the process child

2021-04-01 Thread Michael Felt


Michael Felt  added the comment:

OK: further.

Two options are suggested:

There are different options to solve this issue:

* Reset _tstate_lock before using it... not sure that it's worth it, since we 
are going to delete the threading.Thread object with its _tstate_lock object 
anymore. After calling fork, the child process has exactly 1 thread: all other 
threads have been removed.

* Modify release_sentinel() to not use the lock: avoid PyThread_release_lock() 
call.

** as to option 1 - it is 'worth it' if it stops the crashes

** This is deeper than I usually go in Python code - but I'll make an effort - 
help is appreciated.

--

___
Python tracker 

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



[issue40092] Crash in _PyThreadState_DeleteExcept() at fork in the process child

2021-04-01 Thread STINNER Victor


STINNER Victor  added the comment:

> As this seem to be a long-standing issue is it perhaps a possibility to 
> change the test so that the bot can go green again?

This issue is a real crash and it seems quite easy to get it. I prefer to not 
hide the bug in the test suite. The bug must be fixed.

--

___
Python tracker 

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



[issue43684] Add combined opcodes

2021-04-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

We usually rejected such propositions unless there were evidences of 
significant effect on performance. I myself withdrawn several my patches after 
analyzing statistics.

What percent of opcodes will be ADD_INT in the compiled bytecode? What percent 
of executed opcodes will be ADD_INT? Compare it with other opcodes, in 
particularly BINARY_ADD. What are microbenchmark results?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue40092] Crash in _PyThreadState_DeleteExcept() at fork in the process child

2021-04-01 Thread Michael Felt


Michael Felt  added the comment:

Adding 3.10.

While a (sort of) duplicate I also would like to add that before revision 
"7cb033c423b65def1632d6c3c747111543b342a2" this was not showing up as an issue 
with test_importlib.

my issue was with test_importlib suddenly going into error.

As this seem to be a long-standing issue is it perhaps a possibility to change 
the test so that the bot can go green again?

--
nosy: +Michael.Felt
versions: +Python 3.10

___
Python tracker 

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



[issue43684] Add combined opcodes

2021-04-01 Thread Batuhan Taskaya


Change by Batuhan Taskaya :


--
nosy: +BTaskaya

___
Python tracker 

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



[issue43688] [C API] Support the limited C API in debug mode (Py_INCREF and Py_DECREF)

2021-04-01 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +23882
pull_request: https://github.com/python/cpython/pull/25135

___
Python tracker 

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



[issue43691] Comparison of OrderedDict() and dict()

2021-04-01 Thread Марк Коренберг

New submission from Марк Коренберг :

OrderedDict([(1,2), (3,4)]) == OrderedDict([(3,4), (1,2)])
Out[1]: False# OK

dict([(1,2), (3,4)]) == dict([(3,4), (1,2)])
Out[2]: True # OK

dict([(1,2), (3,4)]) == OrderedDict([(3,4), (1,2)])
Out[3]: True # NOT OK, since actual order is different

OrderedDict([(1,2), (3,4)]) == dict([(3,4), (1,2)])
Out[4]: True # NOT OK, since actual orderd is different


I propose two options to fix it:

1. Return True when comparing anything with OrderedDict iff order is the same.
2. Raise TypeError when someone tries to compare OrderedDict() and dict(). # I 
think it's better.

--
components: Library (Lib)
messages: 389965
nosy: socketpair
priority: normal
severity: normal
status: open
title: Comparison of OrderedDict() and dict()
type: behavior
versions: Python 3.10, Python 3.9

___
Python tracker 

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



[issue43690] [C API] stable_abi.py script must not include PyType_HasFeature() static inline function in the stable ABI

2021-04-01 Thread STINNER Victor


New submission from STINNER Victor :

I just ran "make regen-limited-abi" and it added PyType_HasFeature():

commit baf10da75072d1f8ec714d3c2c8550d34db343a9
Author: Victor Stinner 
Date:   Thu Apr 1 11:29:46 2021 +0200

bpo-43688: Run make regen-limited-abi (GH-25134)

diff --git a/Doc/data/stable_abi.dat b/Doc/data/stable_abi.dat
index 3adee103bc..ed20521b7f 100644
--- a/Doc/data/stable_abi.dat
+++ b/Doc/data/stable_abi.dat
@@ -192,6 +192,7 @@ PyExc_ConnectionRefusedError
 PyExc_ConnectionResetError
 PyExc_DeprecationWarning
 PyExc_EOFError
+PyExc_EncodingWarning
 PyExc_EnvironmentError
 PyExc_Exception
 PyExc_FileExistsError
@@ -615,6 +616,7 @@ PyType_GetFlags
 PyType_GetModule
 PyType_GetModuleState
 PyType_GetSlot
+PyType_HasFeature
 PyType_IsSubtype
 PyType_Modified
 PyType_Ready


The problem is that PyType_HasFeature() is currently implemented as a static 
inline function in the limited C API for best performance.

Issue about PyType_HasFeature() performance in CPython itself:
https://bugs.python.org/issue39542#msg372962

Currently, PyType_HasFeature() is declared in Include/object.h as:

static inline int
PyType_HasFeature(PyTypeObject *type, unsigned long feature)
{
unsigned long flags;
#ifdef Py_LIMITED_API
// PyTypeObject is opaque in the limited C API
flags = PyType_GetFlags(type);
#else
flags = type->tp_flags;
#endif
return ((flags & feature) != 0);
}

IMO static inline functions must not be listed in the stable *ABI*. At the ABI 
level, libpython doesn't export "PyType_HasFeature" symbol:

$ objdump -T /lib64/libpython3.10.so.1.0|grep '\'
000fedf0 gDF .text  00d0  Base
PyObject_CallFunction
$ objdump -T /lib64/libpython3.10.so.1.0|grep '\'
# nothing

"PyObject_CallFunction" symbol is exported, but not "PyType_HasFeature".

--

Maybe for the stable ABI, it would be a good idea to export PyType_HasFeature() 
as an opaque function. But that's out of the scope of this issue which is about 
the stable_abi.py script ;-)

--
components: C API
messages: 389964
nosy: pablogsal, petr.viktorin, vstinner
priority: normal
severity: normal
status: open
title: [C API] stable_abi.py script must not include PyType_HasFeature() static 
inline function in the stable ABI
versions: Python 3.10

___
Python tracker 

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



  1   2   >