[issue39755] Change example of itertools.product

2020-02-25 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Thanks for the suggestion, but I will decline.  The existing wording 
communicates the intended mental relationship between the product() and nested 
for-loop.  IMO, the proposed change obfuscates that main point.  

The details of how product works are communicated in the pure python equivalent 
block that follows.  That code clearly shows that each pool is first converted 
to a tuple.  So, your point about infinite iterators is already covered and 
doesn't need to be said twice.

We could replace "the same as" with "roughly the same as", but I don't really 
think that would be an improvement.

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



Re: Difficulty in generating .exe from .py file

2020-02-25 Thread Abdur-Rahmaan Janhangeer
Can you share your codes? Thank you!

On Wed, 26 Feb 2020, 00:45 Aakash Jana,  wrote:

> I have made a simple web scraper that scrapes Wikipedia and prints some
> info on to the command line using requests and BeautifulSoup. Whenever I
> execute pyinstaller it gives an error "expected integer got type bytes"
> although the code runs perfectly. I am using python 3.8
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue39737] Speed up list.__eq__ by about 6%

2020-02-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you for your contribution Dennis.

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



[issue39737] Speed up list.__eq__ by about 6%

2020-02-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset be7ead62db9a1db3e2cd997b0beffd4480e51f5c by sweeneyde in branch 
'master':
bpo-39737: Remove code repitition in list_richcompare (GH-18638)
https://github.com/python/cpython/commit/be7ead62db9a1db3e2cd997b0beffd4480e51f5c


--

___
Python tracker 

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



[issue39756] Event sequence "KeyRelease-Shift_R" not being fired

2020-02-25 Thread Devin Morgan


New submission from Devin Morgan :

Trying to create a remake of Pong and am trying to use Right Control and Right 
Shift to move the right paddle up and down, moving the paddle down works fine 
but gets stuck in the move up state, despite my efforts root out logic errors 
through reviewing and debugging my code and the logic is correct.

--
components: Tkinter
files: Py-Pong.py
messages: 362682
nosy: Devin Morgan
priority: normal
severity: normal
status: open
title: Event sequence "KeyRelease-Shift_R" not being fired
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file48916/Py-Pong.py

___
Python tracker 

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



[issue39737] Speed up list.__eq__ by about 6%

2020-02-25 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Speed-up or not, I concur that the new code it clearer.

--
nosy: +rhettinger

___
Python tracker 

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



[issue39737] Speed up list.__eq__ by about 6%

2020-02-25 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

> Debug mode is not meaningful.
> Visual Studio will optimize fully on release mode.

Sorry if I wasn't clear--the original assembly difference I posted in 
(https://bugs.python.org/msg362665) was indeed using the "release" build 
configuration. My last comment was trying to demonstrate this fact by showing 
that the assembly output would have looked different if I had selected the 
"debug" build configuration. 

Is there something I'm missing, or was Visual Studio just missing an 
opportunity to optimize?

--

___
Python tracker 

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



[issue39737] Speed up list.__eq__ by about 6%

2020-02-25 Thread Dong-hee Na


Dong-hee Na  added the comment:

Debug mode is not meaningful.
Visual Studio will optimize fully on release mode.

--

___
Python tracker 

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



[issue39737] Speed up list.__eq__ by about 6%

2020-02-25 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

> Hmm, Is this build on release mode?

Yes--in debug mode, each Py_INCREF is these 8 instructions:


78BD071E  mov ecx,dword ptr [_Py_RefTotal (79039700h)]  
78BD0724  add ecx,1  
78BD0727  mov dword ptr [_Py_RefTotal (79039700h)],ecx  
78BD072D  mov edx,dword ptr [ebp-10h]  
78BD0730  mov eax,dword ptr [edx]  
78BD0732  add eax,1  
78BD0735  mov ecx,dword ptr [ebp-10h]  
78BD0738  mov dword ptr [ecx],eax  


instead of just the one `inc` in release mode.

--

___
Python tracker 

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



[issue39755] Change example of itertools.product

2020-02-25 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +rhettinger

___
Python tracker 

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



[issue39754] update_one_slot() does not inherit sq_contains and mp_subscript if they are explictly declared

2020-02-25 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

See also #34396.

--
nosy: +benjamin.peterson

___
Python tracker 

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



[issue39737] Speed up list.__eq__ by about 6%

2020-02-25 Thread Dong-hee Na


Dong-hee Na  added the comment:

>  it appears that Visual Studio on Windows 10 was not doing the optimization 
> one might expect.

Hmm, Is this build on release mode?

--

___
Python tracker 

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



[issue27657] urlparse fails if the path is numeric

2020-02-25 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Hi  Łukasz, There was a concern raised by python core-devs about behavior in 
3.9. I plan to address that point raised in this issue and close this ticket.

--

___
Python tracker 

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



Python 3.8.2 and 3.9.0a4 are now available

2020-02-25 Thread Łukasz Langa
On behalf of the entire Python development community, and the currently serving 
Python release team in particular, I’m pleased to announce the release of two 
of the latest Python editions.

Python 3.8.2

Python 3.8.2 is the second maintenance release of Python 3.8 and contains two 
months worth of bug fixes. Detailed information about all changes made in 3.8.2 
can be found in its change log 
.
 Note that compared to 3.8.1, version 3.8.2 also contains the changes 
introduced in 3.8.2rc1 and 3.8.2rc2.

The Python 3.8 series is the newest feature release of the Python language, and 
it contains many new features and optimizations. You can find Python 3.8.2 here:
https://www.python.org/downloads/release/python-382/ 

See the “What’s New in Python 3.8 
” document for more information 
about features included in the 3.8 series.

Maintenance releases for the 3.8 series will continue at regular bi-monthly 
intervals, with 3.8.3 planned for April 2020 (at the PyCon US sprints 
).

Python 3.9.0a4

An early developer preview of Python 3.9 is also ready:
https://www.python.org/downloads/release/python-390a4/ 

Python 3.9 is still in development. This releasee, 3.9.0a4 is the fourth of six 
planned alpha releases. Alpha releases are intended to make it easier to test 
the current state of new features and bug fixes and to test the release 
process. During the alpha phase, features may be added up until the start of 
the beta phase (2020-05-18) and, if necessary, may be modified or deleted up 
until the release candidate phase (2020-08-10). Please keep in mind that this 
is a preview release and its use is not recommended for production environments.

We hope you enjoy both!

Thanks to all of the many volunteers who help make Python Development and these 
releases possible! Please consider supporting our efforts by volunteering 
yourself or through organization contributions to the Python Software 
Foundation.
https://www.python.org/psf/ 
Your friendly release team,
Ned Deily
Steve Dower
Łukasz Langa
--
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/

Support the Python Software Foundation:
http://www.python.org/psf/donations/


Python 3.8.2 and 3.9.0a4 are now available

2020-02-25 Thread Łukasz Langa
On behalf of the entire Python development community, and the currently serving 
Python release team in particular, I’m pleased to announce the release of two 
of the latest Python editions.

Python 3.8.2

Python 3.8.2 is the second maintenance release of Python 3.8 and contains two 
months worth of bug fixes. Detailed information about all changes made in 3.8.2 
can be found in its change log 
.
 Note that compared to 3.8.1, version 3.8.2 also contains the changes 
introduced in 3.8.2rc1 and 3.8.2rc2.

The Python 3.8 series is the newest feature release of the Python language, and 
it contains many new features and optimizations. You can find Python 3.8.2 here:
https://www.python.org/downloads/release/python-382/ 

See the “What’s New in Python 3.8 
” document for more information 
about features included in the 3.8 series.

Maintenance releases for the 3.8 series will continue at regular bi-monthly 
intervals, with 3.8.3 planned for April 2020 (at the PyCon US sprints 
).

Python 3.9.0a4

An early developer preview of Python 3.9 is also ready:
https://www.python.org/downloads/release/python-390a4/ 

Python 3.9 is still in development. This releasee, 3.9.0a4 is the fourth of six 
planned alpha releases. Alpha releases are intended to make it easier to test 
the current state of new features and bug fixes and to test the release 
process. During the alpha phase, features may be added up until the start of 
the beta phase (2020-05-18) and, if necessary, may be modified or deleted up 
until the release candidate phase (2020-08-10). Please keep in mind that this 
is a preview release and its use is not recommended for production environments.

We hope you enjoy both!

Thanks to all of the many volunteers who help make Python Development and these 
releases possible! Please consider supporting our efforts by volunteering 
yourself or through organization contributions to the Python Software 
Foundation.
https://www.python.org/psf/ 
Your friendly release team,
Ned Deily
Steve Dower
Łukasz Langa
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue39529] Deprecate get_event_loop()

2020-02-25 Thread Yury Selivanov


Yury Selivanov  added the comment:

> For asyncio.Lock (plus other synchronization primitives) and asyncio.Queue, 
> this would be added in https://github.com/python/cpython/pull/18195. 
> Currently waiting on emanu (author of the PR) to finish up some changes, but 
> it's mostly complete. Could I work on adding it to asyncio.Future and other 
> classes in the meantime?

I think the approach should be different:


  # leading underscore is significant:
  loop = asyncio._get_running_loop()  
  if loop is None:
issue_deprecation_warning()
loop = asyncio.get_event_loop()

--

___
Python tracker 

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



[issue39698] asyncio.sleep() does not adhere to time.sleep() behavior for negative numbers

2020-02-25 Thread Yury Selivanov


Yury Selivanov  added the comment:

> Source?

I could not find a good source, sorry. I remember I had a complaint in uvloop 
to support negative timeouts, but I can't trace it. 

That said, I also distinctly remember seeing code (and writing such code 
myself) that performs computation on timeouts and does not care if the end 
value goes below 0.  It might be a weak data point but it's still a valid one.

> IMHO, deprecating and then removing support for negative argument in 
> `asyncio.sleep()` is very much less breaking compared to issues #36921 and 
> #36373 .

Breaking code/APIs always has a price and we always try to have a very good 
explanation "why" we want to bother ourselves and users to break backwards 
compat.  This one is not worth it IMHO.

We have more breaking API changes that are more substantial coming in future 
versions of asyncio. So I try to limit the impact by only breaking what's 
really necessary.

--

___
Python tracker 

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



[issue39755] Change example of itertools.product

2020-02-25 Thread Mark Bell


New submission from Mark Bell :

The documentation for itertools.product at: 
https://docs.python.org/3/library/itertools.html#itertools.product
currently says that:

For example, product(A, B) returns the same as ((x,y) for x in A for y in B)

While this is broadly correct, since product first converts its arguments to 
tuples, this is not true if A or B are infinite iterables. For example, when A 
= itertools.count() and B = range(2) then the former runs forever using 
infinite memory, whereas the latter returns the lazy generator immediately for 
use.

Would it be clearer / more correct to instead say:

For example, product(A, B) returns the same as ((x,y) for x in tuple(A) for 
y in tuple(B))

--
assignee: docs@python
components: Documentation
messages: 362672
nosy: Mark.Bell, docs@python
priority: normal
severity: normal
status: open
title: Change example of itertools.product
versions: Python 3.5

___
Python tracker 

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



[issue30064] BaseSelectorEventLoop.sock_{recv, sendall}() don't remove their callbacks when canceled

2020-02-25 Thread Yury Selivanov


Yury Selivanov  added the comment:

> I very doubt if any sane code is organizing like this test: start delayed 
> reading, cancel it and read again.

Hm, cancellation should work correctly no matter how "sane" or "insane" the 
user code is.

> The worse, neither previous not current sock_read() implementation doesn't 
> prevent the concurrent reading which basically delivers data in an 
> unpredictable order.

But we're not discussing using a socket concurrently -- asyncio explicitly does 
not support that for the sock_ api. 

AFAICT this issue is about consequent cancel operation not working as expected 
in asyncio, no?

--

___
Python tracker 

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



[issue39622] KeyboardInterrupt is ignored when await asyncio.sleep(0)

2020-02-25 Thread Maor Kleinberger


Maor Kleinberger  added the comment:

While looking into this proposal, I realized that this will not wake up the 
loop from the select call. I think the safest solution would be to use the 
wakeup fd mechanism.

An additional easy, but less secure solution would be to define an internal 
'signal safe' context manager that will be used only in the critical parts.

What do you think?

--

___
Python tracker 

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



Re: encapsulating a global variable

2020-02-25 Thread Greg Ewing

On 26/02/20 3:56 am, BlindAnagram wrote:

Does that not have the advantage of preventing the global
directory being directly fiddled with elsewhere?


That depends on what you mean by "prevent". There is nothing
to stop any code from directly accessing the .seen attribute
of the class.

It might make it less likely that someone will inadvertently
write code that does this.

If there will only ever be one instance of the dict, another
approach would be to put it into a dedicated module together
with the functions that access it. That will give you the
same amount of protection, while ensuring that there really
is only one instance, and making this fact clear to anyone
reading the code.

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


Re: encapsulating a global variable

2020-02-25 Thread Greg Ewing

On 26/02/20 4:06 am, BlindAnagram wrote:

My interest in this stems from wanting to keep the dictionary only
available to the function that uses it and also a worry about being
called from threaded code.


Doing this won't make any difference to the way threaded code behaves.
Threading problems need to be addressed by appropriate use of locks,
etc.

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


[issue1207613] Idle Editor: Bottom Scroll Bar

2020-02-25 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Some IDLE users really want a horizontal scrollbar (for the editor), and even 
consider its absence to be a reason to not use it.

Stackoverflow 2012: 
https://stackoverflow.com/questions/10301071/is-there-a-horizontal-scroll-bar-in-pythons-idle

Reddit 2020: 
https://stackoverflow.com/questions/10301071/is-there-a-horizontal-scroll-bar-in-pythons-idle
This was brought to my attention by Steven D'Aprano and specifically compare 
the IDLE editor to other editors.

I have decided to not wait until a possible major refactoring to add this 
feature.  The patch needs several revisions (see review).

I neglected to mention above (msg352888) that the scrollbar added to the font 
sample box is a Scrollbar subclass, textview.AutoHideScrollbar, that only 
appears when needed.  After experimenting with editing the font sample, I think 
we can just add this with no option to disable it.

Since editor windows already allow lines longer than the window width and 
already have horizontal scrolling by cursor motion, such as by Home, End, and 
Left and Right arrow keys, adding a horizontal scrollbar makes scrolling 
easier, but does not really change editor window behavior.  The disappearance 
of the scrollbar when a long line is sufficiently shortened makes it easier to 
determine when one has shortened a line enough to meet the window width as a 
limit, if one wishes. 

The shell is a different issue.  It wraps at the window width, just like 
standard interactive Python (as least on Windows with Command Prompt and macOS 
with Terminal).  I think something like the following is better wrapped.  If 
nothing else, copying to paste is easier ;-).  

>>> 2**1024
179769313486231590772930519078902473361797697894230657273430081157732675805500963132708477322407536021120113879871393357658789768814416622492847430639474124377767893424865485276302219601246094119453082952085005768838150682342462881473913110540827237163350510684586298239947245938479716304835356329624224137216

So, at least for now, no hbar for Shell.

--

___
Python tracker 

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



[issue39622] KeyboardInterrupt is ignored when await asyncio.sleep(0)

2020-02-25 Thread Maor Kleinberger


Maor Kleinberger  added the comment:

Damn, good catch. How about the following idea - register a normal signal 
handler (using signal.signal) that does something like:

def sigint_handler():
get_running_loop().interrupt()

# in class BaseEventLoop
def interrupt(self):
# Might be a generally useful thread-safe way to interrupt a loop
if self._is_inside_callback():
_thread.interrupt_main() # All this behavior is only relevant to the 
main thread anyway
else:
self._interrupted = True

And inside BaseEventLoop._run_once() add the following check:

# in class BaseEventLoop
def _check_interrupted(self):
# This will be called by BaseEventLoop._run_once() before calling select,
# and before popping any handle from the ready queue
if self._interrupted:
raise KeyboardInterrupt

--

___
Python tracker 

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



[issue36144] Dictionary union. (PEP 584)

2020-02-25 Thread Brandt Bucher


Change by Brandt Bucher :


--
title: Dictionary addition. (PEP 584) -> Dictionary union. (PEP 584)

___
Python tracker 

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



[issue38403] nuspec iconUrl field is deprecated

2020-02-25 Thread Steve Dower


Steve Dower  added the comment:

Not enough value fixing 3.7 and 2.7 at this stage - nuget.org can't actively 
*break* the old format without spoiling half the repository, so I'm sure it'll 
be fine to leave them as they are for the last few uploads.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 2.7, Python 3.7

___
Python tracker 

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



Difficulty in generating .exe from .py file

2020-02-25 Thread Aakash Jana
I have made a simple web scraper that scrapes Wikipedia and prints some
info on to the command line using requests and BeautifulSoup. Whenever I
execute pyinstaller it gives an error "expected integer got type bytes"
although the code runs perfectly. I am using python 3.8
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue36144] Dictionary addition. (PEP 584)

2020-02-25 Thread Steve Dower


Steve Dower  added the comment:

That's a much simpler example. And of course:

>>> z[False] = False
>>> z
{0: False}

So the precedent is well established that the key doesn't get updated with the 
value.

No further questions, yer honour ;)

--

___
Python tracker 

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



[issue17050] argparse.REMAINDER doesn't work as first argument

2020-02-25 Thread Roundup Robot


Change by Roundup Robot :


--
keywords: +patch
nosy: +python-dev
nosy_count: 4.0 -> 5.0
pull_requests: +18022
stage: test needed -> patch review
pull_request: https://github.com/python/cpython/pull/18661

___
Python tracker 

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



[issue39737] Speed up list.__eq__ by about 6%

2020-02-25 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

I made the requested changes to reflect that this is for code cleanliness 
rather than strictly for performance.

However, it appears that Visual Studio on Windows 10 was not doing the 
optimization one might expect. In particular, here is the disassembly before 
this PR:

===
PyObject *vitem = vl->ob_item[i];
78E20C49  mov eax,dword ptr [edx+0Ch]  
PyObject *vitem = vl->ob_item[i];
78E20C4C  mov ecx,dword ptr [eax+edi*4]  
PyObject *witem = wl->ob_item[i];
78E20C4F  mov eax,dword ptr [esi+0Ch]  
78E20C52  mov dword ptr [vitem],ecx  
78E20C55  mov esi,dword ptr [eax+edi*4]  
78E20C58  mov dword ptr [witem],esi  
if (vitem == witem) {
78E20C5B  cmp ecx,esi  
78E20C5D  je  list_richcompare+12Bh (78E20CFBh)  
continue;
}

Py_INCREF(vitem);
78E20C63  inc dword ptr [ecx]  
Py_INCREF(witem);
78E20C65  inc dword ptr [esi]  
int k = PyObject_RichCompareBool(vl->ob_item[i], 
78E20C67  mov eax,dword ptr [w]  
78E20C6A  mov eax,dword ptr [eax+0Ch]  
78E20C6D  mov ebx,dword ptr [eax+edi*4]  
78E20C70  mov eax,dword ptr [edx+0Ch]  
78E20C73  mov eax,dword ptr [eax+edi*4]  
78E20C76  cmp eax,ebx  
78E20C78  jne list_richcompare+0B1h (78E20C81h)  
78E20C7A  mov ebx,1  
78E20C7F  jmp list_richcompare+100h (78E20CD0h)  
78E20C81  push2  
78E20C83  pushebx  
78E20C84  pusheax  
78E20C85  callPyObject_RichCompare (78E35120h)  
78E20C8A  mov esi,eax  
78E20C8C  add esp,0Ch  
78E20C8F  testesi,esi  
78E20C91  jne list_richcompare+0C8h (78E20C98h)  
78E20C93  or  ebx,0h  
78E20C96  jmp list_richcompare+0FAh (78E20CCAh)  
78E20C98  cmp dword ptr [esi+4],offset PyBool_Type (790A3420h)  
===

And after this PR:
===
PyObject *vitem = vl->ob_item[i];
795E0C4A  mov eax,dword ptr [edx+0Ch]  
PyObject *vitem = vl->ob_item[i];
795E0C4D  mov ebx,dword ptr [eax+ecx*4]  
PyObject *witem = wl->ob_item[i];
795E0C50  mov eax,dword ptr [edi+0Ch]  
795E0C53  mov edi,dword ptr [eax+ecx*4]  
if (vitem == witem) {
795E0C56  cmp ebx,edi  
795E0C58  je  list_richcompare+109h (795E0CD9h)  
continue;
}

Py_INCREF(vitem);
795E0C5A  inc dword ptr [ebx]  
Py_INCREF(witem);
795E0C5C  inc dword ptr [edi]  
int k = PyObject_RichCompareBool(vitem, witem, Py_EQ);
795E0C5E  push2  
795E0C60  pushedi  
795E0C61  pushebx  
795E0C62  callPyObject_RichCompare (795F5120h)  
795E0C67  mov esi,eax  
795E0C69  add esp,0Ch  
795E0C6C  testesi,esi  
795E0C6E  jne list_richcompare+0A5h (795E0C75h)  
795E0C70  or  esi,0h  
795E0C73  jmp list_richcompare+0DBh (795E0CABh)  
795E0C75  cmp dword ptr [esi+4],offset PyBool_Type (79863420h)  
795E0C7C  jne list_richcompare+0BBh (795E0C8Bh)  
795E0C7E  xor eax,eax  
795E0C80  cmp esi,offset _Py_TrueStruct (798633FCh)  
795E0C86  seteal  
795E0C89  jmp list_richcompare+0C4h (795E0C94h)  
795E0C8B  pushesi  
795E0C8C  callPyObject_IsTrue (795F62F0h)  
795E0C91  add esp,4  
795E0C94  add dword ptr [esi],0h  
795E0C97  mov dword ptr [k],eax  
795E0C9A  jne list_richcompare+0D8h (795E0CA8h)  
===

--

___
Python tracker 

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



[issue38403] nuspec iconUrl field is deprecated

2020-02-25 Thread miss-islington


miss-islington  added the comment:


New changeset 1bbb81b251bcc8b05e0cd33cd36aef55481b13db by Miss Islington (bot) 
in branch '3.8':
bpo-38403: Update nuspec file for deprecated field and git repository (GH-18657)
https://github.com/python/cpython/commit/1bbb81b251bcc8b05e0cd33cd36aef55481b13db


--

___
Python tracker 

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



[issue36144] Dictionary addition. (PEP 584)

2020-02-25 Thread Brandt Bucher


Brandt Bucher  added the comment:

As a somewhat simpler example:

>>> f = {False: False}
>>> z = {0: 0}
>>> f | z
{False: 0}
>>> {**f, **z}
{False: 0}
>>> f.update(z); f
{False: 0}

Though these hairier cases aren't explicitly addressed, the conflict behavior 
is covered in the Rationale and Reference Implementation sections of the PEP. 
All of the above examples share code (`dict_update_arg`), and that's definitely 
intentional. I for one think it would be confusing (and probably a bug) if one 
of the examples above gave a different key-value pair!

I find it makes more sense if you see a set as valueless keys (rather than 
keyless values).

--

___
Python tracker 

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



[issue39754] update_one_slot() does not inherit sq_contains and mp_subscript if they are explictly declared

2020-02-25 Thread Marco Sulla


New submission from Marco Sulla :

I noticed that `__contains__()` and `__getitem__()` of subclasses of `dict` are 
much slower. I asked why on StackOverflow, and an user seemed to find the 
reason.

The problem for him/her is that `dict` implements directly `__contains__()` and 
`__getitem__()`. Usually, `sq_contains` and `mp_subscript` are wrapped to 
implement `__contains__()` and `__getitem__()`, but this way `dict` is a little 
faster, I suppose.

The problem is that `update_one_slot()` searches for the wrappers. If it does 
not find them, it does not inherit the `__contains__()` and `__getitem__()` of 
the class, but create a `__contains__()` and `__getitem__()` functions that do 
an MRO search and call the superclass method. This is why `__contains__()` and 
`__getitem__()` of `dict` subclasses are slower.


Is it possible to modify `update_one_slot()` so that, if no wrapper is found, 
the explicit implementation is inherited?

SO answer: https://stackoverflow.com/a/59914459/1763602

--
components: C API
messages: 362662
nosy: Marco Sulla
priority: normal
severity: normal
status: open
title: update_one_slot() does not inherit sq_contains and mp_subscript if they 
are explictly declared
type: performance
versions: Python 3.9

___
Python tracker 

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



[issue38403] nuspec iconUrl field is deprecated

2020-02-25 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue38403] nuspec iconUrl field is deprecated

2020-02-25 Thread Steve Dower


Steve Dower  added the comment:


New changeset d6448919702142123d937a54f20a81aeaf8d2acc by Steve Dower in branch 
'master':
bpo-38403: Update nuspec file for deprecated field and git repository (GH-18657)
https://github.com/python/cpython/commit/d6448919702142123d937a54f20a81aeaf8d2acc


--

___
Python tracker 

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



[issue36144] Dictionary addition. (PEP 584)

2020-02-25 Thread Steve Dower


Steve Dower  added the comment:

Not sure if this is a big deal or not, and it seems likely that the preexisting 
behaviour of .update() and ** unpacking have already decided it, but is it 
intentional that you end up with the first-seen key and the last-seen value in 
the case of collisions?

class C:
def __init__(self, *a): self.a = a
def __hash__(self): return hash(self.a[0])
def __eq__(self, o): return self.a[0] == o.a[0]
def __repr__(self): return f"C{self.a}"

>>> c1 = C(1, 1); c1
C(1, 1)
>>> c2 = C(1, 2); c2
C(1, 2)

For set union we get the first seen value:
>>> {c1} | {c2}
{C(1, 1)}

For dict union we get the first seen key and the last seen value:
>>> {c1: 'a'} | {c2: 'b'}
{C(1, 1): 'b'}

But similarly for dict unpack (and .update(); code left as an exercise to the 
reader):
>>> {**{c1: 'a'}, **{c2: 'b'}}
{C(1, 1): 'b'}

So the union of two dicts may contain .items() elements that were not in either 
of the inputs.

Honestly, I've never noticed this before, as the only time I create equivalent 
objects with meaningfully-distinct identities is to use with sets. I just 
figured I'd try it out after seeing suggestions that the dict union operands 
were transposed from set union.

--
nosy: +steve.dower

___
Python tracker 

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



[issue36144] Dictionary addition. (PEP 584)

2020-02-25 Thread Brandt Bucher


Change by Brandt Bucher :


--
pull_requests: +18020
pull_request: https://github.com/python/cpython/pull/18659

___
Python tracker 

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



[issue38410] Possible fatal errors due to _PyEval_SetAsyncGen{Finalizer, Firstiter}()

2020-02-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

PR 18658 is a backport to 3.8 which preserves binary compatibility.

--

___
Python tracker 

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



[issue38410] Possible fatal errors due to _PyEval_SetAsyncGen{Finalizer, Firstiter}()

2020-02-25 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +18019
pull_request: https://github.com/python/cpython/pull/18658

___
Python tracker 

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



[issue37373] Configuration of windows event loop for libraries

2020-02-25 Thread Ben Darnell


Ben Darnell  added the comment:

I considered using the `selectors` module directly, but it's not as simple as 
it sounds. Using the low-level interface means you need to also use a 
self-waker-pipe (or socket on windows) and manage a queue analogous to that 
used by `call_soon_threadsafe`. We already have two implementations of this 
pattern in asyncio with subtle differences between them (such as this one i 
just found: https://bugs.python.org/issue39651). In the end you'd have to 
duplicate a non-trivial portion of SelectorEventLoop. 

While there might be some efficiency gains to be had by working directly with 
the lower-level interface (and avoiding some redundancies between the two 
threads' event loops), I think the most robust/safest option is to use the 
well-tested SelectorEventLoop so that the only new code is what's needed to 
pass things back and forth between threads.

--

___
Python tracker 

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



[issue39753] inspecting a partial with bound keywods gives incorrect signature

2020-02-25 Thread Chris Withers


Chris Withers  added the comment:

Surprised partials have no explicit signature:

>>> p.__signature__
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'functools.partial' object has no attribute '__signature__'

--

___
Python tracker 

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



[issue38403] nuspec iconUrl field is deprecated

2020-02-25 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue39753] inspecting a partial with bound keywods gives incorrect signature

2020-02-25 Thread Chris Withers


Change by Chris Withers :


--
components: +Library (Lib)
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



[issue39753] inspecting a partial with bound keywods gives incorrect signature

2020-02-25 Thread Chris Withers


New submission from Chris Withers :

$ python
Python 3.8.1 (v3.8.1:1b293b6006, Dec 18 2019, 14:08:53) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from functools import partial
>>> def foo(x, y, z, a=None): pass
... 
>>> p = partial(foo, 1, y=2)
>>> from inspect import signature
>>> signature(p).parameters.values()
odict_values([, , ])

That  shouldn't be in there:

>>> p(2, y=3)
Traceback (most recent call last):
  File "", line 1, in 
TypeError: foo() got multiple values for argument 'y'

--
messages: 362656
nosy: cjw296
priority: normal
severity: normal
status: open
title: inspecting a partial with bound keywods gives incorrect signature

___
Python tracker 

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



[issue39750] UnicodeError becomes unpicklable if data is appended to args

2020-02-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Yes, this is how exceptions are pickled. You save an information which which 
allows you to recreate the exception. If you fake args, you do not able to 
recreate it.

Just do not do this.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



Re: Tkinter layout designer

2020-02-25 Thread mm0fmf
I don't claim to be an expert on Windows Forms, I inherited the support 
role and have added the odd widget over the years. The apps work but 
scream that their UI has been incrementally arrived at by someone who 
was just tinkering. :-)


Thanks for the suggestions, I'll give Page a try.

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


[issue38519] Internal include files missing on Windows

2020-02-25 Thread Steve Dower


Change by Steve Dower :


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



Re: encapsulating a global variable (BlindAnagram)

2020-02-25 Thread BlindAnagram
On 25/02/2020 17:16, Christman, Roger Graydon wrote:
>> On Tue, 25 Feb 2020 3:06 PM BlindAnagram  wrote:
> 
>> My interest in this stems from wanting to keep the dictionary only
>> available to the function that uses it and also a worry about being
>> called from threaded code.
> 
> It seems like the simplest solution for this is to make
> a completely new file (module) containing nothing but
> the dictionary and this one function that uses it.
> Then you can import the function from the module
> wherever it is called without importing the dictionary.
> 
> The thing I find curious is that apparently no other
> function is allowed to create or populate the dictionary
> in the first place.   Is it practical to have the entire
> dictionary statically defined?

The dictionary is a static variable of the function. It is updated by
the function and must maintain values across function calls.

Reading some more, it seems that I can create static function variables
using attributes.

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


[issue39737] Speed up list.__eq__ by about 6%

2020-02-25 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I have doubts that such small change can lead to significant speed up. It is 
likely a compiler glitch.

But this change makes the code clearer. If you remove a NEWS entry with a 
doubtful promise I will accept it.

--

___
Python tracker 

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



[issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised

2020-02-25 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue39739] Python crash every time opening pycharm, seems related to tensorflow

2020-02-25 Thread nono


New submission from nono :

Hey,

Whenever I try to open project in Pycharm, it will update python interpreter 
before the python process crashes with a SIGABRT and I get a crash window from 
OSX. I use homebrew with the latest packages and python 3.7.6.

Any help is appreciated. Here's the log:

Process:   Python [3240]
Path:  
/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python
Identifier:Python
Version:   3.7.6 (3.7.6)
Code Type: X86-64 (Native)
Parent Process:Python [2877]
Responsible:   pycharm [2777]
User ID:   501

Date/Time: 2020-02-23 20:43:10.553 -0500
OS Version:Mac OS X 10.15.3 (19D76)
Report Version:12


Time Awake Since Boot: 17000 seconds
Time Since Wake:   1000 seconds

System Integrity Protection: enabled

Crashed Thread:0  Dispatch queue: com.apple.main-thread

Exception Type:EXC_CRASH (SIGABRT)
Exception Codes:   0x, 0x
Exception Note:EXC_CORPSE_NOTIFY

Application Specific Information:
/usr/local/lib/python3.7/site-packages/tensorflow_core/compiler/tf2xla/ops/_xla_ops.so
crashed on child side of fork pre-exec

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib  0x7fff656707fa __pthread_kill + 10
1   libsystem_pthread.dylib 0x7fff6572dbc1 pthread_kill + 432
2   libsystem_c.dylib   0x7fff655873a2 raise + 26
3   libsystem_platform.dylib0x7fff6572242d _sigtramp + 29
4   ??? 0x7fff8f33a988 __c_locale + 1480
5   libsystem_c.dylib   0x7fff655f7a1c abort + 120
6   libtensorflow_framework.2.dylib 0x000122394bec 
tensorflow::internal::LogMessageFatal::~LogMessageFatal() + 44
7   libtensorflow_framework.2.dylib 0x000122394c20 
tensorflow::internal::LogMessageFatal::~LogMessageFatal() + 16
8   libtensorflow_framework.2.dylib 0x000121c0452a 
tensorflow::OpRegistry::Register(std::__1::function const&) + 186
9   libtensorflow_framework.2.dylib 0x000121c06280 
tensorflow::register_op::OpDefBuilderReceiver::OpDefBuilderReceiver(tensorflow::register_op::OpDefBuilderWrapper
 const&) + 128
10  _xla_ops.so 0x0001304d6515 
_GLOBAL__sub_I_xla_ops.cc + 757
11  dyld0x00010640e15d 
ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) + 539
12  dyld0x00010640e582 
ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) + 40
13  dyld0x000106408dc7 
ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned 
int, char const*, ImageLoader::InitializerTimingList&, 
ImageLoader::UninitedUpwards&) + 493
14  dyld0x000106406e58 
ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, 
ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) + 188
15  dyld0x000106406ef8 
ImageLoader::runInitializers(ImageLoader::LinkContext const&, 
ImageLoader::InitializerTimingList&) + 82
16  dyld0x0001063f8f87 
dyld::runInitializers(ImageLoader*) + 82
17  dyld0x000106402ad7 dlopen_internal + 609
18  libdyld.dylib   0x7fff65514a7f dlopen + 171
19  org.python.python   0x00010399e759 
_PyImport_FindSharedFuncptr + 301
20  org.python.python   0x00010397d5c2 
_PyImport_LoadDynamicModuleWithSpec + 495
21  org.python.python   0x00010397d138 _imp_create_dynamic 
+ 309
22  org.python.python   0x0001038d2472 
_PyMethodDef_RawFastCallDict + 549
23  org.python.python   0x0001038d1a83 
_PyCFunction_FastCallDict + 41
24  org.python.python   0x00010396065a 
_PyEval_EvalFrameDefault + 7738
25  org.python.python   0x000103967b15 
_PyEval_EvalCodeWithName + 1698
26  org.python.python   0x0001038d1d88 
_PyFunction_FastCallKeywords + 212
27  org.python.python   0x000103967321 call_function + 737
28  org.python.python   0x00010396028f 
_PyEval_EvalFrameDefault + 6767
29  org.python.python   0x0001038d2194 
function_code_fastcall + 106
30  org.python.python   0x000103967321 call_function + 737
31  org.python.python   0x000103960276 
_PyEval_EvalFrameDefault + 6742
32  org.python.python   0x0001038d2194 
function_code_fastcall + 106
33  org.python.python   0x000103967321 call_function + 737
34  org.python.python   

[issue38597] C Extension import limit

2020-02-25 Thread Steve Dower


Steve Dower  added the comment:

You should be able to install "wheel" without setuptools to get the bdist_wheel 
command.

Can you confirm that the build process is actually using that Visual Studio 
install? If it's going through the regular distutils detection process then it 
ought to be finding the right files.

--

___
Python tracker 

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



[issue38410] Possible fatal errors due to _PyEval_SetAsyncGen{Finalizer, Firstiter}()

2020-02-25 Thread Steve Dower


Steve Dower  added the comment:

I thought we weren't going to take the fix for 3.8 anyway? (Or did we make a 
smaller one and commit it directly, apparently without linking it to the issue 
correctly?)

The status is the PR needs conflicts resolved, and people need to stop adding 
to my infinite list of GitHub notifications and ping me on here instead :)

--

___
Python tracker 

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



Re: Tkinter layout designer

2020-02-25 Thread jfong
mm0fmf於 2020年2月25日星期二 UTC+8上午5時29分33秒寫道:
> Can anyone recommend a graphic layout designer for Tkinter programs. I 
> have a number of older C# Windows Forms apps that need porting so they 
> can run on Linux and Windows and this is the chance to re-write them in 
> Python. However, after using the forms designer in Visual Studio, 
> manually coding up the widget positions etc. is a real pain in the 
> backside.
> 
> So please, recommendations for a designer that is usable and functional 
> please to save me working through everything a Google search throws up.
> 
> Thanks,
> Andy

Download PAGE here:
https://sourceforge.net/projects/page/

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


[issue39752] multiprocessing halts when child process crashes/quits

2020-02-25 Thread João Eiras

New submission from João Eiras :

Hi.

When one of the processes in a multiprocessing.pool picks up a task then then 
somehow crashes (and by crash I mean crashing the python process with something 
like a SEGV) or is killed, the pool in the main process will notice one of the 
workers died and will repopulate the pool, but it does not keep track which 
task was being handled by the process that died. As consequence, a caller 
waiting for a result will get stuck forever.

Example:
with multiprocessing.Pool(1) as pool:
result = pool.map_async(os._exit, [1]).get(timeout=2)

I found this because I was trying to use a lock with a spawned process on linux 
and that caused a crash and my program froze, but that is another issue.

--
components: Extension Modules
messages: 362651
nosy: João Eiras
priority: normal
severity: normal
status: open
title: multiprocessing halts when child process crashes/quits
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



Re: encapsulating a global variable

2020-02-25 Thread Dieter Maurer
BlindAnagram wrote at 2020-2-25 12:38 +:
>I would appreciate advice on whether it is possible to avoid the use of
>a global variable used in a function by encapsulating it in a class
>without maaking any changes to the call interface (which I cannot change).
>
>I have:
>
>
>seen = dict()
>
>def get_it(piece):
>   ...
>   return seen[piece]
>
>
>and I am wondering if it is possible to use a class something like
>
>
>class get_it(object):
>
>  seen = dict()
>
>  def __call__(piece):
>return seen[piece]
>
>
>to avoid the global variable.

Apparently, you are ready to change the function.
In this case, you might be interested in `rebindFunction` from
the package `dm.reuse`.
Its primary purpose is to reuse a foreign function in one's own
code with minor modifications. One of the supported minor
modifications is to change globals seen by the function.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: encapsulating a global variable (BlindAnagram)

2020-02-25 Thread Christman, Roger Graydon
> On Tue, 25 Feb 2020 3:06 PM BlindAnagram  wrote:

> My interest in this stems from wanting to keep the dictionary only
> available to the function that uses it and also a worry about being
> called from threaded code.

It seems like the simplest solution for this is to make
a completely new file (module) containing nothing but
the dictionary and this one function that uses it.
Then you can import the function from the module
wherever it is called without importing the dictionary.

The thing I find curious is that apparently no other
function is allowed to create or populate the dictionary
in the first place.   Is it practical to have the entire
dictionary statically defined?

Roger Christman
Pennsylvania State University
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: encapsulating a global variable

2020-02-25 Thread BlindAnagram
On 25/02/2020 16:36, Rhodri James wrote:
> On 25/02/2020 15:20, BlindAnagram wrote:
>>> class GetIt:
>>>    seen = dict()
>>>
>>>    def __call__(self, piece):
>>>  return GetIt.seen[piece]
>>>
>>> get_it = GetIt()
>>>
>>> but then you have a global class instance hanging around, which is not
>>> actually any better than a global dictionary.
>> This doesn't work for me since get_it(piece) returns the error:
>>
>> builtins.TypeError: get_it() takes no arguments
> 
> It works for me (pace sticking something in GetIt.seen to avoid getting
> a KeyError).  You aren't muddling up the class name and instance name
> are you?

Apologies, I misunderstoof your proposal - it woks fine now I have
understood it

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


[issue39705] Tutorial, 5.6 Looping Techniques, sorted() example

2020-02-25 Thread Rahul Kumaresan


Rahul Kumaresan  added the comment:

I would like to work on this documentation improvement task.
Please help me understand if this is not being worked on already.

--
nosy: +rahul-kumi

___
Python tracker 

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



[issue39751] multiprocessing breaks when payload fails to unpickle

2020-02-25 Thread João Eiras

Change by João Eiras :


--
type:  -> crash

___
Python tracker 

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



Re: encapsulating a global variable

2020-02-25 Thread Rhodri James

On 25/02/2020 15:20, BlindAnagram wrote:

class GetIt:
   seen = dict()

   def __call__(self, piece):
     return GetIt.seen[piece]

get_it = GetIt()

but then you have a global class instance hanging around, which is not
actually any better than a global dictionary.

This doesn't work for me since get_it(piece) returns the error:

builtins.TypeError: get_it() takes no arguments


It works for me (pace sticking something in GetIt.seen to avoid getting 
a KeyError).  You aren't muddling up the class name and instance name 
are you?


--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


[issue39751] multiprocessing breaks when payload fails to unpickle

2020-02-25 Thread João Eiras

New submission from João Eiras :

The multiprocessing module uses pickles to send data between processes.

If a blob fails to unpickle (bad implementation of __setstate__, invalid 
payload from __reduce__, random crash in __init__) when the multiprocessing 
module will crash inside the _handle_results worker, e.g.:

  File "lib\threading.py", line 932, in _bootstrap_inner
self.run()
  File "lib\threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
  File "lib\multiprocessing\pool.py", line 576, in _handle_results
task = get()
  File "lib\multiprocessing\connection.py", line 251, in recv
return _ForkingPickler.loads(buf.getbuffer())
  TypeError: __init__() takes 1 positional argument but 4 were given

After this the worker has crashed and every task waiting from results from the 
pool will wait forever.

There are 2 things that I think should be fixed:
1. in handle_results, capture all unrecognized errors and propagate in the main 
thread. At this point at least one of the jobs' replies is lost forever so 
there is little point in trying to log and resume.
2. separate the result payload from the payload that contains the job index/id 
so they are unpickled in two steps. The first step unpickles the data internal 
to multiprocessing to know which task the result refers to. The second step 
unpickles the return value or exception from the function that was called, and 
if this object fails to unpickle, propagate that error to the main thread 
through the proper ApplyResult or IMapIterator instances.

--
components: email
files: test_multiproc_error_unpickle.py
messages: 362649
nosy: João Eiras, barry, r.david.murray
priority: normal
severity: normal
status: open
title: multiprocessing breaks when payload fails to unpickle
versions: Python 3.8
Added file: https://bugs.python.org/file48915/test_multiproc_error_unpickle.py

___
Python tracker 

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



[issue39750] UnicodeError becomes unpicklable if data is appended to args

2020-02-25 Thread João Eiras

New submission from João Eiras :

Given some exception `ex`, you can append data like
  ex.args += (value1, value2, ...)
and then re-raise.

This is something I do in my projects to sometime propagate context when errors 
are raised, e.g., stacktraces across process boundaries or blobs of text with 
pickling or unicode errors.

When this is done with UnicodeError, the exception becomes non-unpicklable:

  TypeError: function takes exactly 5 arguments (6 given)

Example:
import pickle

def test_unicode_error_unpickle():
ex0 = UnicodeEncodeError('ascii','message', 1, 2, 'e')
ex0.args += ("extra context",)
ex1 = pickle.loads(pickle.dumps(ex0))
assert type(ex0).args == type(ex1).args
assert ex0.args == ex1.args

The issue seems to be UnicodeEncodeError_init() at 
https://github.com/python/cpython/blob/v3.8.1/Objects/exceptions.c#L1895 and 
also UnicodeDecodeError_init().

The BaseException is initialized, but then Unicode*Error_init() tries to 
reparse the arguments and does not tolerate extra values.

This because BaseException.__reduce__ return a tuple (class,args).

--
components: Interpreter Core
files: test_unicode_error_unpickle.py
messages: 362648
nosy: João Eiras
priority: normal
severity: normal
status: open
title: UnicodeError becomes unpicklable if data is appended to args
type: behavior
versions: Python 3.8
Added file: https://bugs.python.org/file48914/test_unicode_error_unpickle.py

___
Python tracker 

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



[issue39749] python 3.8.1 (3.14 * 10 = 31.400000002 bug)

2020-02-25 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

This behaviour is shared by all programming languages that use floating point 
numbers. For example, this is Ruby:

[steve@ando ~]$ irb
irb(main):001:0> 10 * 3.14 == 31.4
=> false
irb(main):002:0> 10 * 3.14 - 31.4
=> 3.5527136788005e-15

It's not a bug in Python or even in floating point numbers. See the link in the 
tutorial that xtreak gave and the FAQ

https://docs.python.org/3/faq/design.html#why-am-i-getting-strange-results-with-simple-arithmetic-operations

--
nosy: +steven.daprano
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



Re: encapsulating a global variable

2020-02-25 Thread BlindAnagram
On 25/02/2020 14:14, Rhodri James wrote:
> On 25/02/2020 12:38, BlindAnagram wrote:
>> I would appreciate advice on whether it is possible to avoid the use of
>> a global variable used in a function by encapsulating it in a class
>> without maaking any changes to the call interface (which I cannot
>> change).
>>
>> I have:
>>
>> 
>> seen = dict()
>>
>> def get_it(piece):
>>     ...
>>     return seen[piece]
>> 
>>
>> and I am wondering if it is possible to use a class something like
>>
>> 
>> class get_it(object):
>>
>>    seen = dict()
>>
>>    def __call__(piece):
>>  return seen[piece]
>> 
>>
>> to avoid the global variable.
> 
> I wouldn't.  Calling the class name creates an instance of the class, so
> won't actually do what you want.  You could rewrite the class and create
> an instance to call instead:
> 
> class GetIt:
>   seen = dict()
> 
>   def __call__(self, piece):
>     return GetIt.seen[piece]
> 
> get_it = GetIt()
> 
> but then you have a global class instance hanging around, which is not
> actually any better than a global dictionary.

This doesn't work for me since get_it(piece) returns the error:

builtins.TypeError: get_it() takes no arguments

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


Re: encapsulating a global variable

2020-02-25 Thread BlindAnagram
On 25/02/2020 14:13, Chris Angelico wrote:
> On Wed, Feb 26, 2020 at 12:11 AM BlindAnagram  
> wrote:
>>
>> On 25/02/2020 12:56, Chris Angelico wrote:
>>> On Tue, Feb 25, 2020 at 11:41 PM BlindAnagram  
>>> wrote:

 I would appreciate advice on whether it is possible to avoid the use of
 a global variable used in a function by encapsulating it in a class
 without maaking any changes to the call interface (which I cannot change).
>>>
>>> Why bother? If you aren't changing where the function's called, then
>>> its state is effectively global anyway, so what's the point of the
>>> class?
>>
>> It's a good question!
>>
>> The main reason is that I would like to know if it is possible as I then
>> have a choice.  The choice might not be there.
>>
> 
> Well, yes, you can, but you would need a global instance of that class
> (or use the global class object itself). So you'd still have a global.
> 
> But if this is a transitional thing, then the answer is a resounding
> YES. You can start by packaging up all your state with a class, and
> have a single global instance of that class; but then you can rework
> your function to take an optional parameter which is a non-global
> instance of the class. Then all your state is kept in there, and you
> actually truly *do* avoid global state. As a good example of how this
> works, check out Python's random module - you can call
> random.randrange() to get a random number in a particular range, or
> you can instantiate your own random.Random() object and call its
> randrange() method. The first form uses global state; the second form
> doesn't.

Thanks, I think I understand most of this but the eample will help a lot.

My interest in this stems from wanting to keep the dictionary only
available to the function that uses it and also a worry about being
called from threaded code.

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


[issue39737] Speed up list.__eq__ by about 6%

2020-02-25 Thread Dong-hee Na


Dong-hee Na  added the comment:

IMHO, I can not see a noticeable performance improvement.
I think that the modern compiler will optimize the reused variable. ;)
The below result might be noise.


[master]
./python.exe -m pyperf timeit "A = list(range(10**3)); B = list(range(10**3))" 
"A==B"
.
Mean +- std dev: 415 us +- 6 us

[PR 18638]
./python.exe -m pyperf timeit "A = list(range(10**3)); B = list(range(10**3))" 
"A==B"
.
Mean +- std dev: 433 us +- 20 us

--

___
Python tracker 

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



[issue36144] Dictionary addition. (PEP 584)

2020-02-25 Thread Guido van Rossum


Guido van Rossum  added the comment:

Yup, great plan.

On Mon, Feb 24, 2020 at 22:29 Brandt Bucher  wrote:

>
> Brandt Bucher  added the comment:
>
> My current PR plans are:
>
> - Docs. This will include the dict docs and the whatsnew 3.9. I assume we
> have no plans to cover this in the tutorials, etc. Let me know if I'm
> missing anything here.
> - collections.defaultdict, with tests. I don't think this needs docs
> beyond a short "changed in version 3.9" note.
> - collections.OrderedDict, with tests. Ditto defaultdict on docs.
> - collections.ChainMap, ditto.
> - types.MappingProxy, ditto.
>
> I'll also create a BPO issue to discuss whether the dict subclasses in
> http.cookies should be updated.
>
> That should do it for CPython; I'm planning on updating typeshed and
> adding a handful of tests to mypy for TypedDict, etc. after these are
> landed.
>
> Guido, okay to tag you on these for review?
>
> --
>
> ___
> Python tracker 
> 
> ___
>
-- 
--Guido (mobile)

--

___
Python tracker 

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



Re: encapsulating a global variable

2020-02-25 Thread BlindAnagram
On 25/02/2020 14:14, Rhodri James wrote:
> On 25/02/2020 12:38, BlindAnagram wrote:
>> I would appreciate advice on whether it is possible to avoid the use of
>> a global variable used in a function by encapsulating it in a class
>> without maaking any changes to the call interface (which I cannot
>> change).
>>
>> I have:
>>
>> 
>> seen = dict()
>>
>> def get_it(piece):
>>     ...
>>     return seen[piece]
>> 
>>
>> and I am wondering if it is possible to use a class something like
>>
>> 
>> class get_it(object):
>>
>>    seen = dict()
>>
>>    def __call__(piece):
>>  return seen[piece]
>> 
>>
>> to avoid the global variable.
> 
> I wouldn't.  Calling the class name creates an instance of the class, so
> won't actually do what you want.  You could rewrite the class and create
> an instance to call instead:
> 
> class GetIt:
>   seen = dict()
> 
>   def __call__(self, piece):
>     return GetIt.seen[piece]
> 
> get_it = GetIt()
> 
> but then you have a global class instance hanging around, which is not
> actually any better than a global dictionary.

Thanks. Does that not have the advantage of preventing the global
directory being directly fiddled with elsewhere?  Which is one of my
reasons for thinking about this.

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


[issue31539] asyncio.sleep may sleep less time then it should

2020-02-25 Thread Guido van Rossum


Guido van Rossum  added the comment:

Markus, your comment does not seem relevant to this issue. Maybe you meant to 
add it to a different issue, or you meant to create a new issue?

--

___
Python tracker 

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



[issue37373] Configuration of windows event loop for libraries

2020-02-25 Thread Nathaniel Smith


Nathaniel Smith  added the comment:

> was Tornado the only project experiencing this pain

At least twisted and anyio are still broken on 3.8+Windows because of this 
change:

https://twistedmatrix.com/trac/ticket/9766
https://github.com/agronholm/anyio/issues/77

--

___
Python tracker 

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



Re: time.localtime add a parameter for timezone

2020-02-25 Thread Peter J. Holzer
On 2020-02-24 17:43:58 +, Rhodri James wrote:
> On 24/02/2020 17:21, Dieter Maurer wrote:
> > qbit wrote at 2020-2-24 05:18 -0800:
> > > How about adding a time zone parameter to time.localtime?
> > > 
> > > A  offset just like the form: ± hh[:mm[:ss]].
> > 
> > Why should this be necessary? `localtime` returns the time
> > in the "local timezone" -- and the "local timezone" usually
> > does not change between different calls to `localtime`.
> 
> It can if your calls to localtime() happen either side of a daylight saving
> time switch.
> 
> That said, I agree that the timezone doesn't really belong in the output of
> localtime().

I think it does (that POSIX omits it (and only includes the rather
useless tm_isdst) is a historical oversight which was unfortunately
never corrected).

However, it doesn't have to be added, since it is already there:

https://docs.python.org/3/library/time.html#time.struct_time

1084% python3
Python 3.6.9 (default, Nov  7 2019, 10:44:02)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> t = time.localtime()
>>> t.tm_gmtoff
3600
>>> t.tm_zone
'CET'

However, this not a parameter but a field of the return value.

I'm not sure what a parameter would do: Return the broken-down time for
the specified timezone? If so, an offset is not sufficient: It needs to
be a timezone name (something like "Europe/Vienna").

Proper general handling of timezones should probably be in datetime.

> There are a very few occasions when you want it, but more often you
> should be working in UTC not local time.

If you are working in UTC, you don't need localtime().

hp

-- 
   _  | Peter J. Holzer| Story must make more sense than reality.
|_|_) ||
| |   | h...@hjp.at |-- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |   challenge!"


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: encapsulating a global variable

2020-02-25 Thread Rhodri James

On 25/02/2020 12:38, BlindAnagram wrote:

I would appreciate advice on whether it is possible to avoid the use of
a global variable used in a function by encapsulating it in a class
without maaking any changes to the call interface (which I cannot change).

I have:


seen = dict()

def get_it(piece):
...
return seen[piece]


and I am wondering if it is possible to use a class something like


class get_it(object):

   seen = dict()

   def __call__(piece):
 return seen[piece]


to avoid the global variable.


I wouldn't.  Calling the class name creates an instance of the class, so 
won't actually do what you want.  You could rewrite the class and create 
an instance to call instead:


class GetIt:
  seen = dict()

  def __call__(self, piece):
return GetIt.seen[piece]

get_it = GetIt()

but then you have a global class instance hanging around, which is not 
actually any better than a global dictionary.



--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


Re: encapsulating a global variable

2020-02-25 Thread Chris Angelico
On Wed, Feb 26, 2020 at 12:11 AM BlindAnagram  wrote:
>
> On 25/02/2020 12:56, Chris Angelico wrote:
> > On Tue, Feb 25, 2020 at 11:41 PM BlindAnagram  
> > wrote:
> >>
> >> I would appreciate advice on whether it is possible to avoid the use of
> >> a global variable used in a function by encapsulating it in a class
> >> without maaking any changes to the call interface (which I cannot change).
> >
> > Why bother? If you aren't changing where the function's called, then
> > its state is effectively global anyway, so what's the point of the
> > class?
>
> It's a good question!
>
> The main reason is that I would like to know if it is possible as I then
> have a choice.  The choice might not be there.
>

Well, yes, you can, but you would need a global instance of that class
(or use the global class object itself). So you'd still have a global.

But if this is a transitional thing, then the answer is a resounding
YES. You can start by packaging up all your state with a class, and
have a single global instance of that class; but then you can rework
your function to take an optional parameter which is a non-global
instance of the class. Then all your state is kept in there, and you
actually truly *do* avoid global state. As a good example of how this
works, check out Python's random module - you can call
random.randrange() to get a random number in a particular range, or
you can instantiate your own random.Random() object and call its
randrange() method. The first form uses global state; the second form
doesn't.

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


Re: encapsulating a global variable

2020-02-25 Thread BlindAnagram
On 25/02/2020 12:50, Musbur wrote:
> 
> Am 25.02.2020 13:38 schrieb BlindAnagram:
>> and I am wondering if it is possible to use a class something like
>>
>> class get_it(object):
>>
>>   seen = dict()
>>
>>   def __call__(piece):
>>     return seen[piece]
> 
> What happened when you tried it?

The nearest I got was:

-
class orientate(object):

  seen = defaultdict()
  @classmethod
  def do(self, piece, two_sided=False):


which works but requires a change to the function call interface from
orientate(piece) to  orientate.do(piece).

I was hoping that repalcing the above with:

-
class orientate(object):

  seen = defaultdict()
  @classmethod
  def __call__(self, piece, two_sided=False):


would eliminate the need for the 'do' but this gives the error:

builtins.TypeError: orientate() takes no arguments

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


[issue39749] python 3.8.1 (3.14 * 10 = 31.400000002 bug)

2020-02-25 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

This is a known behavior : https://docs.python.org/3/tutorial/floatingpoint.html

--
nosy: +xtreak

___
Python tracker 

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



[issue39749] python 3.8.1 (3.14 * 10 = 31.400000002 bug)

2020-02-25 Thread 꿈돌

New submission from 꿈돌 :

10 * 3.14
31.402

there is a bug in 3.8.1 python, 10 * 3.14 is 31.4 but in python 
31.402

--
messages: 362641
nosy: 꿈돌
priority: normal
severity: normal
status: open
title: python 3.8.1 (3.14 * 10  = 31.40002  bug)

___
Python tracker 

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



Re: encapsulating a global variable

2020-02-25 Thread BlindAnagram
On 25/02/2020 12:56, Chris Angelico wrote:
> On Tue, Feb 25, 2020 at 11:41 PM BlindAnagram  
> wrote:
>>
>> I would appreciate advice on whether it is possible to avoid the use of
>> a global variable used in a function by encapsulating it in a class
>> without maaking any changes to the call interface (which I cannot change).
> 
> Why bother? If you aren't changing where the function's called, then
> its state is effectively global anyway, so what's the point of the
> class?

It's a good question!

The main reason is that I would like to know if it is possible as I then
have a choice.  The choice might not be there.

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


Re: encapsulating a global variable

2020-02-25 Thread Musbur



Am 25.02.2020 13:38 schrieb BlindAnagram:

and I am wondering if it is possible to use a class something like

class get_it(object):

  seen = dict()

  def __call__(piece):
return seen[piece]


What happened when you tried it?

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


[issue39748] PyScripter could not find Python 3.8 64 bits

2020-02-25 Thread Eric V. Smith


Eric V. Smith  added the comment:

This sounds like an issue with PyScripter. I suggest you ask them for guidance 
on how to debug it.

--
nosy: +eric.smith

___
Python tracker 

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



Re: encapsulating a global variable

2020-02-25 Thread Chris Angelico
On Tue, Feb 25, 2020 at 11:41 PM BlindAnagram  wrote:
>
> I would appreciate advice on whether it is possible to avoid the use of
> a global variable used in a function by encapsulating it in a class
> without maaking any changes to the call interface (which I cannot change).

Why bother? If you aren't changing where the function's called, then
its state is effectively global anyway, so what's the point of the
class?

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


encapsulating a global variable

2020-02-25 Thread BlindAnagram
I would appreciate advice on whether it is possible to avoid the use of
a global variable used in a function by encapsulating it in a class
without maaking any changes to the call interface (which I cannot change).

I have:


seen = dict()

def get_it(piece):
   ...
   return seen[piece]


and I am wondering if it is possible to use a class something like


class get_it(object):

  seen = dict()

  def __call__(piece):
return seen[piece]


to avoid the global variable.

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


[issue31539] asyncio.sleep may sleep less time then it should

2020-02-25 Thread Markus Roth


Markus Roth  added the comment:

When the fine tuning options for install-directories are set, the default 
directories "lib", "bin" and "include" are still created with essential 
content. Even if options like --libdir are set.

--
nosy: +CatorCanulis

___
Python tracker 

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



[issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised

2020-02-25 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38410] Possible fatal errors due to _PyEval_SetAsyncGen{Finalizer, Firstiter}()

2020-02-25 Thread Łukasz Langa

Łukasz Langa  added the comment:

Sadly, this missed the train for 3.8.2. Steve, what's the status of the open PR 
for this?

--

___
Python tracker 

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



[issue30064] BaseSelectorEventLoop.sock_{recv, sendall}() don't remove their callbacks when canceled

2020-02-25 Thread Łukasz Langa

Łukasz Langa  added the comment:

Downgrading priority on this one.

--
priority: deferred blocker -> high

___
Python tracker 

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



[issue37228] UDP sockets created by create_datagram_endpoint() allow by default multiple processes to bind the same port

2020-02-25 Thread Łukasz Langa

Łukasz Langa  added the comment:

Downgrading priority since it's released everywhere except for 3.5.

--
priority: deferred blocker -> normal

___
Python tracker 

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



[issue38913] Py_BuildValue("(s#O)", ...) segfaults if entered with exception raised

2020-02-25 Thread Łukasz Langa

Łukasz Langa  added the comment:

Sadly, this missed the train for 3.8.2 as well.

--

___
Python tracker 

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



[issue39042] Use the runtime's main thread ID in the threading module.

2020-02-25 Thread Łukasz Langa

Łukasz Langa  added the comment:

I agree this should be fixed. Since we've already released 3.8.1 and 3.8.2 with 
this behavior it's hard to justify blocking releases on this, though.

--
priority: release blocker -> high

___
Python tracker 

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



[issue38856] asyncio ProactorEventLoop: wait_closed() can raise ConnectionResetError

2020-02-25 Thread Łukasz Langa

Łukasz Langa  added the comment:

Downgrading priority on this, agreed with Victor.

--
priority: release blocker -> high

___
Python tracker 

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



[issue27657] urlparse fails if the path is numeric

2020-02-25 Thread Łukasz Langa

Łukasz Langa  added the comment:

Can this be closed? Downgrading priority since the fix was released as part of 
3.8.2rc2 and 3.8.2 final.

--
priority: release blocker -> critical

___
Python tracker 

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



[issue39748] PyScripter could not find Python 3.8 64 bits

2020-02-25 Thread Noel del rosario


New submission from Noel del rosario :

I installed Python 2.7, 3.7 and 3.8, all in 64 bits.   Then I installed the 
PYSCRYPTER 3.6 54 bits.  The PySCripter can easily set up PYTHON 2.7 and 3.7 
easily.  But it cannot settup Python 3.8.  It cannot find it.

--
components: Installation
messages: 362631
nosy: rosarion
priority: normal
severity: normal
status: open
title: PyScripter could not find Python 3.8 64 bits
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



[issue39747] test_os debug assertion failure

2020-02-25 Thread Steve Dower


Steve Dower  added the comment:

Well, you're running a debug build but building a release build (unless you 
missed the "-d" from the command line -- "-e" is the default now, BTW), so your 
build may be out of sync.

These assertion dialogs are supposed to be suppressed during the test suite, 
but only when run using "python.bat -m test test_os". If you're running the OS 
tests any other way, then you'll see these popups.

(I hope you used Ctrl+C in the dialog to copy the text, by the way. That's a 
lot to copy out by hand!)

---

FWIW, these are very good assertions for most programs. But most programs are 
not intentionally passing arbitrary values into system calls, so we have to 
suppress them for Python :)

--

___
Python tracker 

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



[issue39672] SIGSEGV crash on shutdown with shelve & c pickle

2020-02-25 Thread Andrei Daraschenka


Change by Andrei Daraschenka :


--
pull_requests: +18016
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18655

___
Python tracker 

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



[issue39672] SIGSEGV crash on shutdown with shelve & c pickle

2020-02-25 Thread Andrei Daraschenka


Andrei Daraschenka  added the comment:

Hello
I was finally reproduce your problem.
Probles was in Lib/shelve.py module in method Shelf.sync. When python is shut 
down in classes calls __exit__ methods, in our issues method __exti__ called 
method close() which called method sync(). Method sync() tried sync data 
between disk and memory storage. But if key didn't exists on disk - python has 
error segfault.
I attach path for this problem and I will prepare PR soon.

--
keywords: +patch
Added file: https://bugs.python.org/file48913/shelve.py.patch

___
Python tracker 

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



[issue39672] SIGSEGV crash on shutdown with shelve & c pickle

2020-02-25 Thread zd nex


zd nex  added the comment:

So I was trying it again in Python 3.6.9 and 3.8.1 directly in REPL. And it 
behaves same.  I have tried it on two different linux boxes (both 64bit) where 
I have diffrent versions. In both of them it crashes in same way .. destroy 
_ast and then it crashes and faulthandler again shows shelve (pickle)


So I am attaching new crash reports directly from REPL where I just call 
list(data.items()) and then exit()

Btw it seems to me that when PDB is active crash does not occurs until exit() 
is called.

--
Added file: https://bugs.python.org/file48912/crash.txt

___
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-02-25 Thread Paulo Henrique Silva


Change by Paulo Henrique Silva :


--
nosy: +phsilva

___
Python tracker 

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



Re: Tkinter layout designer

2020-02-25 Thread Sibylle Koczian

Am 25.02.2020 um 07:32 schrieb Christian Gollwitzer:

Am 24.02.20 um 22:29 schrieb mm0fmf:

Can anyone recommend a graphic layout designer for Tkinter programs.


I have a number of older C# Windows Forms apps that need porting so 
they can run on Linux and Windows and this is the chance to re-write 
them in Python. However, after using the forms designer in Visual 
Studio, manually coding up the widget positions etc. is a real pain in 
the backside


If you want a designer, use QT, which brings the Qt Designer. Be careful 
though - if you misuse them, you can end up with inflexible GUIs, where 
changes in the font or display resolution can mess up your interface. 
Always test that your windows act sensibly upon resizing.


Coming from Windows Forms this is especially important. Windows Forms 
doesn't have a sensible geometry manager. Tkinter and PyQt / PySide both 
have them, and it's quite a change at first. But in the long run it's 
much more comfortable to put your controls into layouts (or pack / grid 
them - tkinter) instead of placing each and every thing yourself.


Greetings
Sibylle


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


[issue39683] 2to3 fix_exitfunc suggests duplicated import of atexit module

2020-02-25 Thread Paulo Henrique Silva


Change by Paulo Henrique Silva :


--
keywords: +patch
nosy: +phsilva
nosy_count: 1.0 -> 2.0
pull_requests: +18015
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18654

___
Python tracker 

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