[issue38334] zipfile: Seeking encrypted file breaks after seeking backwards

2019-10-26 Thread Daniel Hillier


Daniel Hillier  added the comment:

I also think that the `read_init` method in my PR is a useful refactor as it 
locates all the state that needs to be (re)set when starting a read into the 
same location.

At the moment this state is set in 1) __init__ and 2) the seek method when 
seeking back beyond what is in the buffer.

--

___
Python tracker 

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



Re: How to decode UTF strings?

2019-10-26 Thread Eli the Bearded
In comp.lang.python, DFS   wrote:
> On 10/25/2019 10:57 PM, MRAB wrote:
>> Here's a simple example, based in your code:
>> 
>> from email.header import decode_header
>> 
>> def test(header, default_encoding='utf-8'):
>>   parts = []
>> 
>>   for data, encoding in decode_header(header):
>>   if isinstance(data, str):
>>  parts.append(data)
>>   else:
>>  parts.append(data.decode(encoding or default_encoding))
>> 
>>   print(''.join(parts))
>> 
>> test('=?iso-8859-9?b?T/B1eg==?= ')
>> test('=?utf-8?Q?=EB=AF=B8?= ')
>> test('=?GBK?B?0Pu66A==?= ')
>> test('=?UTF-8?B?zp3Or866zr/PgiDOks6tz4HOs86/z4I=?= 
>> ')
> I don't think it's working:

It's close. Just ''.join should be ' '.join.

> $ python decode_utf.py
> O≡uz
> 미
> ╨√║Φ
> Νίκος Βέργος

Is your terminal UTF-8? I think not.

Elijah
--
answered with C code to do this in comp.lang.c
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue37309] idlelib/NEWS.txt for 3.9.0 and backports

2019-10-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 6d6418a075f272aeab93c6f2ec15c10257b94e1d by Terry Jan Reedy in 
branch '3.8':
[3.8] bpo-37309: First idlelib/NEWS.txt for 3.8.1 (GH-16947)
https://github.com/python/cpython/commit/6d6418a075f272aeab93c6f2ec15c10257b94e1d


--

___
Python tracker 

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



[issue37309] idlelib/NEWS.txt for 3.9.0 and backports

2019-10-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset a8fb9327fb9387b404d4b6ce55c608125f66b9ae by Terry Jan Reedy in 
branch 'master':
bpo-37309: First idlelib/NEWS.txt for 3.9.0 (GH-16947)
https://github.com/python/cpython/commit/a8fb9327fb9387b404d4b6ce55c608125f66b9ae


--

___
Python tracker 

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



[issue37309] idlelib/NEWS.txt for 3.9.0 and backports

2019-10-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +16477
pull_request: https://github.com/python/cpython/pull/16949

___
Python tracker 

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



[issue37309] idlelib/NEWS.txt for 3.9.0 and backports

2019-10-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +16476
pull_request: https://github.com/python/cpython/pull/16948

___
Python tracker 

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



[issue37309] idlelib/NEWS.txt for 3.9.0 and backports

2019-10-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
keywords: +patch
pull_requests: +16475
stage: commit review -> patch review
pull_request: https://github.com/python/cpython/pull/16947

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2019-10-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
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: keying by identity in dict and set

2019-10-26 Thread Random832
On Sat, Oct 19, 2019, at 07:31, Steve White wrote:
> Hi,
> 
> I have an application that would benefit from object instances
> distinguished by identity being used in dict's and set's. To do this,
> the __hash__ method must be overridden, the obvious return value being
> the instance's id.
> 
> This works flawlessly in extensive tests on several platforms, and on
> a couple of different Python versions and implementations.
> 
> The documentation seems to preclude a second requirement, however.
> 
> I also want to use the == operator on these objects to mean a natural
> comparison of values, different from identity, so that two instances
> comparing equivalent does not imply that they are identical.

I'd like to jump in to this thread to note that while this is reasonably easily 
achieved with a custom mapping class that uses a dict along with a wrapper 
class that stores the identity...

I once tried to make a WeakKeyDictionary that was keyed by identity and had no 
end of trouble.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re:syntax for ellipsis like as "net.blobs['data'].data[...] = transformed_image"

2019-10-26 Thread xuanwu348
Thanks too,
I have find the answer from 
"https://stackoverflow.com/questions/772124/what-does-the-python-ellipsis-object-do;

This came up in another question recently. I'll elaborate on my answer from 
there:

Ellipsis is an object that can appear in slice notation. For example:

myList[1:2, ..., 0]


Its interpretation is purely up to whatever implements the __getitem__ function 
and sees Ellipsis objects there, but its main (and intended) use is in the 
numeric python extension, which adds a multidimensional array type. Since there 
are more than one dimensions, slicing becomes more complex than just a start 
and stop index; it is useful to be able to slice in multiple dimensions as 
well. E.g., given a 4x4 array, the top left area would be defined by the slice 
[:2,:2]:

>>> a
array([[ 1,  2,  3,  4],
   [ 5,  6,  7,  8],
   [ 9, 10, 11, 12],
   [13, 14, 15, 16]])

>>> a[:2,:2]  # top left
array([[1, 2],
   [5, 6]])


Extending this further, Ellipsis is used here to indicate a placeholder for the 
rest of the array dimensions not specified. Think of it as indicating the full 
slice [:] for all the dimensions in the gap it is placed, so for a 3d array, 
a[...,0] is the same as a[:,:,0] and for 4d, a[:,:,:,0], similarly, a[0,...,0] 
is a[0,:,:,0] (with however many colons in the middle make up the full number 
of dimensions in the array).

Interestingly, in python3, the Ellipsis literal (...) is usable outside the 
slice syntax, so you can actually write:

>>> ...
Ellipsis


Other than the various numeric types, no, I don't think it's used. As far as 
I'm aware, it was added purely for numpy use and has no core support other than 
providing the object and corresponding syntax. The object being there didn't 
require this, but the literal "..." support for slices did.







在 2019-10-26 22:51:31,"xuanwu348"  写道:

Hi buddies


Have a good weekend!
I have read some code in caffe, but I confused at "net.blobs['data'].data[...] 
= transformed_image".
The code can be find in this 
link:https://github.com/BVLC/caffe/blob/master/examples/00-classification.ipynb
import caffe
model_def = os.path.join(caffe_root, "models/bvlc_alexnet/deploy.prototxt")
model_weights = os.path.join(caffe_root, 
"models/bvlc_alexnet/bvlc_alexnet.caffemodel")
net = caffe.Net(model_def,
model_weights,
caffe.TEST)
net.blobs['data'].reshape(50,
  3,
  227,227)
net.blobs['data'].data[...] = transformed_image


1. For ellipsis, is there syntax in python like this " 
net.blobs['data'].data[...]"? I have checked it which the type is ""
2. Could you provide some samples in which need to use ellipsis. 


But in python, ellipsis define as below, I did not find the relationship to 
"net.blobs['data'].data[...]":
Help on ellipsis object:


class ellipsis(object)
 |  Methods defined here:
 |
 |  __getattribute__(self, name, /)
 |  Return getattr(self, name).
 |
 |  __new__(*args, **kwargs) from builtins.type
 |  Create and return a new object.  See help(type) for accurate signature.
 |
 |  __reduce__(...)
 |  helper for pickle
 |
 |  __repr__(self, /)
 |  Return repr(self).


Thanks for your help!


Best Regards








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


[issue34790] Deprecate passing coroutine objects to asyncio.wait()

2019-10-26 Thread Kyle Stanley


Kyle Stanley  added the comment:

> Actually, since Andrew also agrees that we need to deprecate passing 
> coroutines to wait(), I'll keep this issue open until we add an actual 
> DeprecationWarning in 3.8.

Since 3.8 has been released and the deprecation notice is in the 3.8 whatsnew 
document, should we implement the warning in Lib/asyncio/tasks.py? If so, I can 
open a PR. 

> PendingDeprecationWarning

Also, it's not clear to me if this should be a DeprecationWarning or 
PendingDeprecationWarning. The most recent message from Yury in the issue 
suggests a PendingDeprecationWarning, but the actual entry in the documentation 
(https://docs.python.org/3/library/asyncio-task.html?highlight=asyncio%20wait#asyncio.wait)
 seems like it might imply that it would be a DeprecationWarning:

> Deprecated since version 3.8: If any awaitable in aws is a coroutine, it is 
> automatically scheduled as a Task. Passing coroutines objects to wait() 
> directly is deprecated as it leads to confusing behavior.

--
nosy: +aeros
status: pending -> open

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2019-10-26 Thread miss-islington


miss-islington  added the comment:


New changeset bc30db1ee70b6708aa436868e548aef919567448 by Miss Skeleton (bot) 
in branch '3.7':
bpo-34162: Last idlelib/NEWS.txt items for 3.8.0. (GH-16943)
https://github.com/python/cpython/commit/bc30db1ee70b6708aa436868e548aef919567448


--

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2019-10-26 Thread miss-islington


miss-islington  added the comment:


New changeset 7a3b1a6f0b0a5ac6e9af4c5ee8b89a2fca96efb6 by Miss Skeleton (bot) 
in branch '3.8':
bpo-34162: Last idlelib/NEWS.txt items for 3.8.0. (GH-16943)
https://github.com/python/cpython/commit/7a3b1a6f0b0a5ac6e9af4c5ee8b89a2fca96efb6


--

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2019-10-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2019-10-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16473
pull_request: https://github.com/python/cpython/pull/16944

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2019-10-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset e31a79a5b44357b409d71949dc5308889970f9ab by Terry Jan Reedy in 
branch 'master':
bpo-34162: Last idlelib/NEWS.txt items for 3.8.0. (GH-16943)
https://github.com/python/cpython/commit/e31a79a5b44357b409d71949dc5308889970f9ab


--

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2019-10-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16474
pull_request: https://github.com/python/cpython/pull/16945

___
Python tracker 

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



[issue38598] IDLE: Disable F5, etc, in Shell and Output windows.

2019-10-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


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



[issue38598] IDLE: Disable F5, etc, in Shell and Output windows.

2019-10-26 Thread miss-islington


miss-islington  added the comment:


New changeset e3a477aa072a737d5119b0778d14d9f3ddb9f587 by Miss Skeleton (bot) 
in branch '3.8':
bpo-38598: Do not try to compile IDLE shell or output windows (GH-16939)
https://github.com/python/cpython/commit/e3a477aa072a737d5119b0778d14d9f3ddb9f587


--

___
Python tracker 

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



[issue34162] idlelib/NEWS.txt for 3.8.0 (and backports)

2019-10-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests: +16472
pull_request: https://github.com/python/cpython/pull/16943

___
Python tracker 

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



[issue38598] IDLE: Disable F5, etc, in Shell and Output windows.

2019-10-26 Thread miss-islington


miss-islington  added the comment:


New changeset 849b1b9f6c538085839f8059e0d6a5536d2fdb52 by Miss Skeleton (bot) 
in branch '3.7':
bpo-38598: Do not try to compile IDLE shell or output windows (GH-16939)
https://github.com/python/cpython/commit/849b1b9f6c538085839f8059e0d6a5536d2fdb52


--
nosy: +miss-islington

___
Python tracker 

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



[issue38598] IDLE: Disable F5, etc, in Shell and Output windows.

2019-10-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16471
pull_request: https://github.com/python/cpython/pull/16942

___
Python tracker 

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



[issue38598] IDLE: Disable F5, etc, in Shell and Output windows.

2019-10-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset e3f90b217a5152275b180b466bd503658a734462 by Terry Jan Reedy in 
branch 'master':
bpo-38598: Do not try to compile IDLE shell or output windows (GH-16939)
https://github.com/python/cpython/commit/e3f90b217a5152275b180b466bd503658a734462


--

___
Python tracker 

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



[issue38598] IDLE: Disable F5, etc, in Shell and Output windows.

2019-10-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16470
pull_request: https://github.com/python/cpython/pull/16941

___
Python tracker 

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



[issue21622] ctypes.util incorrectly fails for libraries without DT_SONAME

2019-10-26 Thread Javier Castillo II


Change by Javier Castillo II :


--
pull_requests: +16469
pull_request: https://github.com/python/cpython/pull/16940

___
Python tracker 

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



Re: web scraper

2019-10-26 Thread Michael Torrie
On 10/25/19 9:19 AM, joseph pareti wrote:
> but can it be generalized?
> Not all tags are in the form ofto just replace those tags in the code, should
> one process a different website?

Not really, no.  There is not an easy way to generalize this sort of web
scraping.  There are many different ways to use html tags.  And each web
site is going to use a different scheme for defining CSS ids and
classes.  Really web scraping is customized to each website, and it's
prone to breaking as the website can change itself at any time.

The only reliable way to access and process information is if a web site
offers a nice stable web services API you can use.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue38334] zipfile: Seeking encrypted file breaks after seeking backwards

2019-10-26 Thread Daniel Hillier


Daniel Hillier  added the comment:

Thanks for looking at the PR.


I got carried away refactoring the decrypter for a future scenario where there 
could be different decrypters (possibly using certificates too) :) Your PR is 
much simpler.

Would you also be able to take a look at some other PRs I've submitted for 
zipfile. They are both pretty small changes:

https://bugs.python.org/issue36993
https://bugs.python.org/issue37523

Thanks again,
Dan

--

___
Python tracker 

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



[issue38440] Possible new issues with IDLE

2019-10-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Given this, I reproduced the issue on Windows for both 3.7 and 3.8.  The bug is 
trying to compile the Shell window, after it has been saved, or an Output 
window, with a prompt to save, for any of F5, Shift-F5, and Alt-X.  There is no 
existing issue I know of, so I opened #38598 and added PR 16939.

--

___
Python tracker 

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



[issue38598] IDLE: Disable F5, etc, in Shell and Output windows.

2019-10-26 Thread Terry J. Reedy


Change by Terry J. Reedy :


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

___
Python tracker 

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



[issue38598] IDLE: Disable F5, etc, in Shell and Output windows.

2019-10-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Trying to compile grep output is also bad.  The ultimate fix is to subclass the 
specialized code editor from the general text editor, instead of vice versa as 
at present, but I leave that for later, and will simply check if the window 
about to be compiled is an instance of OutputWindow (which is also the PyShell 
superclass).

--
title: IDLE: Disable F5, etc, in Shell, even after saving -> IDLE: Disable F5, 
etc, in Shell and Output windows.

___
Python tracker 

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



[issue38312] curses: add `set_tabsize` and `set_escdelay`

2019-10-26 Thread Anthony Sottile


Change by Anthony Sottile :


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

___
Python tracker 

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



[issue38557] PyTuple_GetSlice docs minor inaccuracy

2019-10-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue38334] zipfile: Seeking encrypted file breaks after seeking backwards

2019-10-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

PR 16937 is simpler. It does not change the decrypter.

--

___
Python tracker 

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



[issue38334] zipfile: Seeking encrypted file breaks after seeking backwards

2019-10-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +16466
pull_request: https://github.com/python/cpython/pull/16937

___
Python tracker 

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



[issue38598] IDLE: Disable F5, etc, in Shell, even after saving

2019-10-26 Thread Terry J. Reedy


New submission from Terry J. Reedy :

When the Shell is active, the Run menu is disabled, but its shortcuts are not.  
These are F5 Run Module, Shift-F5 Run ... Custom, and Alt-X Check Module.  If 
Shell has not been saved, the shortcuts do nothing, but once Shell has been 
saved, they try to compile the entire shell session.

The result is that the '3' in 'Python 3.8 ...' on the first line is highlighted 
as an error and the SyntaxError box pops up.  When the box is dismissed, the 
cursor is placed after the '3'.

Instead of calling compile, IDLE should beep and continue.

--
assignee: terry.reedy
components: IDLE
messages: 355432
nosy: terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE: Disable F5, etc, in Shell, even after saving
type: behavior
versions: Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

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



[issue38597] C Extension import limit

2019-10-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
components: +Interpreter Core, Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue38597] C Extension import limit

2019-10-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
components:  -Extension Modules

___
Python tracker 

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



[issue38434] sys.addaudithook event is not documented

2019-10-26 Thread miss-islington


miss-islington  added the comment:


New changeset 11f0f11c4859f5ca201cd40b379b13c65f05ec91 by Miss Skeleton (bot) 
in branch '3.8':
bpo-38434: Fixes some audit event documentation (GH-16932)
https://github.com/python/cpython/commit/11f0f11c4859f5ca201cd40b379b13c65f05ec91


--
nosy: +miss-islington

___
Python tracker 

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



[issue38557] PyTuple_GetSlice docs minor inaccuracy

2019-10-26 Thread miss-islington


miss-islington  added the comment:


New changeset 4992dc6610fb354e36c0012a47ea9613b61c9038 by Miss Skeleton (bot) 
in branch '3.8':
bpo-38557: Improve documentation for list and tuple C API. (GH-16925)
https://github.com/python/cpython/commit/4992dc6610fb354e36c0012a47ea9613b61c9038


--

___
Python tracker 

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



[issue38557] PyTuple_GetSlice docs minor inaccuracy

2019-10-26 Thread miss-islington


miss-islington  added the comment:


New changeset 334fc923b3a7a8d0d163692befd2a27b98b481df by Miss Skeleton (bot) 
in branch '3.7':
bpo-38557: Improve documentation for list and tuple C API. (GH-16925)
https://github.com/python/cpython/commit/334fc923b3a7a8d0d163692befd2a27b98b481df


--

___
Python tracker 

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



[issue38557] PyTuple_GetSlice docs minor inaccuracy

2019-10-26 Thread miss-islington


miss-islington  added the comment:


New changeset 7356e10820b160d14b0ce0aba5427a8f9e757aa7 by Miss Skeleton (bot) 
in branch '2.7':
bpo-38557: Improve documentation for list and tuple C API. (GH-16925)
https://github.com/python/cpython/commit/7356e10820b160d14b0ce0aba5427a8f9e757aa7


--
nosy: +miss-islington

___
Python tracker 

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



[issue38434] sys.addaudithook event is not documented

2019-10-26 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



[issue38434] sys.addaudithook event is not documented

2019-10-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16465
pull_request: https://github.com/python/cpython/pull/16936

___
Python tracker 

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



[issue38434] sys.addaudithook event is not documented

2019-10-26 Thread Steve Dower


Steve Dower  added the comment:


New changeset 894e30ce0bcc1c509eb01c8ffa9ba6d7701aeaaf by Steve Dower in branch 
'master':
bpo-38434: Fixes some audit event documentation (GH-16932)
https://github.com/python/cpython/commit/894e30ce0bcc1c509eb01c8ffa9ba6d7701aeaaf


--

___
Python tracker 

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



[issue38557] PyTuple_GetSlice docs minor inaccuracy

2019-10-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16464
pull_request: https://github.com/python/cpython/pull/16935

___
Python tracker 

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



[issue38557] PyTuple_GetSlice docs minor inaccuracy

2019-10-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset d898d20e8c228229eb68e545f544db13f246f216 by Serhiy Storchaka in 
branch 'master':
bpo-38557: Improve documentation for list and tuple C API. (GH-16925)
https://github.com/python/cpython/commit/d898d20e8c228229eb68e545f544db13f246f216


--

___
Python tracker 

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



[issue38557] PyTuple_GetSlice docs minor inaccuracy

2019-10-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16463
pull_request: https://github.com/python/cpython/pull/16934

___
Python tracker 

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



[issue38557] PyTuple_GetSlice docs minor inaccuracy

2019-10-26 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue38434] sys.addaudithook event is not documented

2019-10-26 Thread Steve Dower


Change by Steve Dower :


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

___
Python tracker 

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



[issue37289] regression in Cython when pickling objects

2019-10-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue38597] C Extension import limit

2019-10-26 Thread Kevin Schlossser


New submission from Kevin Schlossser :

System
Windows 7 x64 SP2
Ram 16GB
6 Core AMD @ 3.2ghz

CPython 3.7.2


C Extension (pyd) import cap.

There seems to be a cap on the number of extensions that a package is able to 
contain. I am able to import 123 extension modules that my package has but when 
i go to import number 124 i get the following traceback

ImportError: DLL load failed: A dynamic link library (DLL) initialization 
routine failed.

these extension modules are part of my package, importing an extension module 
from another package does not change this behavior. it is only when I import 
the 124th extension that is in my package does it occur. 

When I change the order of the imports the error does not follow the import. I 
end up getting the same error when the 124th extension gets loaded doesn't 
matter what extension it is. 

I have tried to see if maybe it was a module limit and I spread the imports 
across multiple files and it still fails when the 124th gets loaded. I also 
tried imp.load_dynamic and importlib.import_module and the same error occurs.

If there is a way to work around this limitation it would be very helpful.

--
components: Extension Modules
messages: 355425
nosy: Kevin Schlossser
priority: normal
severity: normal
status: open
title: C Extension import limit
type: resource usage
versions: Python 3.7

___
Python tracker 

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



[issue38440] Possible new issues with IDLE

2019-10-26 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Reproducer for the jump-to-top bug:
* Start an IDLE interactive shell session
* Run:  File Save As tmp.py
* Press F5 to run the shell session (this is an error)

Effects:
* A message box with "Invalid Syntax" appears
* The cursor jumps to the top row and lands
  on the first "3" in:
  "Python 3.8.0 (v3.8.0:fa919fdf25, Oct 14 2019, 10:23:27) "

Suggestions:
* Don't have the cursor jump after "Invalid Syntax"
* Disable F5 for interactive prompt sessions

Impact:
* Students are saving their long-running shell sessions during class.  
Occasionally, they press F5 to run a script but the interactive shell has the 
focus.  The "jump" described above is disruptive because it moves the cursor to 
the start of the session which may have occurred hours beforehand.

--

___
Python tracker 

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



[issue37289] regression in Cython when pickling objects

2019-10-26 Thread Thomas Caswell


Thomas Caswell  added the comment:

I believe this can be closed, the regression has been fixed and there is now a 
test to prevent it from coming back.

--

___
Python tracker 

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



[issue38589] Bad target address assigned in Python Manuals shortcut on Python installation

2019-10-26 Thread Y3Kv Bv


Y3Kv Bv  added the comment:

Here you go.

--
Added file: https://bugs.python.org/file48679/Python 3.8.0 
(64-bit)_20191026201510_005_doc_AllUsers.log

___
Python tracker 

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



[issue38591] Deprecate Process Child Watchers

2019-10-26 Thread Kyle Stanley


Kyle Stanley  added the comment:

> But it spawns a new Python thread per process which can be a blocker issue if 
> a server memory is limited.

I understand that there's *some* overhead associated with spawning a new 
thread, but from my impression it's not substantial enough to make a 
significant impact in most cases. Each individual instance of threading.Thread 
is only 64 bytes. Have you seen any recent cases where the server memory is 
limited enough for the memory cost associated with having to spawn an 
additional thread per subprocess becomes the limiting factor?

--

___
Python tracker 

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



[issue38589] Bad target address assigned in Python Manuals shortcut on Python installation

2019-10-26 Thread Steve Dower


Steve Dower  added the comment:

If you look in your %TEMP% directory, you'll find a set of log files from your 
Python install (maybe sort by date).

One of these will end in "doc". Could you share that file?

--

___
Python tracker 

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



[issue38591] Deprecate Process Child Watchers

2019-10-26 Thread Kyle Stanley


Kyle Stanley  added the comment:

> > If asyncio is only run from the main thread, FastChildWatcher is safe, fast 
> > and has low memory footprint, no?

> Unfortunately, no. FastChildWatcher is safe if you can guarantee that no code 
> executed in asyncio main thread AND thread pools spawn subprocesses

Am I misunderstanding something here or is this supposed to be 
"FastChildWatcher is safe if you can guarantee that no code executed *outside 
of* the asyncio main thread AND ..."? Alternatively, "FastChildWatcher is safe 
if you can guarantee that code *only* executed in the asyncio main thread". 
Both of the above have the same functional meaning. 

I think it was a typo, but I just wanted to make sure because the distinction 
from the original makes a functional difference in this case. 

Also, regarding the second part "thread pools spawn subprocesses", is that to 
say that subprocesses can only spawn within the thread pools? As in, 
FastChildWatcher becomes unsafe if subprocesses are spawned from anywhere else?

These answers may be fairly obvious to someone familiar working within the 
internals of FastChildWatcher, but it may not be overly clear to someone such 
as myself who has mostly just read through the documentation and looked over 
the implementation briefly. I'm only familiar with the internals of 
ThreadedChildWatcher.

--

___
Python tracker 

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



Re: fileinput

2019-10-26 Thread Peter Otten
Pascal wrote:

> I have a small python (3.7.4) script that should open a log file and
> display its content but as you can see, an encoding error occurs :
> 
> ---
> 
> import fileinput
> import sys
> try:
> source = sys.argv[1:]
> except IndexError:
> source = None
> for line in fileinput.input(source):
> print(line.strip())
> 
> ---
> 
> python3.7.4 myscript.py myfile.log
> Traceback (most recent call last):
> ...
> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in position 799:
> invalid continuation byte
> 
> python3.7.4 myscript.py < myfile.log
> Traceback (most recent call last):
> ...
> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in position 799:
> invalid continuation byte
> 
> ---
> 
> I add the encoding hook to overcome the error but this time, the script
> reacts differently depending on the input used :
> 
> ---
> 
> import fileinput
> import sys
> try:
> source = sys.argv[1:]
> except IndexError:
> source = None
> for line in fileinput.input(source,
> openhook=fileinput.hook_encoded("utf-8", "ignore")):
> print(line.strip())
> 
> ---
> 
> python3.7.4 myscript.py myfile.log
> first line of myfile.log
> ...
> last line of myfile.log
> 
> python3.7.4 myscript.py < myfile.log
> Traceback (most recent call last):
> ...
> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in position 799:
> invalid continuation byte
> 
> python3.7.4 myscript.py /dev/stdin < myfile.log
> first line of myfile.log
> ...
> last line of myfile.log
> 
> python3.7.4 myscript.py - < myfile.log
> Traceback (most recent call last):
> ...
> UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in position 799:
> invalid continuation byte
> 
> ---
> 
> does anyone have an explanation and/or solution ?

'-' or no argument tell fileinput to use sys.stdin. This is already text 
decoded using Python's default io-encoding, and the open hook is not called.
You can override the default encoding by setting the environment variable

PYTHONIOENCODING=UTF8:ignore

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


[issue38535] Incorrect col_offset for decorators with zero arguments (empty parentheses)

2019-10-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



web scraper

2019-10-26 Thread joseph pareti
Thank you so much for your very valuable guidance on my python experiment.
Meanwhile the problems I reported before have been solved.

This is part of a program that extracts specific information from bank
transaction records, and one functionality I still need to implement is a *web
scraper*:

The eureka / guide 
"web scraping with python" provides some insights, that are however linked
to a specific website:
by associating the "inspected" web page with the code shown in the Eureka
page, one can build the algorithm, but
can it be generalized?
Not all tags are in the form of   https://www.flipkart.com/laptops/~buyback-guarantee-on-laptops-/pr?sid=6bo%2Cb5g=val1=11.productCard.PMU_V2>
contains all the needed data, while my case requires a lookup of one item
at a time, namely:
(i) loop over a bunch of ISIN codes
(ii) access a specific website (=morningstar?), that does the
ISIN-to-fund-name translation
(iii) "inspect" that page containing the result and grab the fund name.

I would appreciate any advice on how to program all this. Thanks.
-- 
Regards,
Joseph Pareti - Artificial Intelligence consultant
Joseph Pareti's AI Consulting Services
https://www.joepareti54-ai.com/
cell +49 1520 1600 209
cell +39 339 797 0644
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Congratulations to @Chris

2019-10-26 Thread Jason Friedman
>
> Chris Angelico: [PSF's] 2019 Q2 Community Service Award Winner
> http://pyfound.blogspot.com/2019/10/chris-angelico-2019-q2-community.html
>
> ...and for the many assistances and pearls of wisdom he has contributed
> 'here'!
> --
> Regards,
> =dn
>
> Agreed.
-- 
https://mail.python.org/mailman/listinfo/python-list


fileinput

2019-10-26 Thread Pascal
I have a small python (3.7.4) script that should open a log file and
display its content but as you can see, an encoding error occurs :

---

import fileinput
import sys
try:
source = sys.argv[1:]
except IndexError:
source = None
for line in fileinput.input(source):
print(line.strip())

---

python3.7.4 myscript.py myfile.log
Traceback (most recent call last):
...
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in position 799:
invalid continuation byte

python3.7.4 myscript.py < myfile.log
Traceback (most recent call last):
...
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in position 799:
invalid continuation byte

---

I add the encoding hook to overcome the error but this time, the script
reacts differently depending on the input used :

---

import fileinput
import sys
try:
source = sys.argv[1:]
except IndexError:
source = None
for line in fileinput.input(source,
openhook=fileinput.hook_encoded("utf-8", "ignore")):
print(line.strip())

---

python3.7.4 myscript.py myfile.log
first line of myfile.log
...
last line of myfile.log

python3.7.4 myscript.py < myfile.log
Traceback (most recent call last):
...
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in position 799:
invalid continuation byte

python3.7.4 myscript.py /dev/stdin < myfile.log
first line of myfile.log
...
last line of myfile.log

python3.7.4 myscript.py - < myfile.log
Traceback (most recent call last):
...
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in position 799:
invalid continuation byte

---

does anyone have an explanation and/or solution ?
-- 
https://mail.python.org/mailman/listinfo/python-list


syntax for ellipsis like as "net.blobs['data'].data[...] = transformed_image"

2019-10-26 Thread xuanwu348
Hi buddies


Have a good weekend!
I have read some code in caffe, but I confused at "net.blobs['data'].data[...] 
= transformed_image".
The code can be find in this 
link:https://github.com/BVLC/caffe/blob/master/examples/00-classification.ipynb
import caffe
model_def = os.path.join(caffe_root, "models/bvlc_alexnet/deploy.prototxt")
model_weights = os.path.join(caffe_root, 
"models/bvlc_alexnet/bvlc_alexnet.caffemodel")
net = caffe.Net(model_def,
model_weights,
caffe.TEST)
net.blobs['data'].reshape(50,
  3,
  227,227)
net.blobs['data'].data[...] = transformed_image


1. For ellipsis, is there syntax in python like this " 
net.blobs['data'].data[...]"? I have checked it which the type is ""
2. Could you provide some samples in which need to use ellipsis. 


But in python, ellipsis define as below, I did not find the relationship to 
"net.blobs['data'].data[...]":
Help on ellipsis object:


class ellipsis(object)
 |  Methods defined here:
 |
 |  __getattribute__(self, name, /)
 |  Return getattr(self, name).
 |
 |  __new__(*args, **kwargs) from builtins.type
 |  Create and return a new object.  See help(type) for accurate signature.
 |
 |  __reduce__(...)
 |  helper for pickle
 |
 |  __repr__(self, /)
 |  Return repr(self).


Thanks for your help!


Best Regards



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


[issue38558] Data Structures documentation out of sync with new Walrus operator

2019-10-26 Thread Matt Ward


Matt Ward  added the comment:

You're welcome!

On Fri, Oct 25, 2019 at 10:53 PM Ammar Askar  wrote:

>
> Ammar Askar  added the comment:
>
> Thank you for the report Matt!
>
> --
> nosy: +ammar2
> resolution:  -> fixed
> stage: patch review -> resolved
> status: open -> closed
> versions: +Python 3.9
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue38535] Incorrect col_offset for decorators with zero arguments (empty parentheses)

2019-10-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 493fef60a7600f83fe6916ed89d0fb0c0aab484d by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-38535: Fix positions for AST nodes for calls without arguments in 
decorators. (GH-16861). (GH-16931)
https://github.com/python/cpython/commit/493fef60a7600f83fe6916ed89d0fb0c0aab484d


--

___
Python tracker 

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



[issue38535] Incorrect col_offset for decorators with zero arguments (empty parentheses)

2019-10-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 91fc9cf43cc2e3a2f236ef9944cf1f4bed701545 by Serhiy Storchaka in 
branch '3.7':
[3.7] bpo-38535: Fix positions for AST nodes for calls without arguments in 
decorators. (GH-16861). (GH-16930)
https://github.com/python/cpython/commit/91fc9cf43cc2e3a2f236ef9944cf1f4bed701545


--

___
Python tracker 

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



[issue38535] Incorrect col_offset for decorators with zero arguments (empty parentheses)

2019-10-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +16460
pull_request: https://github.com/python/cpython/pull/16931

___
Python tracker 

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



[issue38535] Incorrect col_offset for decorators with zero arguments (empty parentheses)

2019-10-26 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +16459
pull_request: https://github.com/python/cpython/pull/16930

___
Python tracker 

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



[issue38535] Incorrect col_offset for decorators with zero arguments (empty parentheses)

2019-10-26 Thread miss-islington


miss-islington  added the comment:


New changeset ba3a566328e8df49741059b24a41480e248bf6d7 by Miss Skeleton (bot) 
in branch '3.8':
bpo-38535: Fix positions for AST nodes for calls without arguments in 
decorators. (GH-16861)
https://github.com/python/cpython/commit/ba3a566328e8df49741059b24a41480e248bf6d7


--
nosy: +miss-islington

___
Python tracker 

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



[issue38535] Incorrect col_offset for decorators with zero arguments (empty parentheses)

2019-10-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +16458
pull_request: https://github.com/python/cpython/pull/16929

___
Python tracker 

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



[issue38535] Incorrect col_offset for decorators with zero arguments (empty parentheses)

2019-10-26 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 26ae9f6d3d755734c9f371b9356325afe5764813 by Serhiy Storchaka in 
branch 'master':
bpo-38535: Fix positions for AST nodes for calls without arguments in 
decorators. (GH-16861)
https://github.com/python/cpython/commit/26ae9f6d3d755734c9f371b9356325afe5764813


--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue38596] simple example give a Linux core dumped with atk-bridge

2019-10-26 Thread Feștilă George Cătălin

Feștilă George Cătălin  added the comment:

No. I don't have a reproducer script for this issue with Linux OS.
The mytext is a class from another script named my_notepad.
The problem comes with time when I use the menu to change the syntax value, as 
you can see:
self.syntax = mytext(self.text_widget.document())
My code is based on this example from GitHub account lfsando: 
https://github.com/lfsando/notepad/blob/master/highlighter.py maybe has the 
same error.

--

___
Python tracker 

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



[issue38570] Shlex does not parse commands containing single quotes correctly

2019-10-26 Thread timonegk


timonegk  added the comment:

Okay, thanks a lot. I am closing this since it is not a bug then.

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



[issue38596] simple example give a Linux core dumped with atk-bridge

2019-10-26 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Can you please attach a simple reproducer script without any third party 
modules like qtwidgets to ensure crash is due to CPython and not due to the 
code in third party module itself.

--
nosy: +xtreak

___
Python tracker 

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



[issue35714] Document that the null character '\0' terminates a struct format spec

2019-10-26 Thread Zackery Spytz


Zackery Spytz  added the comment:

I've created a patch to reject null characters in the format string.

--
nosy: +ZackerySpytz

___
Python tracker 

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



[issue38591] Deprecate Process Child Watchers

2019-10-26 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

My non-LTS Ubuntu also has 5.3 kernel but I'm talking about the oldest 
supported RHEL/CentOS.

That's why pidfd_open() cannot be a single implementation. It's so new; my 
local man-pages system has not a record about the API yet (but the web has: 
http://man7.org/linux/man-pages/man2/pidfd_open.2.html).

> If asyncio is only run from the main thread, FastChildWatcher is safe, fast 
> and has low memory footprint, no?

Unfortunately, no. FastChildWatcher is safe if you can guarantee that no code 
executed in asyncio main thread AND thread pools spawn subprocesses. Otherwise, 
the whole Python process becomes broken by the race condition between 
FastChildWatcher and any other wait()/waitpid()/waitid() call.

--

___
Python tracker 

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



[issue38596] simple example give a Linux core dumped with atk-bridge

2019-10-26 Thread Feștilă George Cătălin

New submission from Feștilă George Cătălin :

My simple notepad code with QtWidgets.QPlainTextEdit() give me a crash dump on 
Linux Fedora 30 with python3

Python 3.7.4 (default, Jul  9 2019, 16:32:37) 
[GCC 9.1.1 20190503 (Red Hat 9.1.1-1)] on linux

[mythcat@desk pyqt5_examples]$ uname -a
Linux desk 5.3.7-200.fc30.x86_64 #1 SMP Fri Oct 18 20:13:59 UTC 2019 x86_64 
x86_64 x86_64 GNU/Linux

[mythcat@desk pyqt5_examples]$ python3 notepad.py 

** (python3:3077): WARNING **: 11:26:06.007: AT-SPI: Could not obtain desktop 
path or name


** (python3:3077): WARNING **: 11:26:06.029: atk-bridge: GetRegisteredEvents 
returned message with unknown signature

** (python3:3077): WARNING **: 11:26:06.029: atk-bridge: 
get_device_events_reply: unknown signature

** (python3:3077): WARNING **: 11:26:06.029: atk-bridge: 
get_device_events_reply: unknown signature
Traceback (most recent call last):
  File "notepad.py", line 222, in assign_syntax_py
self.syntax = mytext(self.text_widget.document())
NameError: name 'mytext' is not defined
Traceback (most recent call last):
  File "notepad.py", line 222, in assign_syntax_py
self.syntax = mytext(self.text_widget.document())
NameError: name 'mytext' is not defined
Aborted (core dumped)

The code is self.syntax = my_notepad.mytext(self.text_widget.document())

--
components: Interpreter Core
messages: 355408
nosy: catafest
priority: normal
severity: normal
status: open
title: simple example give a Linux core dumped with atk-bridge
type: crash
versions: Python 3.7

___
Python tracker 

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



[issue35714] Document that the null character '\0' terminates a struct format spec

2019-10-26 Thread Mark Dickinson


Mark Dickinson  added the comment:

I agree with Serhiy. Any other unrecognised character would raise an error. The 
null character should do the same.

--
nosy: +mark.dickinson

___
Python tracker 

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



Fwd: keying by identity in dict and set

2019-10-26 Thread Steve White
Hi Dieter,

I'm sure that 99% of all use of 'dict' in Python is exactly this.  The
vast majority of my own Python code is such, and that is as it should
be.

Here I have an application where I can do something really cool and
useful, by keying on identity.  The built-in Python structures are
pretty limited, but I'm making a package for use by other people, and
I strongly prefer them to use familitar Python structures with it,
rather than having to learn something new, and I strongly prefer to
use off-the-shelf, tested structures, rather than rolling my own.

I spent some days trying to make it work in more conventional ways ---
nothing worked as well, as cleanly.

I am not advocating this style of programming.  I want the flexibility
to use it, when it is called for.  Yes, it has its limitations, but
limitations are to be understood and worked with.

And it is now obvious to me that somebody went to great pains to make
sure the Python 'dict' does in fact support this.  It works
splendidly.  This is no accident.

It's instructive to compare Python's containers to the container
libraries of other languages, Java for instance.  In Java, there are
many kinds of container classes, which permits finding one that is
optimal for a given application.  In contrast, Python has only a
handfull.  But they are meant to be very flexible, and fairly well
optimized for most applcations.

Yet the documentation *not only* suggests that 'dict' and 'set' cannot
be used for keying by identity, it gives no insight whatever into how
their internal hash algorithms use __hash__() and __eq__().  This
results in hundreds of postings by people who want to just do the
right thing, or who want to do something a little different, often
being answered by people who themselves scarcely understand what is
really going on.  While researching this question, I found several
places where somebody asked about doing something like what I
described here, but they never got a useful answer.  I also found post
that advocate returning the value of id() in __hash__(), without
explaining how __eq__() should then be overloaded.

A little documentation would have saved me personally days of work.
It  would be helpful to know:
  * under what conditions can one expect a "perfect hash", that is,
one where __eq__() will never be called?
  * is it sufficient to return the value of the key object's id()
function to produce a perfect hash?
  * when might it be useful to consider keying by identity?
  * what are the limitations of programming this way?

Thanks!

On Sat, Oct 26, 2019 at 7:17 AM dieter  wrote:
>
> Steve White  writes:
> > Regarding my question
> >  "Is there some fatal reason that this approach must never be
> > used, besides the lack of documentary support for it?"
> > If finally dawned on me that there is a use-case for containers that
> > would preclude using object identity for keys.  That is, if the object
> > is to be serialized, or otherwise stored past the run-time of the
> > program.  Of course, all the identities (all the id() values) will be
> > meaningless once the current run ends.
>
> One motivation to base dict key management on equality
> (rather than identity) are literals:
>
> Consider a dict "d" with at some place
> `d["my example key"] = 1` and at a different place
> (maybe another function, another module) you access
> `d["my example key"]`. You would expect to get `1`
> as result as for your eyes the two literals are equal.
> Would the key management be based on identity, then
> you could get either the expected `1` or a `KeyError`.
> The reason: Python does not manage (most) literals globally;
> this means, if you use the same literal in different places
> you may (or may not) have non-identical objects.
>
> Basing on equality, you are also more flexibal than
> with identity, because can can change the equality
> rules for a class while you cannot change the identity rules.
> Thus, if you need identity based key management,
> define your `__eq__` accordingly.
>
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


wxPython 4.0.7 released

2019-10-26 Thread Robin Dunn

Announcing wxPython 4.0.7
=

PyPI:   https://pypi.org/project/wxPython/4.0.7
Extras: https://extras.wxPython.org/wxPython4/extras/
Pip:``pip install wxPython==4.0.7``

This release is comprised mostly of fixes and minor features
which have been back-ported from the master branch. This release
is likely the last release of the 4.0.x release series, and is
certainly the last 4.0.x release that will support Python 2.7. It
may still continue to build for Python 2.7 for some time, but no
extra effort will be expended to keep it compatible.

Support for building for Python 3.8 has been added, as well as
3.8 binaries on PyPI for Windows and MacOS.

This release provides the following changes:

* Bug fixes in wx.lib.calendar: key navigation across month
  boundaries is now possible; key navigation now sets the date
  and fires the EVT_CALENDAR event; setter APIs now set the date
  correctly (#1230).

* Switch to using a wx.Overlay in the Widget Inspection Tool to
  highlight widgets when running on a GTK3 port.

* Fixed issue in wx.lib.agw.customtreectrl where label editor
  could remain stuck forever (#1235).

* Fix a sometimes crash when using a wx.Overlay by letting the
  wx.DCOverlay hold a reference to the DC, to ensure that the
  DCOverlay is destroyed first.  (PR#1301)

* Ported the embedding sample from Classic, which shows how to
  use wxPython from a C++ wxWidgets application that embeds
  Python. (PR #1353)

* Fixed wx.GetApp() to use wxWidgets' global wxApp instance
  instead of maintaining its own pointer. This way, if the wxApp
  is created by C++ code wxPython will still be able to get
  access to it. (#1126)

* Several other PRs have been backported from the master branch
  (which will become wxPython 4.1.0), the full list can be seen
  here: https://github.com/wxWidgets/Phoenix/pull/1357
--
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/