Re: PEP Idea: Multi-get for lists/tuples and dictionaries (inspired in NumPy)

2020-03-18 Thread DL Neil via Python-list

On 19/03/20 3:28 PM, Santiago Basulto wrote:
...> myself missing A LOT features from NumPy, like fancy indexing or 
boolean

arrays.
So, has it ever been considered to bake into Python's builtin list and
dictionary types functionality inspired by NumPy? I think multi indexing
alone would be huge addition. A few examples:
For lists and tuples:
 >>> l = ['a', 'b', 'c']
 >>> l[[0, -1]]
 ['a', 'c']
For dictionaries it'd even be more useful:
 d = {
 'first_name': 'Frances',
 'last_name': 'Allen',
 'email': 'fal...@ibm.com'
 }
 fname, lname = d[['first_name', 'last_name']]



I fear that I'm missing your point.

How is
l[[0, -1]] or fname, lname = d[['first_name', 'last_name']]
any better than
l[ 0 ], l[ -1 ] or
fname = d[ 'first_name' ]
lname = d[ 'last_name' ]

Are you aware, that whilst there is more coverage of "tuple unpacking" 
(at least to my eye), there is also a "list unpacking" feature?


>>> t = ( 1, 2, 3 )
>>> a, b, c = t
>>> print( a, b, c )
1 2 3

>>> l = [ 1, 2, 3 ]
>>> a, b, c = l
>>> print( a, b, c )
1 2 3

and somewhat similarly for dictionaries:

>>> fname, lname = d[ "first_name" ], d[ "last_name" ]
>>> fname, lname
('Frances', 'Allen')


That said, I've often wished to be allowed to write:

d.first_name

for a dict (cf a class/object).

Hmm, I feel a 'utility' coming-on - but first I'll look to see where/how 
such might be used in 'live' code (and be any better than the current 
mechanisms)...


Simple collections are one thing. How would you handle the structure if 
one or more elements contains a second dimension? eg a list within a 
list/a 2D matrix (or if you must, an 'array')?

--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list


[issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval

2020-03-18 Thread hai shi


Change by hai shi :


--
nosy: +shihai1991

___
Python tracker 

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



[issue40011] Tkinter widget events are of type Tuple

2020-03-18 Thread Hênio Tierra Sampaio

Hênio Tierra Sampaio  added the comment:

Sorry for the similar messages. The second one was to remove the paragraph 
stating that it would be possible to circumvent the problem of the Listbox - it 
is not.

--

___
Python tracker 

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



Re: ZipFile and timestamps

2020-03-18 Thread Manfred Lotz
On Wed, 18 Mar 2020 21:41:10 +
MRAB  wrote:

> On 2020-03-18 20:38, Manfred Lotz wrote:
> > I unzip a zip file like follows which works fine.
> > 
> >   with ZipFile(zip_file, 'r') as zip:
> >  zip.extractall(tmp_dir)
> > 
> > The only caveat is that the unpacked files and dirs do have a
> > current timestamp i.e. the timestamps of the files are not
> > preserved.
> > 
> > Is there a way to tell ZipFile to preserve timestamps when
> > unpacking a zip archive?
> >   
> You might have to iterate over the contents yourself and set the 
> modification times.

Oops, if this is required then I better change my code to invoke unzip.

Thanks,
Manfred

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


[issue40011] Tkinter widget events are of type Tuple

2020-03-18 Thread Hênio Tierra Sampaio

Hênio Tierra Sampaio  added the comment:

I'm maintainer for a project for the RaspberryPi, a GUI for OMXPlayer called 
TBOPlayer. This GUI was originally made for Python 2, but with Python 2 
deprecation, I decided to convert it to Python 3. After (supposedly) converting 
all of it I had a surprise to see that the events that worked in the original 
code with Python 2 didn't work anymore in Python 3 with errors like

File "/home/henio/Projetos/tboplayer/lib/tboplayer.py", line 1566, in 
select_track
sel = event.widget.curselection()
AttributeError: 'tuple' object has no attribute 'widget'


And upon investigation, I noticed all the widget events (originally of type 
tkinter.Event) were now of type Tuple. WTF. Ok, I tried to circumvent this by 
using the tuple "attributes", like, in the event

(('17685', '1', '??', '??', '??', '256', '59467466', '??', '212', '11', 
'??', '0', '??', '??', '.!listbox', '5', '1030', '344', '??'),)

I can access the x position of the cursor in relation to the widget by doing:

event[0][8]

Which I did. However, I obviously cannot use any of the Event methods, and this 
way I cannot get the current selection from a Listbox, for example, and trying 
to gives me the exact error mentioned above. This renders TBOPlayer useless as 
the user cannot even select a track for playing.

And unfortunately, I was unable to reproduce this issue with a minimum code, so 
I have no idea what's going on.

This issue comment describes how to reproduce the bug inside of TBOPlyaer: 
https://github.com/KenT2/tboplayer/issues/175#issuecomment-600861514

--

___
Python tracker 

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



[issue38500] PEP 523: Add private _PyInterpreterState_SetEvalFrameFunc() function to the C API (Python 3.8 regression)

2020-03-18 Thread STINNER Victor


Change by STINNER Victor :


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



[issue39947] Make the PyThreadState structure opaque (move it to the internal C API)

2020-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

I added PyInterpreterState_Get() and PyThreadState_GetInterpreter() functions 
to get the interpreter.

--

___
Python tracker 

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



PEP Idea: Multi-get for lists/tuples and dictionaries (inspired in NumPy)

2020-03-18 Thread Santiago Basulto
Hello community. I have an idea to share with the list to see what you all
think about it.

I happen to use both Python for Data Science (with our regular friends
NumPy and Pandas) as well as for scripting and backend development. Every
time I'm working in server-side Python (not the PyData stack), I find
myself missing A LOT features from NumPy, like fancy indexing or boolean
arrays.

So, has it ever been considered to bake into Python's builtin list and
dictionary types functionality inspired by NumPy? I think multi indexing
alone would be huge addition. A few examples:

For lists and tuples:
>>> l = ['a', 'b', 'c']
>>> l[[0, -1]]
['a', 'c']

For dictionaries it'd even be more useful:
d = {
'first_name': 'Frances',
'last_name': 'Allen',
'email': 'fal...@ibm.com'
}
fname, lname = d[['first_name', 'last_name']]

I really like the syntax of boolean arrays too, but considering we have
list comprehensions, seems a little more difficult to sell.

I'd love to see if this is something people would support, and see if
there's room to submit a PEP.

-- 
Santiago Basulto.-
Up!
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31200] address sanitizer build fails

2020-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

FYI there is bpo-1635741 which tries to cleanup more things at Python exit.

--
nosy: +vstinner

___
Python tracker 

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



[issue36479] Exit threads when interpreter is finalizing rather than runtime.

2020-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

I suggest to close this issue, I don't think that it can be implemented because 
of daemon threads.

--

> This behavior should instead be triggered by the thread's interpreter 
> finalizing rather than the runtime.

What is the motivation for that?

--

take_gil() cannot access interp->finalizing since interp memory is freed during 
Python finalization.

take_gil() can only rely on a global variable like _PyRuntime to check if a 
daemon thread must exit during the Python finalization.

I modified take_gil() recently to fix 2 or 3 different crashes caused by daemon 
threads during Python finalization. Extract of ceval.c:

/* Check if a Python thread must exit immediately, rather than taking the GIL
   if Py_Finalize() has been called.

   When this function is called by a daemon thread after Py_Finalize() has been
   called, the GIL does no longer exist.

   tstate must be non-NULL. */
static inline int
tstate_must_exit(PyThreadState *tstate)
{
/* bpo-39877: Access _PyRuntime directly rather than using
   tstate->interp->runtime to support calls from Python daemon threads.
   After Py_Finalize() has been called, tstate can be a dangling pointer:
   point to PyThreadState freed memory. */
_PyRuntimeState *runtime = &_PyRuntime;
PyThreadState *finalizing = _PyRuntimeState_GetFinalizing(runtime);
return (finalizing != NULL && finalizing != tstate);
}


And simplified take_gil():

static void
take_gil(PyThreadState *tstate)
{
if (tstate_must_exit(tstate)) {
/* bpo-39877: If Py_Finalize() has been called and tstate is not the
   thread which called Py_Finalize(), exit immediately the thread.

   This code path can be reached by a daemon thread after Py_Finalize()
   completes. In this case, tstate is a dangling pointer: points to
   PyThreadState freed memory. */
PyThread_exit_thread();
}

(... logic to acquire the GIL ...)

if (must_exit) {
/* bpo-36475: If Py_Finalize() has been called and tstate is not
   the thread which called Py_Finalize(), exit immediately the
   thread.

   This code path can be reached by a daemon thread which was waiting
   in take_gil() while the main thread called
   wait_for_thread_shutdown() from Py_Finalize(). */
drop_gil(ceval, ceval2, tstate);
PyThread_exit_thread();
}
}

--

___
Python tracker 

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



[issue36225] Lingering subinterpreters should be implicitly cleared on shutdown

2020-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-38865: "Can Py_Finalize() be called if the current interpreter is 
not the main interpreter?".

--
nosy: +vstinner

___
Python tracker 

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



[issue38865] Can Py_Finalize() be called if the current interpreter is not the main interpreter?

2020-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

See also bpo-36225: "Lingering subinterpreters should be implicitly cleared on 
shutdown".

--

___
Python tracker 

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



[issue40011] Tkinter widget events are of type Tuple

2020-03-18 Thread Hênio Tierra Sampaio

Change by Hênio Tierra Sampaio :


--
title: Widget events are of type Tuple -> Tkinter widget events are of type 
Tuple

___
Python tracker 

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



[issue40011] Widget events are of type Tuple

2020-03-18 Thread Hênio Tierra Sampaio

New submission from Hênio Tierra Sampaio :

I'm maintainer for a project for the RaspberryPi, a GUI for OMXPlayer called 
TBOPlayer. This GUI was originally made for Python 2, but with Python 2 
deprecation, I decided to convert it to Python 3. After (supposedly) converting 
all of it I had a surprise to see that the events that worked in the original 
code with Python 2 didn't work anymore in Python 3 with errors like

File "/home/henio/Projetos/tboplayer/lib/tboplayer.py", line 1566, in 
select_track
sel = event.widget.curselection()
AttributeError: 'tuple' object has no attribute 'widget'


And upon investigation, I noticed all the widget events (originally of type 
tkinter.Event) were now of type Tuple. WTF. Ok, I tried to circumvent this by 
using the tuple "attributes", like, in the event

(('17685', '1', '??', '??', '??', '256', '59467466', '??', '212', '11', 
'??', '0', '??', '??', '.!listbox', '5', '1030', '344', '??'),)

I can access the x position of the cursor in relation to the widget by doing:

event[0][8]

Which I did. However, I obviously cannot use any of the Event methods, and this 
way I cannot get the current selection from a Listbox, for example, and trying 
to gives me the exact error mentioned above. This renders TBOPlayer useless as 
the user cannot even select a track for playing.

I could circumvent this specific problem by keeping track of the previous 
clicked position over the Listbox and do a simple math calculation to get the 
current list item, but that's is very annoying, and not the right way to do it, 
meaning it would make the code more complex than it should be, and making 
maintaing more difficult.

And unfortunately, I was unable to reproduce this issue with a minimum code, so 
I have no idea what's going on.

This issue comment describes how to reproduce the bug inside of TBOPlyaer: 
https://github.com/KenT2/tboplayer/issues/175#issuecomment-600861514

--
components: Tkinter
files: tboplayer.py
hgrepos: 387
messages: 364586
nosy: Hênio Tierra Sampaio
priority: normal
severity: normal
status: open
title: Widget events are of type Tuple
type: crash
versions: Python 3.7
Added file: https://bugs.python.org/file48982/tboplayer.py

___
Python tracker 

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



[issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval

2020-03-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 50e6e991781db761c496561a995541ca8d83ff87 by Victor Stinner in 
branch 'master':
bpo-39984: Move pending calls to PyInterpreterState (GH-19066)
https://github.com/python/cpython/commit/50e6e991781db761c496561a995541ca8d83ff87


--

___
Python tracker 

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



Re: Why is the program not printing three lines?

2020-03-18 Thread Chris Angelico
On Thu, Mar 19, 2020 at 12:30 PM Souvik Dutta  wrote:
>
> Hi,
> I wrote a purposeless code today.
> 
> class first():
> print("From first")
> def second():
> print("From second")
> first()
> first.second()
> 
>
> Now the output I get is
> From first
> From second
>
> But when I comment the call of first that is the comment the second last
> line of the code (#first()).
> I get the same output. This is confusing because first() when called alone
> prints from first. And first.second() when called alone prints from first
> from second. But when both of them are called together, the output is from
> first from second. Should not first.second() print only from second. Or
> when I call both should I not get three line
> from first
> from first
> from second
> Why do I get that output?

Creating the class runs all the code in the class block, including
function definitions, assignments, and in this case, a print call.

Classes are not declarations. They are executable code.

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


[issue38576] CVE-2019-18348: CRLF injection via the host part of the url passed to urlopen()

2020-03-18 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset e176e0c105786e9f476758eb5438c57223b65e7f by Matěj Cepl in branch 
'2.7':
[2.7] closes bpo-38576: Disallow control characters in hostnames in 
http.client. (GH-19052)
https://github.com/python/cpython/commit/e176e0c105786e9f476758eb5438c57223b65e7f


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



[issue40010] Inefficient sigal handling in multithreaded applications

2020-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

I found this issue while working on PR 19066 of bpo-39984.

--
stage: patch review -> 

___
Python tracker 

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



[issue40010] Inefficient sigal handling in multithreaded applications

2020-03-18 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



Why is the program not printing three lines?

2020-03-18 Thread Souvik Dutta
Hi,
I wrote a purposeless code today.

class first():
print("From first")
def second():
print("From second")
first()
first.second()


Now the output I get is
>From first
>From second

But when I comment the call of first that is the comment the second last
line of the code (#first()).
I get the same output. This is confusing because first() when called alone
prints from first. And first.second() when called alone prints from first
from second. But when both of them are called together, the output is from
first from second. Should not first.second() print only from second. Or
when I call both should I not get three line
from first
from first
from second
Why do I get that output?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue39939] Add str methods to remove prefixes or suffixes

2020-03-18 Thread Guido van Rossum


Guido van Rossum  added the comment:

Sounds good.

--

___
Python tracker 

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



Re: How to build python binaries including external modules

2020-03-18 Thread James via Python-list
On Wednesday, March 18, 2020 at 4:44:46 PM UTC-7, Michael Torrie wrote:

> Cython requires a working Python interpreter to run the setup.py.  How
> would that work when building python itself?

Python binary is built with a host of default modules. My question was how to 
promote external module(s) to a list of default modules. Or is it possible?
The goal was to build python for cross-platforms with external modules.

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


[issue39939] Add str methods to remove prefixes or suffixes

2020-03-18 Thread Dennis Sweeney


Dennis Sweeney  added the comment:

If no one has started, I can draft such a PEP.

--

___
Python tracker 

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



[issue40010] Inefficient sigal handling in multithreaded applications

2020-03-18 Thread STINNER Victor


Change by STINNER Victor :


--
type:  -> performance

___
Python tracker 

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



[issue40010] Inefficient sigal handling in multithreaded applications

2020-03-18 Thread STINNER Victor


New submission from STINNER Victor :

When a thread gets a signal, SIGNAL_PENDING_SIGNALS() sets signals_pending to 1 
and eval_breaker to 1. In this case, _PyEval_EvalFrameDefault() calls 
handle_signals(), but since it's not the main thread, it does nothing and 
signals_pending value remains 1. Moreover, eval_breaker value remains 1 which 
means that the following code will be called before executing *each* bytecode 
instruction.

if (_Py_atomic_load_relaxed(eval_breaker)) {
(...)
opcode = _Py_OPCODE(*next_instr);
if (opcode == SETUP_FINALLY || ...) {
...
}
if (_Py_atomic_load_relaxed(>signals_pending)) {
if (handle_signals(tstate) != 0) {
goto error;
}
}
if (_Py_atomic_load_relaxed(>pending.calls_to_do)) {
...
}

if (_Py_atomic_load_relaxed(>gil_drop_request)) {
...
}
if (tstate->async_exc != NULL) {
...
}
}

This is inefficient.

I'm working on a PR modifying SIGNAL_PENDING_SIGNALS() to not set eval_breaker 
to 1 if the current thread is not the main thread.

--
components: Interpreter Core
messages: 364580
nosy: vstinner
priority: normal
severity: normal
status: open
title: Inefficient sigal handling in multithreaded applications
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



[issue39982] FreeBSD: SCTP tests of test_socket fails on AMD64 FreeBSD Shared 3.x

2020-03-18 Thread Kubilay Kocak


Kubilay Kocak  added the comment:

I've been in touch with the FreeBSD SCTP maintainer and will continue to 
investigate that avenue. 

In the meantime, I'm re-running the last successful 3.x build (382 [1]) to see 
if that fails or not to isolate Cpython code changes as contributing causes

[1] https://buildbot.python.org/all/#/builders/152/builds/382

--

___
Python tracker 

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



[issue39984] Move some ceval fields from _PyRuntime.ceval to PyInterpreterState.ceval

2020-03-18 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +18420
pull_request: https://github.com/python/cpython/pull/19066

___
Python tracker 

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



[issue39985] str.format and string.Formatter subscript behaviors diverge

2020-03-18 Thread Maxwell Bernstein


Change by Maxwell Bernstein :


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

___
Python tracker 

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



Re: How to build python binaries including external modules

2020-03-18 Thread Dan Stromberg
For a rather involved example of using a shell wrapper to build a bunch of
python-related stuff, feel free to raid
http://stromberg.dnsalias.org/svn/cpythons/trunk/ for ideas.  Or even just
use it.

It builds python 1.0 - 3.9, and installs some dependencies like cython,
pygobject and numpy.


On Wed, Mar 18, 2020 at 4:50 PM Dan Stromberg  wrote:

>
> I'm not completely sure I understand what the question is.
>
> You can 'python3 -m pip install cython'.
>
> You can use a shell/powershell wrapper that invokes the two things in
> series.
>
> Does that help?
>
> On Wed, Mar 18, 2020 at 4:10 PM James via Python-list <
> python-list@python.org> wrote:
>
>> When you build python binaries from source, how to add external modules?
>> For example, to install cython, conventional method is building python
>> first, then running setup.py for cython.
>> I'd like to combine the 2-step into one.
>>
>> Thanks
>> James
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to build python binaries including external modules

2020-03-18 Thread Dan Stromberg
I'm not completely sure I understand what the question is.

You can 'python3 -m pip install cython'.

You can use a shell/powershell wrapper that invokes the two things in
series.

Does that help?

On Wed, Mar 18, 2020 at 4:10 PM James via Python-list <
python-list@python.org> wrote:

> When you build python binaries from source, how to add external modules?
> For example, to install cython, conventional method is building python
> first, then running setup.py for cython.
> I'd like to combine the 2-step into one.
>
> Thanks
> James
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to build python binaries including external modules

2020-03-18 Thread Michael Torrie
On 2020-03-18 5:06 p.m., James via Python-list wrote:
> When you build python binaries from source, how to add external modules?
> For example, to install cython, conventional method is building python first, 
> then running setup.py for cython.
> I'd like to combine the 2-step into one.

Cython requires a working Python interpreter to run the setup.py.  How
would that work when building python itself?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-18 Thread STINNER Victor


Change by STINNER Victor :


--
nosy: +vstinner

___
Python tracker 

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



[issue39576] Surprising MemoryError in `decimal` with MAX_PREC

2020-03-18 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

I will try to investigate that but it think this is because without 
OBJECT_MODE=64 the value of decimal.MAX_PREC is much lower (42500
instead 99) so whatever is happening downstream with the higher 
does not happen with the lower one.

I will update If I found something useful on what is going on.

--

___
Python tracker 

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



How to build python binaries including external modules

2020-03-18 Thread James via Python-list
When you build python binaries from source, how to add external modules?
For example, to install cython, conventional method is building python first, 
then running setup.py for cython.
I'd like to combine the 2-step into one.

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


[issue22699] Module source files not found when cross-compiling

2020-03-18 Thread Steve Dower


Steve Dower  added the comment:

Perhaps sysconfig needs an overhaul to be able to handle _PYTHON_PROJECT_BASE 
properly? I see so many values in there that are taken from the running 
interpreter (sys.prefix, for example) that ought to come from the 
cross-compilation target. Wouldn't surprise me if the host's CFLAGS are leaking 
through and adding those extra includes.

--

___
Python tracker 

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



[issue39220] constant folding affects annotations despite 'from __future__ import annotations'

2020-03-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
versions: +Python 3.9 -Python 3.7

___
Python tracker 

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



[issue39220] constant folding affects annotations despite 'from __future__ import annotations'

2020-03-18 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
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: Please Help! Absolute Novice - New Job, have this task.

2020-03-18 Thread bob gailer
Request for future: give us a specific subject e.g. how do I restore a 
button's text/color ?


On 3/18/2020 6:05 PM, mjnash...@gmail.com wrote:

Absolute beginner here, have no idea what I am doing wrong. All I want to do here is have 
the pushButton in PyQt5 to change to "Working..." and Red when clicked... which 
it currently does.

That's amazing since your code sets the text to WORKING...

Thing is I need it to also change back to the default "SCAN" and Green color 
when done running that method the button is linked to...

I know this is a super simple problem, and forgive any Novice errors in this 
code. I know very very little but if you guys can help me I would highly 
appreciate it!!! :)

from PyQt5 import QtCore, QtGui, QtWidgets
import sys
import pyautogui



class Ui_MainWindow(object):
 def setupUi(self, MainWindow):
 MainWindow.setObjectName("MainWindow")
 MainWindow.showMaximized()
 MainWindow.setMinimumSize(QtCore.QSize(0, 0))
 MainWindow.setMaximumSize(QtCore.QSize(3840, 2160))
 font = QtGui.QFont()
 font.setFamily("Arial Black")
 MainWindow.setFont(font)
 MainWindow.setStyleSheet("background-color: rgba(0, 85, 127, 100);")
 self.centralwidget = QtWidgets.QWidget(MainWindow)
 self.centralwidget.setObjectName("centralwidget")
 self.pushButton = QtWidgets.QPushButton(self.centralwidget)
 self.pushButton.setGeometry(QtCore.QRect(250, 250, 400, 150))
 font = QtGui.QFont()
 font.setFamily("Tahoma")
 font.setPointSize(24)
 font.setBold(True)
 font.setWeight(75)
 self.pushButton.setFont(font)
 self.pushButton.setStyleSheet("background-color: rgb(0, 170, 0);\n"
"color: rgb(255, 255, 255);")
 self.pushButton.setObjectName("pushButton")
 self.label = QtWidgets.QLabel(self.centralwidget)
 self.label.setGeometry(QtCore.QRect(730, 300, 701, 111))
 font = QtGui.QFont()
 font.setPointSize(18)
 font.setBold(True)
 font.setItalic(False)
 font.setWeight(75)
 self.label.setFont(font)
 self.label.setLayoutDirection(QtCore.Qt.LeftToRight)
 self.label.setObjectName("label")
 MainWindow.setCentralWidget(self.centralwidget)
 self.menubar = QtWidgets.QMenuBar(MainWindow)
 self.menubar.setGeometry(QtCore.QRect(0, 0, 1920, 18))
 self.menubar.setObjectName("menubar")
 MainWindow.setMenuBar(self.menubar)
 self.statusbar = QtWidgets.QStatusBar(MainWindow)
 self.statusbar.setObjectName("statusbar")
 MainWindow.setStatusBar(self.statusbar)

 self.retranslateUi(MainWindow)
 QtCore.QMetaObject.connectSlotsByName(MainWindow)

 def retranslateUi(self, MainWindow):
 _translate = QtCore.QCoreApplication.translate
 MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
 self.label.setStyleSheet("background-color: rgba(0, 85, 127, 0);\n"
"color: rgb(255, 255, 255);")
 self.pushButton.setText(_translate("MainWindow", "SCAN"))
 self.label.setText(_translate("MainWindow", "WELCOME"))

 self.pushButton.clicked.connect(self.copy)

When user clicks button self.copy is invoked. True?

 def copy(self, MainWindow):
 self.pushButton.setText('WORKING...')

Why do you sometimes use _translate and not other times?

 self.pushButton.setStyleSheet("background-color: rgb(250, 0, 0);\n"
"color: rgb(255, 255, 255);")
 testprompt=storeid=pyautogui.prompt(text='test', title='test')


This method does no actual work! If you add

self.pushButton.setText(_translate("MainWindow", "SCAN"))
self.pushButton.setStyleSheet # whatever it was originally

it will reset the button. Of course it will so really fast, as there is 
no actual work being done.


So you should first address the issue of actually doing something that 
will take a little time. Also it is not a good idea to duplicate code, 
so I would put those 2 lines in a function and call that function from 2 
places.


Am I going in the right direction? Am I missing something?


class Application():
 def run():
 import sys
 app = QtWidgets.QApplication(sys.argv)
 MainWindow = QtWidgets.QMainWindow()
 ui = Ui_MainWindow()
 ui.setupUi(MainWindow)
 MainWindow.show()
 sys.exit(app.exec_())

Application.run()

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


[issue39220] constant folding affects annotations despite 'from __future__ import annotations'

2020-03-18 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset d112c600ab3f5e2910345bcc4bfc39439917ed87 by Pablo Galindo in 
branch 'master':
bpo-39220: Do not optimise annotation if 'from __future__ import annotations' 
is used (GH-17866)
https://github.com/python/cpython/commit/d112c600ab3f5e2910345bcc4bfc39439917ed87


--

___
Python tracker 

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



[issue22699] Module source files not found when cross-compiling

2020-03-18 Thread Steve Dower


Steve Dower  added the comment:

Trimmed a bit from setup.py here, but I think this is the cause:

def build_extensions(self):
self.srcdir = sysconfig.get_config_var('srcdir')
self.srcdir = os.path.abspath(self.srcdir)

[SNIP]

# Fix up the autodetected modules, prefixing all the source files
# with Modules/.
moddirlist = [os.path.join(self.srcdir, 'Modules')]

In my build, I've set PYTHON_FOR_BUILD=python3.8, and the contents of 
moddirlist is '/usr/lib/python3.8/config-3.8-x86_64-linux-gnu/Modules'. So it's 
picking the wrong source directory.

I replaced the second line of the function above with:
self.srcdir = os.path.dirname(os.path.abspath(__file__))

Which made things a little better (I can launch my build now), but all the 
-I/usr/* options need to be replaced as well or there are no dynamically loaded 
modules.

--
title: cross-compilation of Python3.4 -> Module source files not found when 
cross-compiling

___
Python tracker 

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



[issue22699] cross-compilation of Python3.4

2020-03-18 Thread Steve Dower


Steve Dower  added the comment:

I'm now hitting this too, on nearly all the compiled modules in the stdlib. One 
example:

building '_codecs_jp' extension
x86_64-my-linux-gcc -m64 -march=core2 -mtune=core2 -msse3 -mfpmath=sse 
--sysroot=/opt/my-generic/0.0.1-dev/sysroots/core2-64-my-linux -fPIC 
-Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g 
-fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 
-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter 
-Wno-missing-field-initializers -Werror=implicit-function-declaration 
-I../Include/internal -I. -IObjects -IInclude -IPython 
-I/usr/include/x86_64-linux-gnu -I/usr/local/include -I/usr/include/python3.8 
-c cjkcodecs/_codecs_jp.c -o build/temp.linux-x86_64-3.8/cjkcodecs/_codecs_jp.o
x86_64-my-linux-gcc: error: cjkcodecs/_codecs_jp.c: No such file or directory
x86_64-my-linux-gcc: fatal error: no input files
compilation terminated.

I think the working directory is incorrect at some stage - note that the first 
two -I would make sense from Modules, but the next three do not.

--
nosy: +steve.dower
versions: +Python 3.8, Python 3.9 -Python 3.4, Python 3.5

___
Python tracker 

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



[issue40008] Spam

2020-03-18 Thread Zachary Ware


Change by Zachary Ware :


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



[issue40009] Spam

2020-03-18 Thread Zachary Ware


Change by Zachary Ware :


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



[issue40009] Spam

2020-03-18 Thread Zachary Ware


Change by Zachary Ware :


--
nosy:  -Jack Reigns
title: Best Mac Cleaner Apps to Optimize and Speed up your Mac -> Spam
type: performance -> 

___
Python tracker 

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



[issue40009] Spam

2020-03-18 Thread Zachary Ware


Change by Zachary Ware :


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

___
Python tracker 

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



[issue40009] Spam

2020-03-18 Thread Zachary Ware


Change by Zachary Ware :


Removed file: https://bugs.python.org/file48981/MacOptimizerPro.jpg

___
Python tracker 

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



[issue40008] Spam

2020-03-18 Thread Zachary Ware


Change by Zachary Ware :


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

___
Python tracker 

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



[issue40008] Spam

2020-03-18 Thread Zachary Ware


Change by Zachary Ware :


Removed file: https://bugs.python.org/file48980/MacOptimizerPro.jpg

___
Python tracker 

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



[issue40008] Spam

2020-03-18 Thread Zachary Ware


Change by Zachary Ware :


--
nosy:  -Jack Reigns
title: Best Mac Cleaner Software and Optimization Utilities -> Spam
type: performance -> 

___
Python tracker 

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



[issue40009] Best Mac Cleaner Apps to Optimize and Speed up your Mac

2020-03-18 Thread Jack Reigns

New submission from Jack Reigns :

Mac Optimizer Pro's simple drag and drop functionality makes it the best 
program to clean up Mac. Apart from this, you can also select an app and view 
its detailed information so that you know what is hogging up your device’s 
space. Moreover, it lets you clean the cache and rebuild the database 
regardless of the OS version you are using. Other than this, it also has some 
premium features such as software uninstaller and updater to optimize and give 
your Mac’s hard disk the much-needed breathing space.
Call at +1 866-252-2104 for more info or 
visit:- https://www.macoptimizerpro.com/

--
files: MacOptimizerPro.jpg
messages: 364572
nosy: Jack Reigns
priority: normal
severity: normal
status: open
title: Best Mac Cleaner Apps to Optimize and Speed up your Mac
type: performance
Added file: https://bugs.python.org/file48981/MacOptimizerPro.jpg

___
Python tracker 

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



Please Help! Absolute Novice - New Job, have this task.

2020-03-18 Thread mjnash194
Absolute beginner here, have no idea what I am doing wrong. All I want to do 
here is have the pushButton in PyQt5 to change to "Working..." and Red when 
clicked... which it currently does. Thing is I need it to also change back to 
the default "SCAN" and Green color when done running that method the button is 
linked to...

I know this is a super simple problem, and forgive any Novice errors in this 
code. I know very very little but if you guys can help me I would highly 
appreciate it!!! :)

from PyQt5 import QtCore, QtGui, QtWidgets
import sys
import pyautogui



class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.showMaximized()
MainWindow.setMinimumSize(QtCore.QSize(0, 0))
MainWindow.setMaximumSize(QtCore.QSize(3840, 2160))
font = QtGui.QFont()
font.setFamily("Arial Black")
MainWindow.setFont(font)
MainWindow.setStyleSheet("background-color: rgba(0, 85, 127, 100);")
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.pushButton = QtWidgets.QPushButton(self.centralwidget)
self.pushButton.setGeometry(QtCore.QRect(250, 250, 400, 150))
font = QtGui.QFont()
font.setFamily("Tahoma")
font.setPointSize(24)
font.setBold(True)
font.setWeight(75)
self.pushButton.setFont(font)
self.pushButton.setStyleSheet("background-color: rgb(0, 170, 0);\n"
"color: rgb(255, 255, 255);")
self.pushButton.setObjectName("pushButton")
self.label = QtWidgets.QLabel(self.centralwidget)
self.label.setGeometry(QtCore.QRect(730, 300, 701, 111))
font = QtGui.QFont()
font.setPointSize(18)
font.setBold(True)
font.setItalic(False)
font.setWeight(75)
self.label.setFont(font)
self.label.setLayoutDirection(QtCore.Qt.LeftToRight)
self.label.setObjectName("label")
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 1920, 18))
self.menubar.setObjectName("menubar")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)

self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)

def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.label.setStyleSheet("background-color: rgba(0, 85, 127, 0);\n"
"color: rgb(255, 255, 255);")
self.pushButton.setText(_translate("MainWindow", "SCAN"))
self.label.setText(_translate("MainWindow", "WELCOME"))

self.pushButton.clicked.connect(self.copy)

def copy(self, MainWindow):
self.pushButton.setText('WORKING...')
self.pushButton.setStyleSheet("background-color: rgb(250, 0, 0);\n"
"color: rgb(255, 255, 255);")
testprompt=storeid=pyautogui.prompt(text='test', title='test')



class Application():
def run():
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())

Application.run()
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue38865] Can Py_Finalize() be called if the current interpreter is not the main interpreter?

2020-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

This issue became a blocker issue while working on bpo-39984, when I tried to 
move pending calls from _PyRuntimeState to PyInterpreterState.

I wrote PR 19063 to deny calling Py_FinalizeEx() from a subinterpreter.


Eric:
> On the other hand, if the "main" interpreter isn't special after runtime init 
> is done (i.e. a subinterpreter is effectively indistinguishable by nature) 
> then it certainly would not matter which one finalizes (or is active during 
> fork() for that matter).  On top of that, the effort we are making to 
> identify the main interpreter (both in the code and in the docs) becomes 
> unnecessary.

Well. Maybe we will be able to reach this point later, but right now, there are 
concrete implementation issues. The main interpreter remains special. Only the 
main interpreter is allowed to call fork(), spawn daemon threads, handle 
signals, etc.

If we manage to make subinterpreters less special, we can change 
Py_FinalizeEx() again later.


I asked:
> Is Python supposed to magically destroy the 3 interpreters?

Currently, Py_FinalizeEx() fails with a fatal error if there are remaining 
subinterpreters:
---
Fatal Python error: PyInterpreterState_Delete: remaining subinterpreters
Python runtime state: finalizing (tstate=0xfaa1c0)

Abandon (core dumped)
---

IMHO it's a good behavior.

if we want, we can modify Py_FinalizeEx() to magically end subinterpters later. 
The opposite may be more annoying for embedders.

--

___
Python tracker 

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



[ANN] PyYAML-5.3.1: YAML parser and emitter for Python

2020-03-18 Thread Tina Müller

===
Announcing PyYAML-5.3.1
===

A new release of PyYAML is now available:
https://pypi.org/project/PyYAML/

This release contains a security fix for CVE-2020-1747. FullLoader was still
exploitable for arbitrary command execution.
https://bugzilla.redhat.com/show_bug.cgi?id=1807367

Thanks to Riccardo Schirone (https://github.com/ret2libc) for both reporting
this and providing the fixes to resolve it.

Changes
===

* https://github.com/yaml/pyyaml/pull/386 -- Prevents arbitrary code execution 
during python/object/new constructor


Resources
=

PyYAML IRC Channel: #pyyaml on irc.freenode.net
PyYAML homepage: https://github.com/yaml/pyyaml
PyYAML documentation: http://pyyaml.org/wiki/PyYAMLDocumentation
Source and binary installers: https://pypi.org/project/PyYAML/
GitHub repository: https://github.com/yaml/pyyaml/
Bug tracking: https://github.com/yaml/pyyaml/issues

YAML homepage: http://yaml.org/
YAML-core mailing list: http://lists.sourceforge.net/lists/listinfo/yaml-core


About PyYAML


YAML is a data serialization format designed for human readability and
interaction with scripting languages. PyYAML is a YAML parser and emitter for
Python.

PyYAML features a complete YAML 1.1 parser, Unicode support, pickle support,
capable extension API, and sensible error messages. PyYAML supports standard
YAML tags and provides Python-specific tags that allow to represent an
arbitrary Python object.

PyYAML is applicable for a broad range of tasks from complex configuration
files to object serialization and persistence.


Example
===


import yaml



yaml.full_load("""

... name: PyYAML
... description: YAML parser and emitter for Python
... homepage: https://github.com/yaml/pyyaml
... keywords: [YAML, serialization, configuration, persistence, pickle]
... """)
{'keywords': ['YAML', 'serialization', 'configuration', 'persistence',
'pickle'], 'homepage': 'https://github.com/yaml/pyyaml', 'description':
'YAML parser and emitter for Python', 'name': 'PyYAML'}


print(yaml.dump(_))

name: PyYAML
homepage: https://github.com/yaml/pyyaml
description: YAML parser and emitter for Python
keywords: [YAML, serialization, configuration, persistence, pickle]


Maintainers
===

The following people are currently responsible for maintaining PyYAML:

* Tina Mueller
* Ingy döt Net
* Matt Davis

and many thanks to all who have contribributed!
See: https://github.com/yaml/pyyaml/pulls


Copyright
=

Copyright (c) 2017-2020 Ingy döt Net 
Copyright (c) 2006-2016 Kirill Simonov 

The PyYAML module was written by Kirill Simonov .
It is currently maintained by the YAML and Python communities.

PyYAML is released under the MIT license.
See the file LICENSE for more details.
--
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/


Re: Tkinter: which ttk widget for database table primary key?

2020-03-18 Thread Rich Shepard

On Wed, 18 Mar 2020, MRAB wrote:


You can make the Entry widget read-only:
   entry_widget['state'] = 'readonly'
The user will still be able to copy from it.

Alternatively, you can disable it:

   entry_widget['state'] = 'disabled'

The user won't be able to copy from it.

When updating the GUI, you'll need to make it writeable if you have it 
currently read-only or disabled:


   entry_widget['state'] = 'normal'
   :
   # Change the contents here.
   :
   entry_widget['state'] = 'readonly'


MRAB,

Thanks very much for expanding on Christian's response. This is the widget
I'll use and set it to 'readonly'.

Regards,

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


Re: Tkinter: which ttk widget for database table primary key?

2020-03-18 Thread Rich Shepard

On Wed, 18 Mar 2020, Christian Gollwitzer wrote:


You can use an Entry and set it to readonly state. Or you can use a Label.
The advantage of the readonly Entry is, that the user can still copy/paste
the content, and that it can scroll if the string is very long.


Christian,

Thank you. I did not find all options for the Entry widget in my quick look
for them. I like this because users will sometimes want to find all data
from that location and being able to copy that number and paste it in a
query will be helpful.

Regards,

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


[issue38865] Can Py_Finalize() be called if the current interpreter is not the main interpreter?

2020-03-18 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue39917] new_compiler() called 2nd time causes error

2020-03-18 Thread Todd Levi


Todd Levi  added the comment:

In looking through the setup.py file for uvloop, I see that they purposely do 
not call super().initialize_options() or super().finalize_options() in their 
code if they've already been called once.

I think that is why their code is revealing this problem - the 2nd command to 
be run is inheriting the self.compiler value from the first command since 
build_ext.initialize_options() isn't being called to (re)set self.compiler to 
be None.

I'm not sure if there's a "rule" that says each command must call 
initialize_options() to "sanitize" the object or not but that does explain why 
the 2nd command is seeing a CCompiler object() for self.compiler on the 2nd 
time through.

--

___
Python tracker 

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



[ANN] PyYAML-5.3.1: YAML parser and emitter for Python

2020-03-18 Thread Tina Müller

===
Announcing PyYAML-5.3.1
===

A new release of PyYAML is now available:
https://pypi.org/project/PyYAML/

This release contains a security fix for CVE-2020-1747. FullLoader was still
exploitable for arbitrary command execution.
https://bugzilla.redhat.com/show_bug.cgi?id=1807367

Thanks to Riccardo Schirone (https://github.com/ret2libc) for both reporting
this and providing the fixes to resolve it.

Changes
===

* https://github.com/yaml/pyyaml/pull/386 -- Prevents arbitrary code execution 
during python/object/new constructor


Resources
=

PyYAML IRC Channel: #pyyaml on irc.freenode.net
PyYAML homepage: https://github.com/yaml/pyyaml
PyYAML documentation: http://pyyaml.org/wiki/PyYAMLDocumentation
Source and binary installers: https://pypi.org/project/PyYAML/
GitHub repository: https://github.com/yaml/pyyaml/
Bug tracking: https://github.com/yaml/pyyaml/issues

YAML homepage: http://yaml.org/
YAML-core mailing list: http://lists.sourceforge.net/lists/listinfo/yaml-core


About PyYAML


YAML is a data serialization format designed for human readability and
interaction with scripting languages. PyYAML is a YAML parser and emitter for
Python.

PyYAML features a complete YAML 1.1 parser, Unicode support, pickle support,
capable extension API, and sensible error messages. PyYAML supports standard
YAML tags and provides Python-specific tags that allow to represent an
arbitrary Python object.

PyYAML is applicable for a broad range of tasks from complex configuration
files to object serialization and persistence.


Example
===


import yaml



yaml.full_load("""

... name: PyYAML
... description: YAML parser and emitter for Python
... homepage: https://github.com/yaml/pyyaml
... keywords: [YAML, serialization, configuration, persistence, pickle]
... """)
{'keywords': ['YAML', 'serialization', 'configuration', 'persistence',
'pickle'], 'homepage': 'https://github.com/yaml/pyyaml', 'description':
'YAML parser and emitter for Python', 'name': 'PyYAML'}


print(yaml.dump(_))

name: PyYAML
homepage: https://github.com/yaml/pyyaml
description: YAML parser and emitter for Python
keywords: [YAML, serialization, configuration, persistence, pickle]


Maintainers
===

The following people are currently responsible for maintaining PyYAML:

* Tina Mueller
* Ingy döt Net
* Matt Davis

and many thanks to all who have contribributed!
See: https://github.com/yaml/pyyaml/pulls


Copyright
=

Copyright (c) 2017-2020 Ingy döt Net 
Copyright (c) 2006-2016 Kirill Simonov 

The PyYAML module was written by Kirill Simonov .
It is currently maintained by the YAML and Python communities.

PyYAML is released under the MIT license.
See the file LICENSE for more details.
--
https://mail.python.org/mailman/listinfo/python-list


[issue40008] Best Mac Cleaner Software and Optimization Utilities

2020-03-18 Thread Jack Reigns


New submission from Jack Reigns :

Mac Optimizer Pro a bunch of tools that can be used to perform various actions 
on your Mac. A number of the tools on offer can be used to clean your Mac.

--
files: MacOptimizerPro.jpg
messages: 364570
nosy: Jack Reigns
priority: normal
severity: normal
status: open
title: Best Mac Cleaner Software and Optimization Utilities
type: performance
Added file: https://bugs.python.org/file48980/MacOptimizerPro.jpg

___
Python tracker 

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



Re: ZipFile and timestamps

2020-03-18 Thread MRAB

On 2020-03-18 20:38, Manfred Lotz wrote:

I unzip a zip file like follows which works fine.

  with ZipFile(zip_file, 'r') as zip:
 zip.extractall(tmp_dir)

The only caveat is that the unpacked files and dirs do have a current
timestamp i.e. the timestamps of the files are not preserved.

Is there a way to tell ZipFile to preserve timestamps when unpacking a
zip archive?

You might have to iterate over the contents yourself and set the 
modification times.

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


[issue40002] Cookie load error inconsistency

2020-03-18 Thread Bar Harel


Bar Harel  added the comment:

Patch done, ready for upload.
No http experts for nosy, triage needed.

--
type:  -> behavior

___
Python tracker 

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



[issue28009] Fix uuid.uuid1() core logic of uuid.getnode() needs refresh

2020-03-18 Thread Tal Einat


Tal Einat  added the comment:

Your fix LGTM, Victor.

--

___
Python tracker 

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



Re: Tkinter: which ttk widget for database table primary key?

2020-03-18 Thread MRAB

On 2020-03-18 20:39, Rich Shepard wrote:

Subject might be confusing so I'll expand it here.

My application uses a database backend in which each table has a unique and
database-generated sequential numeric key. I want to display that key in the
GUI for that class but it's not entered by the user or altered. It seems to
me that the ttk.Entry and ttk.Spinbox widgets are inappropriate. As a
newcomer to Tkinter I ask for advice on which widget to use.


You can make the Entry widget read-only:

entry_widget['state'] = 'readonly'

The user will still be able to copy from it.

Alternatively, you can disable it:

entry_widget['state'] = 'disabled'

The user won't be able to copy from it.

When updating the GUI, you'll need to make it writeable if you have it 
currently read-only or disabled:


entry_widget['state'] = 'normal'
:
# Change the contents here.
:
entry_widget['state'] = 'readonly'
--
https://mail.python.org/mailman/listinfo/python-list


Re: Tkinter: which ttk widget for database table primary key?

2020-03-18 Thread Christian Gollwitzer

Am 18.03.20 um 21:39 schrieb Rich Shepard:

Subject might be confusing so I'll expand it here.

My application uses a database backend in which each table has a unique and
database-generated sequential numeric key. I want to display that key in 
the

GUI for that class but it's not entered by the user or altered. It seems to
me that the ttk.Entry and ttk.Spinbox widgets are inappropriate. As a
newcomer to Tkinter I ask for advice on which widget to use.


You can use an Entry and set it to readonly state. Or you can use a 
Label. The advantage of the readonly Entry is, that the user can still 
copy/paste the content, and that it can scroll if the string is very long.


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


[issue28686] py.exe ignored PATH when using python3 shebang

2020-03-18 Thread Riccardo Polignieri


Riccardo Polignieri  added the comment:

Three years later, this problem seems on the way to fix itself 
(https://xkcd.com/1822/).

Versioned shebangs (and versioned "/env" shebangs) used to be a more prominent 
issue when you needed a way to tell Python 2 / Python 3 scripts apart. With the 
sunset of Python 2.7-3.3 almost completed, now we have a reasonably homogeneous 
block of inter-compatible Pythons.
True, py.exe won't cope very well with versioned shebangs, but this seems to 
become less and less annoying by the day.

As for the other problem from issue 39785, ie Python 2 still being selected as 
"default" in deference to some arcane Linux convention that we have been 
dragging for ten years (even on Windows!)... it would be nice to finally have 
*that* fixed. 
But then again, having Python 2 installed on your Windows box is becoming 
increasingly rare. Most users are likely never hitting this weirdness any more. 



In the meantime, now we have yet another way of installing Python on Windows... 
versioned executables from the Store! With no py.exe! So, who knows, maybe 
py.exe is the past, versioned executable are the future...

To sum up, while I would certainly add a note to the docs, to clarify that 
py.exe does not support versioned "/env" shebangs, IMO today the work needed to 
specify a behaviour for all possible cases, possibly even extending/modifying 
Linux conventions, is just too much to be worth the effort.

--

___
Python tracker 

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



[issue39980] importlib.resources.path() may return incorrect path when using custom loader

2020-03-18 Thread Jason R. Coombs


Jason R. Coombs  added the comment:

How's that for service ;)

Glad to hear it worked. I'm going to close this as won't fix (as it was 
reported against 3.7 and 3.8 and changing it for them would be 
backward-incompatible, even if more correct). Please report back if that 
outcome is unsatisfactory.

--

___
Python tracker 

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



[issue39980] importlib.resources.path() may return incorrect path when using custom loader

2020-03-18 Thread Jason R. Coombs


Change by Jason R. Coombs :


--
resolution:  -> wont fix
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



[issue40007] An attempt to make asyncio.transport.writelines (selector) use Scatter I/O

2020-03-18 Thread tzickel


New submission from tzickel :

I have a code that tries to be smart and prepare data to be chunked efficiently 
before sending, so I was happy to read about:

https://docs.python.org/3/library/asyncio-protocol.html#asyncio.WriteTransport.writelines

Only to see that it simply does:

self.write(b''.join(lines))

So I've attempted to write an version that uses sendmsg (scatter I/O) instead 
(will be attached in PR).

What I've learnt is:
1. It's hard to benchmark (If someone has an good example on checking if it's 
worth it, feel free to add such).
2. sendmsg has an OS limit on how many items can be done in one call. If the 
user does not call writer.drain() it might have too many items in the buffer, 
in that case I concat them (might be an expensive operation ? but that should 
not be th enormal case).
3. socket.socket.sendmsg can accept any bytes like iterable, but os.writev can 
only accept sequences, is that a bug ?
4. This is for the selector stream socket for now.

--
components: asyncio
messages: 364565
nosy: asvetlov, tzickel, yselivanov
priority: normal
pull_requests: 18416
severity: normal
status: open
title: An attempt to make asyncio.transport.writelines (selector) use Scatter 
I/O
type: enhancement
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



[issue40005] Getting different result in python 2.7 and 3.7.

2020-03-18 Thread Tim Peters


Tim Peters  added the comment:

u1 is a global _only_ in a process that runs `function()`, which declares u1 
global and assigns it a value.  You have no sane expectation that a worker 
process (none of which run `function()`) will know anything about it.

Are you sure you're running 2.7 and 3.7 on the same machine?  It's impossible 
that this code ever "worked" under Windows, but it might under Linux-y systems, 
which use `fork()` to create worker processes.

The traceback you showed was obviously run under Windows.  Under Python 2.7.11 
on Windows, I get the same kind of error:

NameError: global name 'u1' is not defined

This is the code:

from multiprocessing import Pool
import traceback

class Utils:
def __init__(self):
   self.count = 10

def function():
global u1
u1 = Utils()
l1 = range(3)
process_pool = Pool(1)
try:
process_pool.map(add, l1, 1)
process_pool.close()
process_pool.join()
except Exception as e:
process_pool.terminate()
process_pool.join()
print(traceback.format_exc())
print(e)

def add(num):
 total = num + u1.count
 print(total)

if __name__ == "__main__":
function()

--
nosy: +tim.peters

___
Python tracker 

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



Tkinter: which ttk widget for database table primary key?

2020-03-18 Thread Rich Shepard

Subject might be confusing so I'll expand it here.

My application uses a database backend in which each table has a unique and
database-generated sequential numeric key. I want to display that key in the
GUI for that class but it's not entered by the user or altered. It seems to
me that the ttk.Entry and ttk.Spinbox widgets are inappropriate. As a
newcomer to Tkinter I ask for advice on which widget to use.

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


[issue40005] Getting different result in python 2.7 and 3.7.

2020-03-18 Thread Bharat Solanki


Bharat Solanki  added the comment:

u1 is global variable. So I can use it any where. Rigth!

Thanks
Bharat

On Thu, Mar 19, 2020, 2:09 AM Bharat Solanki  wrote:

>
> Bharat Solanki  added the comment:
>
> When you run this test.py in 2.7. you will get output (10 11 20), But in
> 3.7, Its getting failed. Its showing below error:
>
> "Traceback (most recent call last):
>   File "test.py", line 14, in function
> process_pool.map(add, l1, 1)
>   File "C:\Users\Bharat Solanki\Anaconda3\lib\multiprocessing\pool.py",
> line 268, in map
> return self._map_async(func, iterable, mapstar, chunksize).get()
>   File "C:\Users\Bharat Solanki\Anaconda3\lib\multiprocessing\pool.py",
> line 657, in get
> raise self._value
> NameError: name 'u1' is not defined"
>
> Please let me know if you need any other information.
>
> Thanks
> Bharat
>
> --
> Added file: https://bugs.python.org/file48979/test.py
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



ZipFile and timestamps

2020-03-18 Thread Manfred Lotz
I unzip a zip file like follows which works fine.   

 with ZipFile(zip_file, 'r') as zip:
zip.extractall(tmp_dir)

The only caveat is that the unpacked files and dirs do have a current
timestamp i.e. the timestamps of the files are not preserved.

Is there a way to tell ZipFile to preserve timestamps when unpacking a
zip archive?


-- 
Manfred

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


[issue40005] Getting different result in python 2.7 and 3.7.

2020-03-18 Thread Bharat Solanki


Bharat Solanki  added the comment:

When you run this test.py in 2.7. you will get output (10 11 20), But in 3.7, 
Its getting failed. Its showing below error: 

"Traceback (most recent call last):
  File "test.py", line 14, in function
process_pool.map(add, l1, 1)
  File "C:\Users\Bharat Solanki\Anaconda3\lib\multiprocessing\pool.py", line 
268, in map
return self._map_async(func, iterable, mapstar, chunksize).get()
  File "C:\Users\Bharat Solanki\Anaconda3\lib\multiprocessing\pool.py", line 
657, in get
raise self._value
NameError: name 'u1' is not defined"

Please let me know if you need any other information.

Thanks 
Bharat

--
Added file: https://bugs.python.org/file48979/test.py

___
Python tracker 

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



Re: How to fit & predict in Cat-boost Algorithm

2020-03-18 Thread Barry Scott



> On 18 Mar 2020, at 08:59, princit  wrote:
> 
> I am new in python. I am trying to predict the "time_to_failure" for given 
> "acoustic_data" in the test CSV file using catboost algorithm.
> 
> 
> def catbostregtest(X_train, y_train):  
># submission format
>submission = pd.read_csv('sample_submission.csv', index_col='seg_id')
>X_test = pd.DataFrame()
># prepare test data
>for seg_id in submission.index:
>seg = pd.read_csv('test/' + seg_id + '.csv')
>ch = gen_features(seg['acoustic_data'])
>X_test = X_test.append(ch, ignore_index=True)
># model of choice here
>model = CatBoostRegressor(iterations=1, loss_function='MAE', 
> boosting_type='Ordered')
>model.fit(X_train, y_train)  #error line
>y_hat = model.predict(X_test)#error line
># write submission file LSTM
>submission['time_to_failure'] = y_hat
>submission.to_csv('submissionCAT.csv')
>print(model.best_score_)
> 
> 
> 
> This function "catbostregtest" is giving me error with the errorlog

Have you checked the documentation for the library you are using?
Its clear that the author knows something is wrong, hence the error:

> CatBoostError: 
> c:/goagent/pipelines/buildmaster/catboost.git/catboost/libs/data/quantization.cpp:2424:
>  All features are either constant or ignored.

Hopeful the author documented the error to guide you.

Barry


> 
> Traceback (most recent call last):
> File "E:\dir\question.py", line 68, in main()
> File "E:\dir\question.py", line 65, in main catbostregtest(X_train, y_train)
> File "E:\dir\question.py", line 50, in catbostregtest model.fit(X_train, 
> y_train)
> File 
> "C:\Users\xyz\AppData\Local\Continuum\anaconda3\lib\site-packages\catboost\core.py",
>  line 4330, in fit save_snapshot, snapshot_file, snapshot_interval, 
> init_model)
> File 
> "C:\Users\xyz\AppData\Local\Continuum\anaconda3\lib\site-packages\catboost\core.py",
>  line 1690, in _fit train_params["init_model"]
> File 
> "C:\Users\xyz\AppData\Local\Continuum\anaconda3\lib\site-packages\catboost\core.py",
>  line 1225, in _train self._object._train(train_pool, test_pool, params, 
> allow_clear_pool, init_model._object if init_model else None)
> File "_catboost.pyx", line 3870, in _catboost._CatBoost._train
> File "_catboost.pyx", line 3916, in _catboost._CatBoost._train
> CatBoostError: 
> c:/goagent/pipelines/buildmaster/catboost.git/catboost/libs/data/quantization.cpp:2424:
>  All features are either constant or ignored.
> This is gen_features function
> 
> def gen_features(X):
> 
>strain = []
> 
>strain.append(X.mean())
> 
>strain.append(X.std())
> 
>strain.append(X.min())
> 
>strain.append(X.max())
> 
>strain.append(X.kurtosis())
> 
>strain.append(X.skew())
> 
>strain.append(np.quantile(X,0.01))
> 
>strain.append(np.quantile(X,0.05))
> 
>strain.append(np.quantile(X,0.95))
> 
>strain.append(np.quantile(X,0.99))
> 
>strain.append(np.abs(X).max())
> 
>strain.append(np.abs(X).mean())
> 
>strain.append(np.abs(X).std())
> 
>return pd.Series(strain)
> 
> 
> This function is called from the main function
> 
> def main():
>train1 = pd.read_csv('train.csv', iterator=True, chunksize=150_000, 
> dtype={'acoustic_data': np.int16, 'time_to_failure': np.float64})
>X_train = pd.DataFrame()
>y_train = pd.Series() 
>for df in train1: 
>ch = gen_features(df['acoustic_data']) 
>X_train = X_train.append(ch, ignore_index=True)
>y_train = y_train.append(pd.Series(df['time_to_failure'].values[-1])) 
>catbostregtest(X_train, y_train)
> 
> How I can remove the error that occur during making predict from catboost 
> model? How I can remove this error please help. You can download and run the 
> project in spyder ide from this link 
> https://drive.google.com/file/d/1JFsNfE22ef82e-dS0zsZHDE3zGJxnJ_J/view?usp=sharing
>  or https://github.com/princit/catboostAlgorithm
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

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


[issue40006] enum: Add documentation for _create_pseudo_member_ and composite members

2020-03-18 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +barry, eli.bendersky, ethan.furman

___
Python tracker 

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



[issue40006] enum: Add documentation for _create_pseudo_member_ and composite members

2020-03-18 Thread Ram Rachum


New submission from Ram Rachum :

Looking at the enum source code, there's a method `_create_pseudo_member_` 
that's used in a bunch of places. Its docstring says "Create a composite member 
iff value contains only members", which would have been useful if I had any 
idea what "composite member" meant.

It would be good if the documentation for the enum module would include more 
information about these two concepts.

--
assignee: docs@python
components: Documentation
messages: 364561
nosy: cool-RR, docs@python
priority: normal
severity: normal
status: open
title: enum: Add documentation for _create_pseudo_member_ and composite members
type: enhancement
versions: Python 3.8, Python 3.9

___
Python tracker 

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



[issue40005] Getting different result in python 2.7 and 3.7.

2020-03-18 Thread Eric V. Smith


Eric V. Smith  added the comment:

Note that 2.7 is no longer supported.

If you think you found a bug in 3.7, then please:
- Reformat your code so that we can understand it.
- Show us what output you actually get.
- Show us what output you expect, and why.

--
nosy: +eric.smith

___
Python tracker 

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



[issue40005] Getting different result in python 2.7 and 3.7.

2020-03-18 Thread Bharat Solanki


New submission from Bharat Solanki :

Hi Team,

Below code is giving different result in python 2.7 and 3.7 version. Code is 
running fine when i am using 2.7 but in 3.7, it is showing error.  

from multiprocessing import Pool
import traceback
class Utils: def __init__(self): self.count = 10

def function(): global u1 u1 = Utils() l1 = range(3) process_pool = Pool(1) 
try: process_pool.map(add, l1, 1) process_pool.close() process_pool.join() 
except Exception as e: process_pool.terminate() process_pool.join() 
print(traceback.format_exc()) print(e)
def add(num): total = num + u1.count print(total)
if __name__ == "__main__": function()

Could you please help me on this how can it run in 3.7 version.

Thanks,
Bharat

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 364559
nosy: Bharatsolanki
priority: normal
severity: normal
status: open
title: Getting different result in python 2.7 and 3.7.
type: compile error
versions: Python 2.7

___
Python tracker 

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



[issue21087] imp.frozen_init() incorrectly removes module during reload

2020-03-18 Thread Brett Cannon


Brett Cannon  added the comment:

No one has cared in nearly 6 years, so I'm closing as "won't fix". :)

--
resolution:  -> wont fix
stage: test needed -> 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



[issue20890] Miscellaneous PEP 101 additions

2020-03-18 Thread Brett Cannon


Brett Cannon  added the comment:

These parts of the devguide don't seem to exist anymore, so I'm closing as 
outdated.

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



[issue40002] Cookie load error inconsistency

2020-03-18 Thread Bar Harel


Bar Harel  added the comment:

For reference, docs already state:

"On encountering an invalid cookie, CookieError is raised, so if your cookie 
data comes from a browser you should always prepare for invalid data and catch 
CookieError on parsing."

--

___
Python tracker 

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



[issue20899] Nested namespace imports do not work inside zip archives

2020-03-18 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue20613] Wrong line information in bytecode generated by compiler module

2020-03-18 Thread Brett Cannon


Brett Cannon  added the comment:

Since 2.7 development is done there is no compiler packages anymore to worry 
about. :)

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



[issue21078] multiprocessing.managers.BaseManager.__init__'s "serializer" argument is not documented

2020-03-18 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue20459] No Argument Clinic documentation on how to specify a return converter

2020-03-18 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue20360] inspect.Signature could provide readable expressions for default values for builtins

2020-03-18 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue20439] inspect.Signature: Add Signature.format method to match formatargspec functionality

2020-03-18 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue20341] Argument Clinic: add "nullable ints"

2020-03-18 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue20461] Argument Clinic included return converters hard code use of ``_return_value``

2020-03-18 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue20506] Command to display all available Import Library

2020-03-18 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue20506] Command to display all available Import Library

2020-03-18 Thread Brett Cannon


Brett Cannon  added the comment:

When a replacement for pkgutil.walk_packages() is added to importlib to work 
appropriately with the import system then this should be doable. See 
https://bugs.python.org/issue19939 for work to replace pkgutil as appropriate.

--

___
Python tracker 

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



[issue20123] pydoc.synopsis fails to load binary modules

2020-03-18 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue20131] warnings module offers no documented, programmatic way to reset "seen-warning" flag

2020-03-18 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue20205] inspect.getsource(), P302 loader and '<..>' filenames

2020-03-18 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue20125] We need a good replacement for direct use of load_module(), post-PEP 451

2020-03-18 Thread Brett Cannon


Brett Cannon  added the comment:

I don't think this is still needed as the importlib docs now has enough 
examples to show people how to get to get similar results with a few method 
calls.

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



[issue39995] test_concurrent_futures: ProcessPoolSpawnExecutorDeadlockTest.test_crash() fails with OSError: [Errno 9] Bad file descriptor

2020-03-18 Thread STINNER Victor


STINNER Victor  added the comment:

> Same bug on AMD64 FreeBSD Non-Debug 3.x:
> https://buildbot.python.org/all/#/builders/214/builds/472

Oh, test_crash failed twice, but not on the same test case:

* ERROR: test_crash 
(test.test_concurrent_futures.ProcessPoolSpawnExecutorDeadlockTest) [crash 
during func execution on worker]
* ERROR: test_crash 
(test.test_concurrent_futures.ProcessPoolForkExecutorDeadlockTest) [crash 
during func execution on worker]

The second failure was when test_concurrent_futures was re-run sequentially.

--

___
Python tracker 

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



[issue21242] Generalize configure check for working Python executable

2020-03-18 Thread Brett Cannon


Change by Brett Cannon :


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



[issue37127] Handling pending calls during runtime finalization may cause problems.

2020-03-18 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8849e5962ba481d5d414b3467a256aba2134b4da by Victor Stinner in 
branch 'master':
bpo-39984: trip_signal() uses PyGILState_GetThisThreadState() (GH-19061)
https://github.com/python/cpython/commit/8849e5962ba481d5d414b3467a256aba2134b4da


--

___
Python tracker 

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



[issue21459] DragonFlyBSD support

2020-03-18 Thread Brett Cannon


Change by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue21108] Add examples for importlib in doc

2020-03-18 Thread Brett Cannon


Brett Cannon  added the comment:

There are now examples in the importlib docs.

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



  1   2   >