[issue42239] IDLE: Restore or keep calltip when needed

2020-11-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

I dislike the idea of creating a Hyperparser and calling 
get_surrounding_brackets on every ).  For (, the open is the ( just typed and 
the close is typically the newline to the right.  For ), the open may be 
several lines back.  I will test for noticeable delay after sleeping.

--
stage: patch review -> test needed

___
Python tracker 

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



[issue42239] IDLE: Restore or keep calltip when needed

2020-11-01 Thread Tal Einat


Change by Tal Einat :


--
Removed message: https://bugs.python.org/msg380188

___
Python tracker 

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



[issue42239] IDLE: Restore or keep calltip when needed

2020-11-01 Thread Tal Einat


Tal Einat  added the comment:

We already have a "<>" virtual event which is triggered upon 
typing a closing parenthesis ')'. We could just have it always call 
"open_calltip()" rather than only doing so when one is already open.

See PR GH-23100.

--

___
Python tracker 

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



[issue42239] IDLE: Restore or keep calltip when needed

2020-11-01 Thread Tal Einat


Change by Tal Einat :


--
pull_requests: +22014
pull_request: https://github.com/python/cpython/pull/23100

___
Python tracker 

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



[issue42239] IDLE: Restore or keep calltip when needed

2020-11-01 Thread Tal Einat


Tal Einat  added the comment:

We already have a "<>" virtual event which is triggered upon 
typing a closing parenthesis ')'. We could just have it always call 
"open_calltip()" rather than only doing so when one is already open.

See PR GH-23098.

--

___
Python tracker 

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



[issue42229] Fix SQLite warnings on macOS

2020-11-01 Thread Samuel Marks


Samuel Marks  added the comment:

Opened two issues and two PRs for 3.8 and 3.8:
- https://bugs.python.org/issue42241
- https://bugs.python.org/issue42242

--

___
Python tracker 

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



[issue42242] Backport SQLite trace API v2

2020-11-01 Thread Samuel Marks


New submission from Samuel Marks :

Backports https://github.com/python/cpython/pull/19581 
https://bugs.python.org/issue40318 as per https://bugs.python.org/issue42229

See also 3.9 backporting: https://bugs.python.org/issue42241

[not sure if this is how you do backporting, a new issue and GH PR for each 
supported release tag?]

--
components: Build
messages: 380186
nosy: samuelmarks
priority: normal
pull_requests: 22013
severity: normal
status: open
title: Backport SQLite trace API v2
type: compile error
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



[issue42239] IDLE: Restore or keep calltip when needed

2020-11-01 Thread Terry J. Reedy


Change by Terry J. Reedy :


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

___
Python tracker 

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



[issue42241] Backport SQLite trace API v2

2020-11-01 Thread Samuel Marks


New submission from Samuel Marks :

Backports https://github.com/python/cpython/pull/19581 
https://bugs.python.org/issue40318 as per https://bugs.python.org/issue42229

--
components: Build
messages: 380185
nosy: samuelmarks
priority: normal
pull_requests: 22011
severity: normal
status: open
title: Backport SQLite trace API v2
type: compile error
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



[issue42240] Add Maxheap version of a heappush into heapq module

2020-11-01 Thread Rudresh Veerkhare


New submission from Rudresh Veerkhare :

Main functions required to implement Heap data structure are: 
function heappush - to push an element in Heap
function heappop - to pop an element from Heap

for implementing Minheap this functions are present in the module as : 
heappush - for adding element into Minheap
heappop - to pop an element from Minheap

for implementing Maxheap only one of this two required functions is present:
_heappop_max - to pop an element from Maxheap

I suggest adding a Maxheap version of heappush into heapq module.
_heappush_max - for adding an element into Maxheap.

--
components: Library (Lib)
messages: 380184
nosy: veerkharerudresh
priority: normal
severity: normal
status: open
title: Add Maxheap version of a heappush into heapq module
type: enhancement

___
Python tracker 

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



[issue42229] Fix SQLite warnings on macOS

2020-11-01 Thread Samuel Marks


Change by Samuel Marks :


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



[issue42229] Fix SQLite warnings on macOS

2020-11-01 Thread Samuel Marks

Samuel Marks  added the comment:



--

___
Python tracker 

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



[issue42229] Fix SQLite warnings on macOS

2020-11-01 Thread Erlend Egeberg Aasland

Erlend Egeberg Aasland  added the comment:

> Should I close this issue—and PR—then? - Backport from master to these?

If this fix is wanted in 3.9 and 3.8, I think the correct way to proceed would 
be to close GH-23072 and backport GH-19581.

Try checking out 3.9 and cherrypicking 7f331c8 to verify that the trace-warning 
disappears. I'm pretty sure that SQLite3 version detection works on macOS.

--

___
Python tracker 

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



[issue42195] Inconsistent __args__ between typing.Callable and collections.abc.Callable

2020-11-01 Thread Ken Jin


Ken Jin  added the comment:

Dear Guido, from what I can see in the typing module, _CallableType already 
casts the args list to a tuple before creating the __CallableGenericAlias, so 
it should support cacheing. This is taken from the from _CallableType::

def __getitem__(self, params):
...  # (some checking code here)
args, result = params
...  # (some checking code here)

params = (tuple(args), result)  # args is cast to a tuple
return self.__getitem_inner__(params)

@_tp_cache   # the cache
def __getitem_inner__(self, params):
args, result = params
...  # (some checking code here)

# This is the suspect code causing the flattening of args
params = args + (result,) 
return self.copy_with(params)

def copy_with(self, params):
return _CallableGenericAlias(self.__origin__, params,
 name=self._name, inst=self._inst)

Changing the suspect code from ``params = args + (result,)`` to ``params = 
(args, result)`` allows typing.Callable to be consistent with 
collections.abc.Callable's GenericAlias, and also allows for cacheing.

With that change:

>>> from typing import Callable
>>> Callable[[int, ], str].__args__
((,), )  # note the args is a tuple

>>> from collections.abc import Callable
>>> Callable[[int, ], str].__args__
([], )   # note the args is a list

This isn't fully consistent with collections.abc.Callable's GenericAlias just 
yet, but it's close.

--

___
Python tracker 

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



[issue42239] IDLE: Restore or keep calltip when needed

2020-11-01 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
title: IDLE: Restore calltip when needed -> IDLE: Restore or keep calltip when 
needed

___
Python tracker 

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



[issue42239] IDLE: Restore calltip when needed

2020-11-01 Thread Terry J. Reedy


New submission from Terry J. Reedy :

If one types 'int(' an int calltip is displayed.  If one adds 'float(' then the 
float calltip is displayed instead.  If one adds '"3.1")', the int calltip is 
restored.  (Actually a new int calltip.)  Finally, if one closes with ')', the 
int calltip is removed.

If, after 'int(', one adds instead 'f(', where f has no accessible signature or 
docstring and hence no calltip, the int calltip is dropped with no replacement. 
 When f is closed, the int calltip is not restored because open_calltip in

def refresh_calltip_event(self, event):  # Bound to ')'.
if self.active_calltip and self.active_calltip.tipwindow:
self.open_calltip(False)

is not called because there is no existing calltip.

This issue is about somehow having the int calltip after the f call.  
Possibilities.

1. Do not drop the int calltip when an inner call has none.

2. Give the inner call a fake calltip, something like "f(".  Again, 
revise open_calltip.

3. Drop the outer calltip and set a 'nested_call flag in open_calltip and test 
it with 'or' in refresh_calltip_event (and unset the flag -- conditionally?) to 
restore it.

4. Add a calltip stack and test it for not empty in refresh_calltip_event. 

Tal, any opinions on the desired behavior.  I believe the #40511 revision 
should make any of the above, with 1 and 2 being easiest and safest.  A problem 
with 3 and 4 is that the text cursor can be moved out of the call and the 
calltip closed without the call being completed with ')'.

I want to add more tests first.

--
assignee: terry.reedy
components: IDLE
messages: 380180
nosy: taleinat, terry.reedy
priority: normal
severity: normal
stage: test needed
status: open
title: IDLE: Restore calltip when needed
type: behavior
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



[issue9499] DOC: C/API Execution namespace undocumented. (patch included)

2020-11-01 Thread Campbell Barton


Campbell Barton  added the comment:

This patch is still relevant, mentioning this since the patch is from a while 
ago.

--

___
Python tracker 

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



[issue37751] In codecs, function 'normalizestring' should convert both spaces and hyphens to underscores.

2020-11-01 Thread hai shi


Change by hai shi :


--
pull_requests: +22010
stage: resolved -> patch review
pull_request: https://github.com/python/cpython/pull/23096

___
Python tracker 

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



[issue40511] IDLE: properly handle '(' and ')' within calls

2020-11-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

wyz, thank you for the report.  It should be fixed now.

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



[issue40511] IDLE: properly handle '(' and ')' within calls

2020-11-01 Thread miss-islington


miss-islington  added the comment:


New changeset 1341582e165841810e2fbf89e23be0e92b4a9fdd by Miss Skeleton (bot) 
in branch '3.8':
bpo-40511: Stop unwanted flashing of IDLE calltips (GH-20910)
https://github.com/python/cpython/commit/1341582e165841810e2fbf89e23be0e92b4a9fdd


--

___
Python tracker 

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



[issue40511] IDLE: properly handle '(' and ')' within calls

2020-11-01 Thread miss-islington


miss-islington  added the comment:


New changeset 79e9f06149f92798a8e11e3f1c62dad171312ab3 by Miss Skeleton (bot) 
in branch '3.9':
bpo-40511: Stop unwanted flashing of IDLE calltips (GH-20910)
https://github.com/python/cpython/commit/79e9f06149f92798a8e11e3f1c62dad171312ab3


--

___
Python tracker 

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



[issue42195] Inconsistent __args__ between typing.Callable and collections.abc.Callable

2020-11-01 Thread Guido van Rossum


Guido van Rossum  added the comment:

Actually you can't really change typing.Callable's __args__, because it must be 
hashable, and lists aren't.

If GenericAlias doesn't cache yet, it might very well do so in the future to 
gain some speed when e.g. list[int] is used at runtime outside annotations, 
e.g. in cast(), so it will be important there too.

--

___
Python tracker 

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



[issue40511] IDLE: properly handle '(' and ')' within calls

2020-11-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22009
pull_request: https://github.com/python/cpython/pull/23094

___
Python tracker 

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



[issue40511] IDLE: properly handle '(' and ')' within calls

2020-11-01 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset da7bb7b4d769350c5fd03e6cfb16b23dc265ed72 by Tal Einat in branch 
'master':
bpo-40511: Stop unwanted flashing of IDLE calltips (GH-20910)
https://github.com/python/cpython/commit/da7bb7b4d769350c5fd03e6cfb16b23dc265ed72


--

___
Python tracker 

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



[issue40511] IDLE: properly handle '(' and ')' within calls

2020-11-01 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 4.0 -> 5.0
pull_requests: +22008
pull_request: https://github.com/python/cpython/pull/23093

___
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-11-01 Thread mohamed koubaa


Change by mohamed koubaa :


--
pull_requests: +22007
pull_request: https://github.com/python/cpython/pull/23091

___
Python tracker 

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



[issue42226] imghdr.what is missing docstring, has a logic error, and is overly complex

2020-11-01 Thread Jeremy Howard


Change by Jeremy Howard :


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



[issue42225] Tkinter hangs or crashes when displaying astral chars

2020-11-01 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

In IDLE on Windows the following prints the first 3 astral planes in a couple 
of minutes.

for i in range(0x1, 0x4, 32):
chars = ''.join(chr(i+j) for j in range(32))
print(hex(i), chars)

Perhaps half of the assigned chars in the first plane are printed instead of 
being replaced with a narrow box. This includes emoticons as foreground color 
outlines on background color.  Maybe all of the second plane of extended CJK 
chars are printed.  The third plane is unassigned and prints as unassigned 
boxes (with an X).

Fixing OS graphics or tk is out of scope for us.  Preventing hangs or crashes 
when using tkinter is.  On Mac, refusing to insert any astral char into a tk 
widget might be the best solution.  Serhiy, could that be done in 
tkinter/_tkinter?

On Linux, the situation appears to be more complex.  The SO questioner
https://stackoverflow.com/questions/64615570/why-do-some-emoticons-cause-python-idle-to-crash-on-ubuntu
could print the two multicolor 'grinning face with smiling eyes' , which fails 
for Serhiy, but not the simpler thumbsup .  I don't know if we can detect 
fonts that cause crashes.

--

___
Python tracker 

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



[issue37193] Memory leak while running TCP/UDPServer with socketserver.ThreadingMixIn

2020-11-01 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Commit c41559021213cfc9dc62a83fc63306b3bdc3e64b has introduced reference leaks:

--
Ran 202 tests in 21.654s
OK (skipped=1)
..
test_logging leaked [20, 20, 20] references, sum=60
test_logging leaked [20, 20, 20] memory blocks, sum=60
2 tests failed again:
test_logging test_socketserver
== Tests result: FAILURE then FAILURE ==

Example buildbot failure:

https://buildbot.python.org/all/#/builders/562/builds/79/steps/5/logs/stdio

As there is a release of 3.10 alpha 2 tomorrow I would be great if this could 
be fixed by tomorrow.

--
nosy: +pablogsal

___
Python tracker 

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



[issue42238] Deprecate suspicious.py?

2020-11-01 Thread Ned Deily


Ned Deily  added the comment:

If it still does useful checks, we could just limit it to running by release 
managers during the release manufacturing process; it is already run then. It 
would still allow for problems to be caught and fixed by the RM prior to 
release tagging.  But I don't have a strong opinion about its overall 
usefulness. I recall it catching at least one problem in a release I was 
involved with and that was probably before we had the CI checks.

--
nosy: +ned.deily

___
Python tracker 

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



[issue42229] Fix SQLite warnings on macOS

2020-11-01 Thread Samuel Marks

Samuel Marks  added the comment:

@erlendaasland Hmm… just double-checked, and this issue is present on Python 
3.8.6 and 3.9.0 but not master [d3b4e068077dd26927ae7485bd0303e09d962c02] as 
you referenced.

Should I close this issue—and PR—then? - Backport from master to these?

--

___
Python tracker 

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



[issue42238] Deprecate suspicious.py?

2020-11-01 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I would love to see this disappear.  For me, it has been a recurring time 
waster.

--
nosy: +rhettinger

___
Python tracker 

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



[issue37193] Memory leak while running TCP/UDPServer with socketserver.ThreadingMixIn

2020-11-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22006
pull_request: https://github.com/python/cpython/pull/23089

___
Python tracker 

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



[issue37193] Memory leak while running TCP/UDPServer with socketserver.ThreadingMixIn

2020-11-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22005
pull_request: https://github.com/python/cpython/pull/23088

___
Python tracker 

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



[issue37193] Memory leak while running TCP/UDPServer with socketserver.ThreadingMixIn

2020-11-01 Thread Jason R. Coombs


Jason R. Coombs  added the comment:


New changeset c41559021213cfc9dc62a83fc63306b3bdc3e64b by MARUYAMA Norihiro in 
branch 'master':
bpo-37193: remove thread objects which finished process its request (GH-13893)
https://github.com/python/cpython/commit/c41559021213cfc9dc62a83fc63306b3bdc3e64b


--

___
Python tracker 

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



[issue37193] Memory leak while running TCP/UDPServer with socketserver.ThreadingMixIn

2020-11-01 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 6.0 -> 7.0
pull_requests: +22004
pull_request: https://github.com/python/cpython/pull/23087

___
Python tracker 

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



[issue42238] Deprecate suspicious.py?

2020-11-01 Thread Julien Palard


New submission from Julien Palard :

I was not here 21 years ago when it was introduced [1], but according to the 
commit message it was introduced to find leftover Latex mardown.

It tries to find 4 patterns in Sphinx node text (not in raw rst files):

::(?=[^=])|# two :: (but NOT ::=)

This one has ~100 false positive in susp-ignored.csv (pypi classifiers, slices, 
ipv6, ...) 

:[a-zA-Z][a-zA-Z0-9]+| # :foo

This one has ~300 false positive in susp-ignored.csv (slices, C:\, ipv6, ...)


`| # ` (seldom used by itself)

This one has ~20 false positive in susp-ignored.csv (mostly reStructuredText in 
code-blocks)

(?https://github.com/python/cpython/commit/700cf28f410521066f40671f1da7db0302d753fd

--
assignee: mdk
components: Documentation
messages: 380167
nosy: mdk
priority: normal
severity: normal
status: open
title: Deprecate suspicious.py?

___
Python tracker 

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



Re: GUI: I am also looking for a nudge into the best (GUI) direction.

2020-11-01 Thread Greg Ewing

On 1/11/20 5:43 pm, Michael Torrie wrote:

In C# world, WinForms is often used, but it's not "native" win32
widgets.  Widgets are implemented in managed code (according to
Wikipedia) that draw themselves using the theming dll so they look
native, or at least look somewhat consistent with regards to button
styles, fonts, colors, etc.


Well, Microsoft has a lot more resources than your typical third
party GUI toolkit developer to spend on re-doing everything
periodically. It still make sense to let them do the hard work
instead of replicating it all yourself.


In fact I know of very few
Windows applications that use exclusively the basic native widget set
from win32.


Which is understandable -- the raw Windows GUI API is pretty
cruddy and doesn't do a lot of what one expects from a modern
GUI toolkit.

But I still think it's better to base your UI on one of the
standard offerings from Microsoft such as WinForms rather than
rolling your own.

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


[issue42236] os.device_encoding() doesn't respect the UTF-8 Mode

2020-11-01 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset e662c398d87f136497f8ec672e83657ae3a599e0 by Victor Stinner in 
branch 'master':
bpo-42236: Use UTF-8 encoding if nl_langinfo(CODESET) fails (GH-23086)
https://github.com/python/cpython/commit/e662c398d87f136497f8ec672e83657ae3a599e0


--

___
Python tracker 

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



[issue42236] os.device_encoding() doesn't respect the UTF-8 Mode

2020-11-01 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +22003
pull_request: https://github.com/python/cpython/pull/23086

___
Python tracker 

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



[issue42229] Fix SQLite warnings on macOS

2020-11-01 Thread Erlend Egeberg Aasland


Change by Erlend Egeberg Aasland :


--
nosy: +ronaldoussoren

___
Python tracker 

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



[issue42229] Fix SQLite warnings on macOS

2020-11-01 Thread Erlend Egeberg Aasland

Erlend Egeberg Aasland  added the comment:

> Yes, this commit extends his changes to include macOS support (for some 
> reason that SQLite version check doesn’t work properly on macOS

I can't reproduce this on master on macOS 10.15.7 with the SQLite 3.28.0 that's 
shipped with the os.

--

___
Python tracker 

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



[issue42229] Fix SQLite warnings on macOS

2020-11-01 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Oh, I see now that you're only mentioning 3.9 here. The issue was fixed in 
master only (that is 3.10 alpha). Perhaps GH-19581 should be backported to 3.9, 
or even 3.8, but that's not for me to decide.

Note: your patch is against 3.10, not 3.9.

--

___
Python tracker 

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



[issue42229] Fix SQLite warnings on macOS

2020-11-01 Thread Samuel Marks

Samuel Marks  added the comment:

Yes, this commit extends his changes to include macOS support (for some reason 
that SQLite version check doesn’t work properly on macOS; so this checks the 
macOS version, knowing AOT when SQLite trace v1 APIs were deprecated.

Curious that `sqlite3_enable_shared_cache` is in the ‘wontfix’ category… why is 
this?

--

___
Python tracker 

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



[issue42229] Fix SQLite warnings on macOS

2020-11-01 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

Look at bpo-24464 regarding the shared cache issue. Apparently I did not 
remember correctly regarding its status.

--

___
Python tracker 

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



[issue42229] Fix SQLite warnings on macOS

2020-11-01 Thread Erlend Egeberg Aasland


Erlend Egeberg Aasland  added the comment:

FYI, commit 7f331c8 (GH-19581 / bpo-40318) migrates the sqlite3 to the new 
trace API.

There was also a discussion about sqlite3_enable_shared_cache() on bpo, but I 
think it was closed as "wont-fix", IIRC.

--
nosy: +erlendaasland

___
Python tracker 

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



[issue42237] test_socket.SendfileUsingSendfileTest fails on illumos

2020-11-01 Thread Sebastian Wiedenroth


Change by Sebastian Wiedenroth :


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

___
Python tracker 

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



[issue42237] test_socket.SendfileUsingSendfileTest fails on illumos

2020-11-01 Thread Sebastian Wiedenroth


New submission from Sebastian Wiedenroth :

I'm investigating some test failures related to sendfile on illumos:


testCount (test.test_socket.SendfileUsingSendfileTest) ... FAIL
testCountSmall (test.test_socket.SendfileUsingSendfileTest) ... ok
testCountWithOffset (test.test_socket.SendfileUsingSendfileTest) ... ok
testEmptyFileSend (test.test_socket.SendfileUsingSendfileTest) ... ok
testNonBlocking (test.test_socket.SendfileUsingSendfileTest) ... ok
testNonRegularFile (test.test_socket.SendfileUsingSendfileTest) ... ok
testOffset (test.test_socket.SendfileUsingSendfileTest) ... ERROR
testRegularFile (test.test_socket.SendfileUsingSendfileTest) ... ok
testWithTimeout (test.test_socket.SendfileUsingSendfileTest) ... FAIL
testWithTimeoutTriggeredSend (test.test_socket.SendfileUsingSendfileTest) ... ok
test_errors (test.test_socket.SendfileUsingSendfileTest) ... ok

==
ERROR: testOffset (test.test_socket.SendfileUsingSendfileTest)
--
Traceback (most recent call last):
  File "/root/cpython/Lib/socket.py", line 386, in _sendfile_use_sendfile
sent = os_sendfile(sockno, fileno, offset, blocksize)
OSError: [Errno 22] Invalid argument

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/cpython/Lib/test/test_socket.py", line 374, in _tearDown
raise exc
  File "/root/cpython/Lib/test/test_socket.py", line 392, in clientRun
test_func()
  File "/root/cpython/Lib/test/test_socket.py", line 6057, in _testOffset
sent = meth(file, offset=5000)
  File "/root/cpython/Lib/socket.py", line 399, in _sendfile_use_sendfile
raise _GiveupOnSendfile(err)
socket._GiveupOnSendfile: [Errno 22] Invalid argument

==
FAIL: testCount (test.test_socket.SendfileUsingSendfileTest)
--
Traceback (most recent call last):
  File "/root/cpython/Lib/test/test_socket.py", line 6085, in testCount
self.assertEqual(len(data), count)
AssertionError: 5405948743 != 507

==
FAIL: testWithTimeout (test.test_socket.SendfileUsingSendfileTest)
--
Traceback (most recent call last):
  File "/root/cpython/Lib/test/test_socket.py", line 6159, in testWithTimeout
self.assertEqual(len(data), self.FILESIZE)
AssertionError: 429006848 != 10485760

--
Ran 11 tests in 33.603s

FAILED (failures=2, errors=1)


Looking at the testCount case I could observe repeated calls to sendfile() with 
out_fd=7, in_fd=6 off=0, len=507 which returned -1 with errno set to EAGAIN.

--
components: IO, Library (Lib)
messages: 380160
nosy: wiedi
priority: normal
severity: normal
status: open
title: test_socket.SendfileUsingSendfileTest fails on illumos
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



[issue42236] os.device_encoding() doesn't respect the UTF-8 Mode

2020-11-01 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 82458b6cdbae3b849dc11d0d7dc2ab06ef0451c4 by Victor Stinner in 
branch 'master':
bpo-42236: Enhance _locale._get_locale_encoding() (GH-23083)
https://github.com/python/cpython/commit/82458b6cdbae3b849dc11d0d7dc2ab06ef0451c4


--

___
Python tracker 

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



[issue42236] os.device_encoding() doesn't respect the UTF-8 Mode

2020-11-01 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue42236] os.device_encoding() doesn't respect the UTF-8 Mode

2020-11-01 Thread STINNER Victor


STINNER Victor  added the comment:

In bpo-42208, I added C _Py_GetLocaleEncoding() function and Python 
_locale._get_locale_encoding() function.

--

___
Python tracker 

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



Re: Find word by given characters

2020-11-01 Thread duncan smith
On 01/11/2020 13:38, Bischoop wrote:
> On 2020-11-01, Bischoop  wrote:
>> I'm working on a script i which user inputs letters and then a printed
>> words containing those letters. The scripts works however I can't solve
>> one problem , it prints also words in which these letters occur more 
>> than once.
>> ---
>> Fore example:
>> Letters: at
>> Output: auto, autobahn.
>> ---
>>
>> I supposed to not print word: "autobahn" because I've given it only one
>> letter "a".
>>
> 
> Problem's solved.
> 
> 
> for word in words:
> if all(word.count(x) == letters.count(x) for x in letters):
> print(word)
> -
> 
> Thanks for suggestions, I didn't had to use counter but going to look
> into as it seems useful and interesting.
> 
> Thank You
> 

But this generates the letters counts for each word. They only need to
be generated once (outside the for loop). And using count requires
iterating over the letters / words for each x in letters (rather than
once). For a large enough collection of words you'd notice the difference.

Duncan
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue42233] GenericAlias does not support union type expressions

2020-11-01 Thread miss-islington


Change by miss-islington :


--
pull_requests: +22000
pull_request: https://github.com/python/cpython/pull/23082

___
Python tracker 

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



[issue42233] GenericAlias does not support union type expressions

2020-11-01 Thread miss-islington


miss-islington  added the comment:


New changeset 1f7dfb277e5b88cddc13e5024766be787a3e9127 by kj in branch 'master':
bpo-42233: Correctly repr GenericAlias when used with typing module (GH-23081)
https://github.com/python/cpython/commit/1f7dfb277e5b88cddc13e5024766be787a3e9127


--
nosy: +miss-islington

___
Python tracker 

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



[issue42236] os.device_encoding() doesn't respect the UTF-8 Mode

2020-11-01 Thread STINNER Victor


New submission from STINNER Victor :

When the UTF-8 Mode is enabled, sys.stdout.encoding is always UTF-8, whereas 
os.devide_encoding(sys.stdout.fileno()) returns the locale encoding. 
os.devide_encoding() must return UTF-8 when the UTF-8 Mode is used.

--
components: Library (Lib)
messages: 380156
nosy: vstinner
priority: normal
severity: normal
status: open
title: os.device_encoding() doesn't respect the UTF-8 Mode
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



[issue42233] GenericAlias does not support union type expressions

2020-11-01 Thread Ken Jin


Change by Ken Jin :


--
pull_requests: +21999
pull_request: https://github.com/python/cpython/pull/23081

___
Python tracker 

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



[issue42235] [macOS] Use --enable-optimizations in build-installer.py

2020-11-01 Thread Ronald Oussoren


Change by Ronald Oussoren :


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

___
Python tracker 

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



[issue42235] [macOS] Use --enable-optimizations in build-installer.py

2020-11-01 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I'm working on a PR. 

The current version of build-installer.py doesn't use LTO/PGO because 
installers are build on macOS 10.9 where the compiler doesn't reliably support 
this. Recent compilers should work a lot better.

The upcoming PR enables --enable-optimizations when building on macOS 10.15 or 
later (Xcode 11 or 12), mostly because that's what I'm testing with. 


I'm listing 41100 as a dependency because having that is the only way to make 
use of this PR at the moment: build-installer.py uses --enable-universalsdk and 
41100 introduces "universal2" as a set of architectures that can be build using 
Xcode 12. All other sets of architectures require Xcode 10 or older.

--
components: +macOS
dependencies: +Build failure on macOS 11 (beta)
nosy: +ned.deily

___
Python tracker 

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



[issue42235] [macOS] Use --enable-optimizations in build-installer.py

2020-11-01 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-41181 "[macOS] Build macOS installer with LTO and PGO 
optimizations".

--
nosy: +vstinner

___
Python tracker 

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



[issue41181] [macOS] Build macOS installer with LTO and PGO optimizations

2020-11-01 Thread STINNER Victor


STINNER Victor  added the comment:

> Link Time Optimization (LTO) and Profile-Guided Optimization (PGO) have a 
> major impact on Python performance: they make Python between 10% and 30% 
> faster (coarse estimation).
>
> Currently, macOS installers distributed on python.org are built with Clang 
> 6.0 without LTO or PGO. I propose to enable LTO and PGO to make these 
> binaries faster.

Oh, I forgot to mention that I discovered that macOS doesn't use LTO when I 
worked on the https://bugs.python.org/issue39542#msg373230 issue.

--

___
Python tracker 

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



[issue42235] [macOS] Use --enable-optimizations in build-installer.py

2020-11-01 Thread Ronald Oussoren


New submission from Ronald Oussoren :

With recent enough compilers it is possible to use --enable-optimzations when 
building the installer.

--
messages: 380152
nosy: ronaldoussoren
priority: normal
severity: normal
status: open
title: [macOS] Use --enable-optimizations in build-installer.py
type: enhancement

___
Python tracker 

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



[issue42225] Tkinter hangs or crashes when displaying astral chars

2020-11-01 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

The error on Linux could be related to this issue: 
https://bugzilla.redhat.com/show_bug.cgi?id=1498269

--

___
Python tracker 

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



[issue42233] GenericAlias does not support union type expressions

2020-11-01 Thread Ken Jin


Ken Jin  added the comment:

@Serhiy, wow interesting find, it seems to be typing's repr problem rather than 
the actual types itself:

>>> typing.Union[dict[int, str], list[str]]
typing.Union[dict, list]

>>> typing.Union[dict[int, str], list[str]].__args__
(dict[int, str], list[str])

The __args__ seem to be correct, so I'm guessing the typing repr went wrong 
somewhere. That should be the case for your example too:

>>> alias = typing.List[int] | dict[float, str]
>>> alias
typing.Union[typing.List[int], dict]

>>> type(alias)


>>> alias.__args__
(typing.List[int], dict[float, str])

I'll work on this. If I don't reply back in a week, someone else is free to 
take over this issue.

--

___
Python tracker 

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



[issue42225] Tkinter hangs or crashes when displaying astral chars

2020-11-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It looks different on my computer. I suppose it will crash to you too if you 
install a color emoji font.

--
Added file: https://bugs.python.org/file49557/Ubuntu-2020.04.png

___
Python tracker 

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



[issue42234] pathlib relative_to behaviour change

2020-11-01 Thread Armins Stepanjans


New submission from Armins Stepanjans :

In the docs 
(https://docs.python.org/3/library/pathlib.html#pathlib.PurePath.relative_to) 
PurePath.relative_to() is specified to fail for arguments that are not on the 
original path (e.g. Path('/ham/beans').relative_to(Path('/spam'))).

I believe it would be useful to extend the behaviour of relative_to so that it 
handles the case above. For example, I would expect 
Path('/ham/beans').relative_to(Path('/spam')) to return Path('../ham/beans').

If this sounds like a useful change I'd be happy to make a PR for it.

--
components: Library (Lib)
messages: 380148
nosy: armins.bagrats
priority: normal
severity: normal
status: open
title: pathlib relative_to behaviour change
type: behavior
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



[issue42233] GenericAlias does not support union type expressions

2020-11-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

There is also a problem with typing module.

>>> typing.List[int] | dict[float, str]
typing.Union[typing.List[int], dict]

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue42233] GenericAlias does not support union type expressions

2020-11-01 Thread Ken Jin


Change by Ken Jin :


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

___
Python tracker 

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



[issue42225] Tkinter hangs or crashes when displaying astral chars

2020-11-01 Thread STINNER Victor


STINNER Victor  added the comment:

> Victor, do you see a color smiling face in my example or monochromatic or 
> just a bar?

See attached screenshot: fedora32.png.

--
Added file: https://bugs.python.org/file49556/fedora32.png

___
Python tracker 

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



[issue42233] GenericAlias does not support union type expressions

2020-11-01 Thread Ken Jin


New submission from Ken Jin :

Union type expressions added in PEP 604 throw an error when both operands are 
GenericAlias objects.

Eg the following works::

int | list[str]

The following throws TypeError::

list[int] | dict[float, str]
Traceback (most recent call last):
  File "", line 1, in 
TypeError: unsupported operand type(s) for |: 'types.GenericAlias' and 
'types.GenericAlias'

I have submitted a PR to fix this. Coincidentally, it also fixes the fact that 
union expressions weren't de-duplicating GenericAlias properly.

Eg::
>>> list[int] | int | list[int]
list[int] | int | list[int]

For non-GenericAlias type expressions, the new code shouldn't be much slower. 
Rich compare is only used for GenericAlias objects. This isn't very scientific, 
but 

python -m timeit "int | str | float"

# original
100 loops, best of 5: 295 nsec per loop

# purely rich compare
100 loops, best of 5: 344 nsec per loop

# check  for GenericAlias and rich compare only for that
100 loops, best of 5: 297 nsec per loop

--
components: Interpreter Core
messages: 380145
nosy: gvanrossum, kj, levkivskyi
priority: normal
severity: normal
status: open
title: GenericAlias does not support union type expressions
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



[issue42225] Tkinter hangs or crashes when displaying astral chars

2020-11-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Victor, do you see a color smiling face in my example or monochromatic or just 
a bar?

--

___
Python tracker 

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



[issue42225] Tkinter hangs or crashes when displaying astral chars

2020-11-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Yes, on Linux. Ubuntu 2020.04. Tk 8.6.10. X.Org X Server 1.20.8.

I tried to report the bug upstream, but failed. I did not use the Tk bugtracker 
several years, and it was on different computer, so I have no password to my 
account, and when I tried to create new accounts, I cannot login with them too. 
I tried to write to the mailing list, but it requires subscribing, and when I 
subscribed I did not receive a message with confirmation. If anybody can, 
please report this bug to Tk developers.

--

___
Python tracker 

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



[issue42232] mmap module add Darwin specific madvise options

2020-11-01 Thread David CARLIER


Change by David CARLIER :


--
components: macOS
nosy: devnexen, ned.deily, ronaldoussoren
priority: normal
pull_requests: 21996
severity: normal
status: open
title: mmap module add Darwin specific madvise options
type: enhancement

___
Python tracker 

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



Re: Best way to determine user's screensize?

2020-11-01 Thread songbird
Mats Wichmann wrote:
> On 10/30/20 6:47 PM, songbird wrote:
...
>>   do you object to a window being put in the approximate
>> center of the screen?
>
> Absolutely!  I'm fighting that on a system which, after an update,
> insists on opening new terminal windows centered - some recent policy
> change is now doing that instead of where the same thing was placed the
> last time it was open (I assume I'll find the knob for that eventually).
>  As others have said, there's no one-size-fits-all; on a big screen you
> certainly don't want the same things as on a phone, where "take over the
> whole screen" might indeed be the only thing that makes sense.

  to keep a program simple i made it to open in the center.
if i ever get back to it i'll have to figure out how to ask
the windowing system what it wants to do for placement and
then store that location as part of the configuration if the
person moves it.

  i don't use multiple screens yet nor do i mind moving an
item once when i'm starting up, but i could see where if 
there are a lot of windows that it would be annoying to 
have to move all of them.


  songbird
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Best way to determine user's screensize?

2020-11-01 Thread songbird
Grant Edwards wrote:
> On 2020-10-31, songbird  wrote:
...
>> do you object to a window being put in the approximate
>> center of the screen?
>
> YES. I've configured my window manager so windows start up where I
> want them to start up. It's none of the application's business where
> it's window is.
>
> When developing an application, try to remember IT'S NOT YOUR
> COMPUTER.

  certainly it isn't but it is my game and i kept it
simple.  if people don't like it then they can find
something else to play.  i'm good with that, but the
next time i get back to making changes i'll see what
i can figure out for saving the location where someone
has moved it.


  songbird
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue42173] Drop Solaris support

2020-11-01 Thread Marcel Hofstetter


Change by Marcel Hofstetter :


--
nosy: +jomasoftmarcel

___
Python tracker 

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



[issue42115] Caching infrastructure for the evaluation loop: specialised opcodes

2020-11-01 Thread STINNER Victor


STINNER Victor  added the comment:

> because you'd cache a pointer to the specific `+` operator implementation

You should have a look at "INCA: Inline Caching meets Quickening in Python 3.3":
https://bugs.python.org/issue14757

Stefan Brunthaler wrote a paper on his work:
"Inline Caching Meets Quickening" (Published in ECOOP 2010)
https://publications.sba-research.org/publications/ecoop10.pdf

--

___
Python tracker 

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



[issue41754] Webbrowser Module Cannot Find xdg-settings on OSX

2020-11-01 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

I've created a PR that ignores this exception.

--

___
Python tracker 

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



[issue41754] Webbrowser Module Cannot Find xdg-settings on OSX

2020-11-01 Thread Ronald Oussoren


Change by Ronald Oussoren :


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

___
Python tracker 

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



[issue42225] Tkinter hangs or crashes when displaying astral chars

2020-11-01 Thread STINNER Victor

STINNER Victor  added the comment:

Serhiy's test also work as expected.

$ wish
% label .l -text 

Since the Serhiy's test doesn't use Python, is it worth it to track this Tk 
crash in the Python bug tracker?

--

___
Python tracker 

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



[issue42225] Tkinter hangs or crashes when displaying astral chars

2020-11-01 Thread STINNER Victor

STINNER Victor  added the comment:

Hum, I didn't explain well. My test. I ran:

./python -m idlelib

In the IDLE shell, I wrote chr(0x1F604) which displays the emoji as expected:

>>> chr(0x1F604)
''

--

___
Python tracker 

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



Extending collections.Counter with top_n() to return elements by rank

2020-11-01 Thread Bora
collections.Counter has most_common([n]) method which returns the most
common n elements of the counter, but in case of a tie the result is
unspecified --- whereas in practice the order of insertion breaks the
tie. For example:

>>> Counter(["a","a","b","a","b","c","c","d"]).most_common(2)
[('a', 3), ('b', 2)]

>>> Counter(["a","a","c","a","b","b","c","d"]).most_common(2)
[('a', 3), ('c', 2)]

In some cases (which I believe are not rare) you would like to break
the tie yourself or get the top elements by *rank*. Using our example:

RankElements
   0{"a"}
   1{"b", "c"}
   2{"d"}

I propose a new method top_n(n) that returns the top elements in the
first n ranks. For example:

>>> Counter(["a","a","b","a","b","c","c","d"]).top_n(0)
[('a', 3)]

>>> Counter(["a","a","b","a","b","c","c","d"]).top_n(1)
[('a', 3), ('b', 2), ('c', 2)]

>>> Counter(["a","a","b","a","b","c","c","d"]).top_n(2)
[('a', 3), ('b', 2), ('c', 2), ('d', 1)]

>>> Counter(["a","a","b","a","b","c","c","d"]).top_n(99)
[('a', 3), ('b', 2), ('c', 2), ('d', 1)]

>>> Counter(["a","a","b","a","b","c","c","d"]).top_n(-1)
[]

Some points to discuss:

 * What the return type should be? A list of tuples like most_common()
   or List[Tuple[int, List[T]] that conveys the rank information too?
   Each tuple is a rank, whose first element is the frequency and
   second element is the list of elements. E.g. [(3, ['a']), (2, ['b',
   'c']), (1, ['d'])]
 * Rank starts at 0 or 1?
 * Shall negative numbers raise an exception or return an empty list
   like most_common()?

I would love to hear your opinion on this, and if there is interest, I
am happy to implement it too.

Regards,

Bora M. Alper
https://boramalper.org/


-- 
https://mail.python.org/mailman/listinfo/python-list


[issue42225] Tkinter hangs or crashes when displaying astral chars

2020-11-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I generated a script for testing all characters:

with open('withtest.sh', 'w', errors='surrogatepass') as f:
for i in range(0x100, 0x11): print(f"echo 'label .l -text \"{chr(i)}\"; 
exit' | wish 2>/dev/null && echo OK '\\U{i:08x}' {chr(i)!r} || echo FAIL 
'\\U{i:08x}' {chr(i)!r}", file=f)

It takes a time. It tested around 20% of all characters for 6-7 hours. And it 
seems that all failed characters are colored emojies and all passed characters 
are non-colored. Seems it is related either to the font that provides colored 
emojies, or to the mechanism that interprets such fonts, or Tk just cannot 
correctly handle the output when such fonts are used (maybe reserve too small 
buffer or cannot interpret result code).

--

___
Python tracker 

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



[issue42225] Tkinter hangs or crashes when displaying astral chars

2020-11-01 Thread STINNER Victor

STINNER Victor  added the comment:

Serhiy:
> I get a crash for chr(128516) ("") in Tk.

On Linux? What is your Tk version?

On my Fedora 32, the character is displayed properly. It seems like Tk is still 
using X11 whereas my GNOME desktop is using Wayland.

$ ./python -m test.pythoninfo|grep ^tkinter
tkinter.TCL_VERSION: 8.6
tkinter.TK_VERSION: 8.6
tkinter.info_patchlevel: 8.6.10

--

___
Python tracker 

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



[issue42231] test_zipimport failure

2020-11-01 Thread STINNER Victor


STINNER Victor  added the comment:

The test failed on many 3.x buildbots. Other examples:

* PPC64LE Fedora Rawhide 3.x: 
https://buildbot.python.org/all/#builders/455/builds/226
* AMD64 Windows10 3.x: https://buildbot.python.org/all/#builders/146/builds/295

--

___
Python tracker 

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



[issue42160] unnecessary overhead in tempfile

2020-11-01 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



[issue42231] test_zipimport failure

2020-11-01 Thread STINNER Victor

New submission from STINNER Victor :

ARM Raspbian 3.x:
https://buildbot.python.org/all/#/builders/424/builds/294

I don't understand why the test started to fail at build 294 which only has one 
new change: commit 2165cea548f961b308050f30d1f042a377651d44 ("bpo-29566: 
binhex.binhex now consitently writes MacOS 9 line endings"). It seems to be 
unrelated.

I failed to reproduce the issue on Linux.

==
FAIL: testBoth (test.test_zipimport.UncompressedZipImportTestCase)
--
Traceback (most recent call last):
  File 
"/var/lib/buildbot/workers/3.x.gps-raspbian/build/Lib/test/test_zipimport.py", 
line 194, in testBoth
self.doTest(pyc_ext, files, TESTMOD)
  File 
"/var/lib/buildbot/workers/3.x.gps-raspbian/build/Lib/test/test_zipimport.py", 
line 148, in doTest
self.assertEqual(file, os.path.join(TEMP_ZIP,
AssertionError: '/var[64 
chars]8289æ/test_python_worker_2163æ/junk95142.zip/ziptestmodule.py' != 
'/var[64 chars]8289æ/test_python_worker_2163æ/junk95142.zip/ziptestmodule.pyc'
- 
/var/lib/buildbot/workers/3.x.gps-raspbian/build/build/test_python_18289æ/test_python_worker_2163æ/junk95142.zip/ziptestmodule.py
+ 
/var/lib/buildbot/workers/3.x.gps-raspbian/build/build/test_python_18289æ/test_python_worker_2163æ/junk95142.zip/ziptestmodule.pyc
?   
   +


==
FAIL: testGetCompiledSource (test.test_zipimport.UncompressedZipImportTestCase)
--
Traceback (most recent call last):
  File 
"/var/lib/buildbot/workers/3.x.gps-raspbian/build/Lib/test/test_zipimport.py", 
line 594, in testGetCompiledSource
self.doTest(pyc_ext, files, TESTMOD, call=self.assertModuleSource)
  File 
"/var/lib/buildbot/workers/3.x.gps-raspbian/build/Lib/test/test_zipimport.py", 
line 148, in doTest
self.assertEqual(file, os.path.join(TEMP_ZIP,
AssertionError: '/var[64 
chars]8289æ/test_python_worker_2163æ/junk95142.zip/ziptestmodule.py' != 
'/var[64 chars]8289æ/test_python_worker_2163æ/junk95142.zip/ziptestmodule.pyc'
- 
/var/lib/buildbot/workers/3.x.gps-raspbian/build/build/test_python_18289æ/test_python_worker_2163æ/junk95142.zip/ziptestmodule.py
+ 
/var/lib/buildbot/workers/3.x.gps-raspbian/build/build/test_python_18289æ/test_python_worker_2163æ/junk95142.zip/ziptestmodule.pyc
?   
   +


==
FAIL: testBoth (test.test_zipimport.CompressedZipImportTestCase)
--
Traceback (most recent call last):
  File 
"/var/lib/buildbot/workers/3.x.gps-raspbian/build/Lib/test/test_zipimport.py", 
line 194, in testBoth
self.doTest(pyc_ext, files, TESTMOD)
  File 
"/var/lib/buildbot/workers/3.x.gps-raspbian/build/Lib/test/test_zipimport.py", 
line 148, in doTest
self.assertEqual(file, os.path.join(TEMP_ZIP,
AssertionError: '/var[64 
chars]8289æ/test_python_worker_2163æ/junk95142.zip/ziptestmodule.py' != 
'/var[64 chars]8289æ/test_python_worker_2163æ/junk95142.zip/ziptestmodule.pyc'
- 
/var/lib/buildbot/workers/3.x.gps-raspbian/build/build/test_python_18289æ/test_python_worker_2163æ/junk95142.zip/ziptestmodule.py
+ 
/var/lib/buildbot/workers/3.x.gps-raspbian/build/build/test_python_18289æ/test_python_worker_2163æ/junk95142.zip/ziptestmodule.pyc
?   
   +


==
FAIL: testGetCompiledSource (test.test_zipimport.CompressedZipImportTestCase)
--
Traceback (most recent call last):
  File 
"/var/lib/buildbot/workers/3.x.gps-raspbian/build/Lib/test/test_zipimport.py", 
line 594, in testGetCompiledSource
self.doTest(pyc_ext, files, TESTMOD, call=self.assertModuleSource)
  File 
"/var/lib/buildbot/workers/3.x.gps-raspbian/build/Lib/test/test_zipimport.py", 
line 148, in doTest
self.assertEqual(file, os.path.join(TEMP_ZIP,
AssertionError: '/var[64 
chars]8289æ/test_python_worker_2163æ/junk95142.zip/ziptestmodule.py' != 
'/var[64 chars]8289æ/test_python_worker_2163æ/junk95142.zip/ziptestmodule.pyc'
- 
/var/lib/buildbot/workers/3.x.gps-raspbian/build/build/test_python_18289æ/test_python_worker_2163æ/junk95142.zip/ziptestmodule.py
+ 
/var/lib/buildbot/workers/3.x.gps-raspbian/build/build/test_python_18289æ/test_python_worker_2163æ/junk95142.zip/ziptestmodule.pyc
?   
   

Re: Find word by given characters

2020-11-01 Thread Bischoop
On 2020-11-01, Bischoop  wrote:
> I'm working on a script i which user inputs letters and then a printed
> words containing those letters. The scripts works however I can't solve
> one problem , it prints also words in which these letters occur more 
> than once.
> ---
> Fore example:
> Letters: at
> Output: auto, autobahn.
> ---
>
> I supposed to not print word: "autobahn" because I've given it only one
> letter "a".
>

Problem's solved.


for word in words:
if all(word.count(x) == letters.count(x) for x in letters):
print(word)
-

Thanks for suggestions, I didn't had to use counter but going to look
into as it seems useful and interesting.

Thank You
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue24165] Free list for single-digits ints

2020-11-01 Thread STINNER Victor


STINNER Victor  added the comment:

> Inada-san, how do you interpret the results? Looks like it's 
> performance-neutral.

You should give a try to the development branch of pyperf which computes the 
geometric mean of all results and says if it's faster or slower overall :-D
https://mail.python.org/archives/list/sp...@python.org/thread/RANN6PQURUVPMNXS6GIOL42F2DIFV5LM/
(I'm still waiting for testers before releasing a new version including the new 
feature.)

--

___
Python tracker 

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



[issue37483] Add PyObject_CallOneArg()

2020-11-01 Thread Dong-hee Na


Change by Dong-hee Na :


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



[issue37483] Add PyObject_CallOneArg()

2020-11-01 Thread miss-islington


miss-islington  added the comment:


New changeset 0312efcd2bb3d7964dbfe2b4cbd5f5b440aed049 by Miss Skeleton (bot) 
in branch '3.9':
bpo-37483: Add PyObject_CallOneArg() in the What's New in Python 3.9 (GH-23062)
https://github.com/python/cpython/commit/0312efcd2bb3d7964dbfe2b4cbd5f5b440aed049


--

___
Python tracker 

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



[issue37483] Add PyObject_CallOneArg()

2020-11-01 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue37483] Add PyObject_CallOneArg()

2020-11-01 Thread Dong-hee Na


Dong-hee Na  added the comment:


New changeset 7feb54a6348f6220b2798686c812f110b53d by Dong-hee Na in branch 
'master':
bpo-37483: Add PyObject_CallOneArg() in the What's New in Python 3.9 (GH-23062)
https://github.com/python/cpython/commit/7feb54a6348f6220b2798686c812f110b53d


--

___
Python tracker 

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



[issue42207] Python 3.9 testing fails when building with clang and optimizations are enabled

2020-11-01 Thread STINNER Victor


STINNER Victor  added the comment:

> This bug no longer happens on master branch because it's related to 
> test_peg_generator.

test_peg_generator exists in 3.9 and master branches.

configure.ac doesn't seem to be different in 3.9 and master branches for 
PGO_PROF_USE_FLAG and LLVM_PROF_MERGER variables.

I don't understand why this change is specific to the 3.9 branch.

--
nosy: +vstinner

___
Python tracker 

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



[issue30053] Problems building with --enable-profiling on macOS

2020-11-01 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

The system compiler on macOS 10.9 or later doesn't support "-pg" (profile 
generation) at all:

$ clang -o t -pg t.c
clang: error: the clang compiler does not support -pg option on versions of OS 
X 10.9 and later

This means that its unlikely I'll look into this issue.

--

___
Python tracker 

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



[issue42140] asyncio.wait function creates futures set two times

2020-11-01 Thread Jakub Stasiak


Jakub Stasiak  added the comment:

I opened https://bugs.python.org/issue42230 to make the documentation reflect 
the reality in this matter.

--

___
Python tracker 

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



[issue42230] Document that asyncio's wait() and as_completed() accept arbitrary iterables

2020-11-01 Thread Jakub Stasiak


Change by Jakub Stasiak :


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

___
Python tracker 

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



[issue42230] Document that asyncio's wait() and as_completed() accept arbitrary iterables

2020-11-01 Thread Jakub Stasiak


New submission from Jakub Stasiak :

The documentation explicitly says "sets" but arbitrary iterables are accepted 
and various non-sets are passed to those in real world almost certainly.

--
components: asyncio
messages: 380128
nosy: asvetlov, jstasiak, yselivanov
priority: normal
severity: normal
status: open
title: Document that asyncio's wait() and as_completed() accept arbitrary 
iterables
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



[issue41835] Speed up dict vectorcall creation using keywords

2020-11-01 Thread Marco Sulla


Marco Sulla  added the comment:

I did PGO+LTO... --enable-optimizations --with-lto

--

___
Python tracker 

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



[issue42229] Fix SQLite warnings on macOS

2020-11-01 Thread Samuel Marks

New submission from Samuel Marks :

Planned to fix all the compiler warnings on macOS. Ended up just fixing this 
SQLite one:
```
Python-3.9.0/Modules/_sqlite/connection.c:1066:9: warning: 'sqlite3_trace' is 
deprecated: first deprecated in macOS 10.12
  [-Wdeprecated-declarations]
sqlite3_trace(self->db, 0, (void*)0);
^
sqlite3_trace_v2
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sqlite3.h:3022:36:
 note: 'sqlite3_trace' has
  been explicitly marked deprecated here
SQLITE_API SQLITE_DEPRECATED void *sqlite3_trace(
   ^
Python-3.9.0/Modules/_sqlite/connection.c:1069:9: warning: 'sqlite3_trace' is 
deprecated: first deprecated in macOS 10.12
  [-Wdeprecated-declarations]
sqlite3_trace(self->db, _trace_callback, trace_callback);
^
sqlite3_trace_v2
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sqlite3.h:3022:36:
 note: 'sqlite3_trace' has
  been explicitly marked deprecated here
SQLITE_API SQLITE_DEPRECATED void *sqlite3_trace(
   ^
```

Note that: `sqlite3_enable_shared_cache` should be removed from 
`Modules/_sqlite/module.c` also, as warning and guide says: 
https://www.sqlite.org/c3ref/enable_shared_cache.html
```
Python-3.9.0/Modules/_sqlite/module.c:147:10: warning: 
'sqlite3_enable_shared_cache' is deprecated: first deprecated in macOS
  10.7 - Not supported [-Wdeprecated-declarations]
```

But I think that would require a major version change, so let's keep that 
warning fix to one side.

Same with the tk issues, as per https://bugs.python.org/issue41016 ; although I 
suspect there's a way to quiet the warnings here…

--
components: Build
messages: 380126
nosy: samuelmarks
priority: normal
pull_requests: 21992
severity: normal
status: open
title: Fix SQLite warnings on macOS
type: compile error
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



[issue42228] Activate.ps1 clears PYTHONHOME

2020-11-01 Thread Ben Boeckel


New submission from Ben Boeckel :

On Windows, we are extracting a tarball of a Python installation for CI (to 
avoid needing to juggle umpteen Python installs on umpteen machines). This 
requires `PYTHONHOME` to be set to use properly since there is no registry 
entry for the "installation". However, `Activate.ps1` clears `PYTHONHOME` 
unconditionally. Is there something else we can do to properly integrate with 
it or should there be an option to say "no, I need `PYTHONHOME` for the stdlib 
to work"?

I don't know how relevant this is to other platforms at the moment as other 
mechanisms are sufficient there (Xcode's Python3.framework in the SDK and Linux 
system packages).

--
components: Windows
messages: 380125
nosy: mathstuf, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Activate.ps1 clears PYTHONHOME
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



  1   2   >