[issue45876] Improve accuracy of stdev functions in statistics

2021-11-25 Thread Mark Dickinson


Mark Dickinson  added the comment:

There's also a potential double-rounding issue with ldexp, when the first 
argument is an int: ldexp(n, e) will first round n to a float, and then (again 
for results in the subnormal range) potentially also need to round the result.

>>> n = 2**53 + 1
>>> e = -1128
>>> math.ldexp(n, e)
0.0
>>> n / (1 << -e)
5e-324

I'm a bit (but only a bit) surprised and disappointed by the Windows issue; 
thanks, Tim. It seems to be okay on Mac (Intel, macOS 11.6.1):

>>> import math
>>> d = math.nextafter(0.0, 1.0)
>>> d
5e-324
>>> d3 = 7 * d
>>> d3
3.5e-323
>>> d3 / 4.0
1e-323
>>> math.ldexp(d3, -2)
1e-323

--

___
Python tracker 

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



[issue40280] Consider supporting emscripten/webassembly as a build target

2021-11-25 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset ee1e2c604c8a66a407116d9c3e589ab0b9580c54 by Christian Heimes in 
branch 'main':
bpo-40280: Use Setup.stdlib static for wasm builds (GH-29784)
https://github.com/python/cpython/commit/ee1e2c604c8a66a407116d9c3e589ab0b9580c54


--

___
Python tracker 

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



[issue45653] Freeze the encodings module.

2021-11-25 Thread Kumar Aditya


Change by Kumar Aditya :


--
nosy: +kumaraditya303
nosy_count: 3.0 -> 4.0
pull_requests: +28024
pull_request: https://github.com/python/cpython/pull/29788

___
Python tracker 

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



[issue45619] Mentioning structural pattern matching in the list of binding

2021-11-25 Thread Guido van Rossum


Change by Guido van Rossum :


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



[issue45901] store app file type ignores command-line arguments

2021-11-25 Thread Eryk Sun


New submission from Eryk Sun :

The file association for the store app uses '"%1"' for the command-line 
parameters. This ignores the rest of the command-line arguments, i.e. '%*'. In 
PC/layout/support/appxmanifest.py, the add_application() calls that add the 
"Python" and "PythonW" applications should be changed to use the parameters 
string '"%1" %*' in the file types.

--
components: Installation, Windows
messages: 407029
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: store app file type ignores command-line arguments
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue45619] Mentioning structural pattern matching in the list of binding

2021-11-25 Thread miss-islington


miss-islington  added the comment:


New changeset 7842aed7a7938df20b652177458407683e7f1a0b by Miss Islington (bot) 
in branch '3.10':
bpo-45619: documentation of execution model: clarify and update binding summary 
(GH-29232)
https://github.com/python/cpython/commit/7842aed7a7938df20b652177458407683e7f1a0b


--

___
Python tracker 

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



[issue45619] Mentioning structural pattern matching in the list of binding

2021-11-25 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset cd876c84932ecc2f7a6c41f3fc800a34d5b06b95 by Arthur Milchior in 
branch 'main':
bpo-45619: documentation of execution model: clarify and update binding summary 
(#29232)
https://github.com/python/cpython/commit/cd876c84932ecc2f7a6c41f3fc800a34d5b06b95


--

___
Python tracker 

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



[issue45619] Mentioning structural pattern matching in the list of binding

2021-11-25 Thread miss-islington


Change by miss-islington :


--
nosy: +miss-islington
nosy_count: 3.0 -> 4.0
pull_requests: +28023
pull_request: https://github.com/python/cpython/pull/29787

___
Python tracker 

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



[issue44353] PEP 604 NewType

2021-11-25 Thread Guido van Rossum


Guido van Rossum  added the comment:


New changeset 93c65df83cef71a4bc77d71afecdec8744c4f73a by Alex Waygood in 
branch 'main':
bpo-44353: Correct docstring for `NewType` (#29785)
https://github.com/python/cpython/commit/93c65df83cef71a4bc77d71afecdec8744c4f73a


--

___
Python tracker 

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



[issue45876] Improve accuracy of stdev functions in statistics

2021-11-25 Thread Tim Peters


Tim Peters  added the comment:

Note that, on Windows, ldexp() in the presence of denorms can truncate. 
Division rounds, so

assert x / 2**i == ldexp(x, -i)

can fail.

>>> import math
>>> d = math.nextafter(0.0, 1.0)
>>> d
5e-324
>>> d3 = 7 * d # ....0111
>>> d3
3.5e-323
>>> d3 / 4.0   # rounds
1e-323
>>> math.ldexp(d3, -2)  # truncates
5e-324

or, perhaps more dramatically,

>>> d3 / 8.0, math.ldexp(d3, -3)
(5e-324, 0.0)

--

___
Python tracker 

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



[issue23882] unittest discovery doesn't detect namespace packages when given no parameters

2021-11-25 Thread Inada Naoki


Change by Inada Naoki :


--
versions: +Python 3.11 -Python 3.10, Python 3.8, Python 3.9

___
Python tracker 

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



[issue44353] PEP 604 NewType

2021-11-25 Thread Alex Waygood


Change by Alex Waygood :


--
nosy: +AlexWaygood
nosy_count: 12.0 -> 13.0
pull_requests: +28022
pull_request: https://github.com/python/cpython/pull/29785

___
Python tracker 

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



[issue45876] Improve accuracy of stdev functions in statistics

2021-11-25 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

Mark, would it preferable to use ldexp() to build the float?

+   return math.ldexp(isqrt_frac_rto(n << -2 * q, m), q)
-   return isqrt_frac_rto(n << -2 * q, m) / (1 << -q)

--

___
Python tracker 

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



RE: pyinstaller wrong classified as Windows virus

2021-11-25 Thread Avi Gross via Python-list
I am not sure what your real problem is, Ulli, but many antivirus programs
can be TEMPORARILY shut off. Not highly recommended, of course, but if you
properly disable it on a newly rebooted system running little, and it still
happens, then something else may be going on.

If one recognizes your code a potentially having a virus, it may be for an
assortment of reasons such as a table it contains to look at position N in
the executable for an exact match with some bit-string. If so, one potential
fix is a slight change in the code that compiles a bit differently like
x=sin(30) or other filler. 

But consider another possibility that your compiler software is compromised
and actually placing something into everything it compiles. Is this
happening to only one set of code?

You can think of other similar experiments based on your setup that may help
you debug and perhaps your problem is something else entirely.


-Original Message-
From: Python-list  On
Behalf Of Ulli Horlacher
Sent: Thursday, November 25, 2021 12:10 PM
To: python-list@python.org
Subject: Re: pyinstaller wrong classified as Windows virus

Chris Angelico  wrote:

> Unfortunately, if you're not going to go to the effort of getting your 
> executables signed

I cannot sign my executables (how can I do it anyway?), because Windows
deletes my executable as soon as I have compiled them! They exist only for a
few seconds and then they are gone.


> another reason to just distribute .py files.

I cannot do that because my users do not have Python installed and they are
not allowed to do it.

-- 
Ullrich Horlacher  Server und Virtualisierung
Rechenzentrum TIK 
Universitaet Stuttgart E-Mail: horlac...@tik.uni-stuttgart.de
Allmandring 30aTel:++49-711-68565868
70569 Stuttgart (Germany)  WWW:http://www.tik.uni-stuttgart.de/
--
https://mail.python.org/mailman/listinfo/python-list

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


Re: Eventfd with epoll BlockingIOError

2021-11-25 Thread Jen via Python-list
Thanks very much for your reply.  

I am now getting a single event returned in Python, but it's not the right 
event, as I'll explain below. 

I rearranged the Python code based on your comments:

#!/usr/bin/python3
import sys
import os
import select

print("Inside Python")

event_fd = int(sys.argv[3])

print("Eventfd received by Python")
print(event_fd)

event_write_value = 100

ep = select.epoll(-1)
ep.register(event_fd, select.EPOLLIN | select.EPOLLOUT )

os.set_blocking(event_fd, False)

#__

print("Starting poll loop")

for fd_event in ep.poll():
    print("Python fd_event")
    print(fd_event)
    fd_received = fd_event[0]
    event_received = fd_event[1]

You advised to leave off select.EPOLLOUT from the line ep.register(event_fd, 
select.EPOLLIN | select.EPOLLOUT ) -- which makes sense because I'm not waiting 
for that event -- but without it both processes freeze in the for loop (below 
print("Starting poll loop")) so we never receive an EPOLLIN event.  So I 
included it, and here is the screen output from gdb:

Inside Python
Eventfd received by Python
5
Everything OK in Python
Starting poll loop
Python fd_event
(5, 4)
Writing to Python
5 Received from Python
8 Writing to Python
Failed epoll_wait Bad file descriptor
5 Received from Python
8 Writing to Python
Failed epoll_wait Bad file descriptor
5 Received from Python
-1time taken 0.000629
Failed to close epoll file descriptor
Unlink_shm status: Bad file descriptor
fn() took 0.000717 seconds to execute
[Inferior 1 (process 26718) exited normally]
(gdb) q

The Python fd_event tuple is 5, 4 -- 5 is the correct file descriptor and 4 is 
an EPOLLOUT event, which is not what I want. 

The eventfd is created in C as nonblocking:

int eventfd_initialize() {
  int efd = eventfd(0, EFD_NONBLOCK);
  return efd; }

When C writes it calls epoll_wait:

ssize_t epoll_write(int event_fd, int epoll_fd, struct epoll_event * 
event_struc, int action_code)
{
   int64_t ewbuf[1];
   ewbuf[0] = (int64_t)action_code;
   int maxevents = 1;
   int timeout = -1;

   fprintf(stdout, " Writing to Python \n%d", event_fd);

    write(event_fd, , 8);

    if (epoll_wait(epoll_fd, event_struc, maxevents, timeout) == -1)
    {
    fprintf(stderr, "Failed epoll_wait %s\n", strerror(errno));
    }

    ssize_t rdval = read(event_fd, , 8);   

    fprintf(stdout, " Received from Python \n%ld", rdval);

    return 0;
}

The C side initializes its epoll this way:

int epoll_initialize(int efd, int64_t * output_array)
{
  struct epoll_event ev = {};
  int epoll_fd = epoll_create1(0);

  struct epoll_event * ptr_ev = 
  
  if(epoll_fd == -1)
  {
    fprintf(stderr, "Failed to create epoll file descriptor\n");
    return 1;
  }

  ev.events = EPOLLIN | EPOLLOUT;
  ev.data.fd = efd; //was 0

  if(epoll_ctl(epoll_fd, EPOLL_CTL_ADD, efd, ) == -1)
  {
  fprintf(stderr, "Failed to add file descriptor to epoll\n");
  close(epoll_fd);
  return 1;
  }

  output_array[0] = epoll_fd;
  output_array[1] = (int64_t)ptr_ev; //

  return 0;
}

Technically C is not waiting for an EPOLLIN event, but again without it both 
processes freeze unless either C or Python includes both events.  So that 
appears to be where the problem is. 

The Linux epoll man page says, "epoll_wait waits for I/O events, blocking the 
calling thread if no events are currently available."   
https://man7.org/linux/man-pages/man7/epoll.7.html.  That may be the clue to 
why both processes freeze when I poll on only one event in each one. 

Thanks for any ideas based on this update, and thanks again for your earlier 
reply. 

Jen


-- 
 Sent with Tutanota, the secure & ad-free mailbox. 



Nov 25, 2021, 06:34 by ba...@barrys-emacs.org:

>
>
>
>> On 24 Nov 2021, at 22:42, Jen via Python-list <>> python-list@python.org>> > 
>> wrote:
>>
>> I have a C program that uses fork-execv to run Python 3.10 in a child 
>> process, and I am using eventfd with epoll for IPC between them.  The 
>> eventfd file descriptor is created in C and passed to Python through execv.  
>> Once the Python child process starts I print the file descriptor to verify 
>> that it is correct (it is).  
>>
>> In this scenario C will write to the eventfd at intervals and Python will 
>> read the eventfd and take action based on the value in the eventfd.  But in 
>> the Python while True loop I get "BlockingIOError: [Errno 11] Resource 
>> temporarily unavailable" then with each new read it prints "Failed 
>> epoll_wait Bad file descriptor." 
>>
>> This is the Python code:
>>
>> #!/usr/bin/python3
>> import sys
>> import os
>> import select
>>
>> print("Inside Python")
>>
>> event_fd = int(sys.argv[3])
>>
>>
>> print("Eventfd received by Python")
>> print(event_fd)
>>
>> ep = select.epoll(-1)
>> ep.register(event_fd, select.EPOLLIN | select.EPOLLOUT)
>>
>
> This says tell me if I can read or write to the event_fd.
> write will be allowed until the kernel buffers are full.
>
> Usually you only add EPOLLOUT if you have data to write.
> In this 

[issue33393] update config.guess and config.sub

2021-11-25 Thread Christian Heimes


Change by Christian Heimes :


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



[issue33393] update config.guess and config.sub

2021-11-25 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 3f565f8edf84cfe8fa3e9cbf5da7c5911acaa6f9 by Christian Heimes in 
branch '3.10':
[3.10] bpo-33393: Update config.guess and config.sub (GH-29781) (GH-29782)
https://github.com/python/cpython/commit/3f565f8edf84cfe8fa3e9cbf5da7c5911acaa6f9


--

___
Python tracker 

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



[issue33393] update config.guess and config.sub

2021-11-25 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset b5249349845c21a07e13888aa12c5b86c0f06c31 by Christian Heimes in 
branch '3.9':
[3.9] bpo-33393: Update config.guess and config.sub (GH-29781) (GH-29783)
https://github.com/python/cpython/commit/b5249349845c21a07e13888aa12c5b86c0f06c31


--

___
Python tracker 

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



[issue40280] Consider supporting emscripten/webassembly as a build target

2021-11-25 Thread Christian Heimes


Christian Heimes  added the comment:

https://github.com/emscripten-core/emscripten/issues/13393

--

___
Python tracker 

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



[issue40280] Consider supporting emscripten/webassembly as a build target

2021-11-25 Thread Christian Heimes


Christian Heimes  added the comment:

I have uploaded my config.site override to 
https://gist.github.com/tiran/5ccffa28723d3e4739db848451bd9efa . It contains 
overrides based on pyodide and overrides for new features.

I'm also getting this error with emscripten 2.0.13. _sys_shutdown is the 
syscall for shutdown(2) used by the socket module.

error: undefined symbol: __sys_shutdown (referenced by top-level compiled C/C++ 
code)
warning: Link with `-s LLD_REPORT_UNDEFINED` to get more information on 
undefined symbols
warning: To disable errors for undefined symbols use `-s 
ERROR_ON_UNDEFINED_SYMBOLS=0`
warning: ___sys_shutdown may need to be added to EXPORTED_FUNCTIONS if it 
arrives from a system library
Error: Aborting compilation due to previous errors

--

___
Python tracker 

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



Re: pyinstaller wrong classified as Windows virus

2021-11-25 Thread Chris Angelico
On Fri, Nov 26, 2021 at 7:53 AM Mats Wichmann  wrote:
>
> On 11/25/21 11:00, Chris Angelico wrote:
>
> > Can someone confirm that it's still possible to run the Python
> > installer without admin rights, for a per-user installation? It always
> > used to be possible, but I haven't checked.
>
> You only need admin rights for some special cases.  While Win7 was still
> supported, you needed to run the (included) installer for vcredist of a
> different version than the one that comes with Win7, and that needed
> admin rights (unfortunately, the Python installer didn't prompt for that
> and so the vcredist install failed silently, leaving a broken install if
> you didn't already have it from other means - but that's all in the past
> now).  It's possible you also need it for the Python Launcher, since
> that goes into a "system location" (not sure about that one).  And if
> you asked for an install for "all users" that requires admin rights.

That's what I thought, yeah. So even on a system you don't own, where
you're not allowed to get admin privileges, it should still be
possible to install Python just fine.

Would be worth testing (if someone has a fresh Windows system around)
to see if it's possible to set up the "double click on .py file to run
it" association without admin privileges. That's the only part that
might be a limitation.

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


[issue40280] Consider supporting emscripten/webassembly as a build target

2021-11-25 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +28021
pull_request: https://github.com/python/cpython/pull/29784

___
Python tracker 

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



Re: pyinstaller wrong classified as Windows virus

2021-11-25 Thread Mats Wichmann

On 11/25/21 11:00, Chris Angelico wrote:


Can someone confirm that it's still possible to run the Python
installer without admin rights, for a per-user installation? It always
used to be possible, but I haven't checked.


You only need admin rights for some special cases.  While Win7 was still 
supported, you needed to run the (included) installer for vcredist of a 
different version than the one that comes with Win7, and that needed 
admin rights (unfortunately, the Python installer didn't prompt for that 
and so the vcredist install failed silently, leaving a broken install if 
you didn't already have it from other means - but that's all in the past 
now).  It's possible you also need it for the Python Launcher, since 
that goes into a "system location" (not sure about that one).  And if 
you asked for an install for "all users" that requires admin rights.

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


[issue43137] webbrowser to support "gio open "

2021-11-25 Thread miss-islington


miss-islington  added the comment:


New changeset 97dcab783279444ff721a301e1faca6f29fdc600 by Simon McVittie in 
branch 'main':
bpo-43137: webbrowser: Replace gvfs-open and gnome-open with "gio open" 
(GH-29154)
https://github.com/python/cpython/commit/97dcab783279444ff721a301e1faca6f29fdc600


--
nosy: +miss-islington

___
Python tracker 

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



Re: pyinstaller wrong classified as Windows virus

2021-11-25 Thread Michael Torrie
On 11/25/21 9:08 AM, Ulli Horlacher wrote:

> I cannot submit my executables, because the Windows Virus scannners
> deletes them as soon as I compile my program!

I forgot to post this link:
https://support.microsoft.com/en-us/windows/add-an-exclusion-to-windows-security-811816c0-4dfd-af4a-47e4-c301afe13b26
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: pyinstaller wrong classified as Windows virus

2021-11-25 Thread Michael Torrie
On 11/25/21 9:08 AM, Ulli Horlacher wrote:
> I cannot submit my executables, because the Windows Virus scannners
> deletes them as soon as I compile my program!

Add an exclusion rule to your machine. While this is not an option for
your end users, this will certainly allow you to work on the problem,
submitting the exe to the various virus vendors.

> And I need a Microsoft login to submit a file!
> I do not have such a login.

I sympathize.  But if you want to develop for Windows, you might just
have to get one.

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


[issue40280] Consider supporting emscripten/webassembly as a build target

2021-11-25 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 1052a39b7603e4d8401a5987af0c36f4a1d0b1e4 by Christian Heimes in 
branch 'main':
bpo-40280: Add wasm cross build targets (GH-29771)
https://github.com/python/cpython/commit/1052a39b7603e4d8401a5987af0c36f4a1d0b1e4


--

___
Python tracker 

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



[issue33393] update config.guess and config.sub

2021-11-25 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +28020
pull_request: https://github.com/python/cpython/pull/29783

___
Python tracker 

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



[issue33393] update config.guess and config.sub

2021-11-25 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +28019
pull_request: https://github.com/python/cpython/pull/29782

___
Python tracker 

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



[issue33393] update config.guess and config.sub

2021-11-25 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset dfcc6ff36f8bedae420fe228312527ec3937c973 by Christian Heimes in 
branch 'main':
bpo-33393: Update config.guess and config.sub (GH-29781)
https://github.com/python/cpython/commit/dfcc6ff36f8bedae420fe228312527ec3937c973


--

___
Python tracker 

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



[issue45881] Cross compiling on Linux is untested, undocumented, and broken

2021-11-25 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset cd6d2577fadc4cc0275017f27f46b0a628216353 by Christian Heimes in 
branch '3.9':
[3.9] bpo-45881: Use CC from env first for cross building (GH-29752) (GH-29754)
https://github.com/python/cpython/commit/cd6d2577fadc4cc0275017f27f46b0a628216353


--

___
Python tracker 

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



[issue40280] Consider supporting emscripten/webassembly as a build target

2021-11-25 Thread Christian Heimes


Christian Heimes  added the comment:

Our config.sub agrees with LLVM:

$ ./config.sub wasm32-wasi
wasm32-unknown-wasi

The config.sub and config.guess scripts in main are recent enough for wasm. 
Just to be sure I created https://github.com/python/cpython/pull/29781 and plan 
to backport the changeset to 3.10 and 3.9. It's generally safe to update the 
files to latest version.

--

___
Python tracker 

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



[issue33393] update config.guess and config.sub

2021-11-25 Thread Christian Heimes


Change by Christian Heimes :


--
nosy: +christian.heimes
nosy_count: 3.0 -> 4.0
pull_requests: +28018
pull_request: https://github.com/python/cpython/pull/29781

___
Python tracker 

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



[issue40280] Consider supporting emscripten/webassembly as a build target

2021-11-25 Thread Brett Cannon


Brett Cannon  added the comment:

To help keep links up-to-date, Pyodide now lives at:

https://github.com/pyodide/pyodide/tree/main/cpython

--

___
Python tracker 

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



[issue40280] Consider supporting emscripten/webassembly as a build target

2021-11-25 Thread Brett Cannon


Brett Cannon  added the comment:

Do we need to care about our `config.guess` being updated as well? This is a 
totally ignorant question based on 
https://github.com/WebAssembly/wasi-sdk#notes-for-autoconf mentioning 
`config.guess`.

--

___
Python tracker 

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



[issue40280] Consider supporting emscripten/webassembly as a build target

2021-11-25 Thread Brett Cannon


Brett Cannon  added the comment:

My last message had a couple of typos; should have been `wasm32-wasi` and 
"Discord", not "Discovery".

--

___
Python tracker 

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



[issue40280] Consider supporting emscripten/webassembly as a build target

2021-11-25 Thread Brett Cannon


Brett Cannon  added the comment:

LLVM considers `was32-wasi` an alias for `wasm32-unknown-wasi`. Verified on the 
WebAssembly Discover server at 
https://discord.com/channels/453584038356058112/596492540388179976/898618010221310062.

--

___
Python tracker 

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



[issue41498] Undefinied _Py_Sigset_Converter function when HAVE_SIGSET_T not set

2021-11-25 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



Re: pyinstaller wrong classified as Windows virus

2021-11-25 Thread Chris Angelico
On Fri, Nov 26, 2021 at 4:50 AM Richard Damon  wrote:
>
> On 11/25/21 12:21 PM, Chris Angelico wrote:
> > On Fri, Nov 26, 2021 at 4:18 AM Ulli Horlacher
> >  wrote:
> >> Chris Angelico  wrote:
> >>
> >>> Unfortunately, if you're not going to go to the effort of getting your
> >>> executables signed
> >> I cannot sign my executables (how can I do it anyway?), because Windows
> >> deletes my executable as soon as I have compiled them! They exist only
> >> for a few seconds and then they are gone.
> >>
> >>
> >>> another reason to just distribute .py files.
> >> I cannot do that because my users do not have Python installed and they
> >> are not allowed to do it.
> >>
> > Are they really allowed to install your unsigned executables but are
> > not allowed to install Python from a known and trusted source?
> >
> > If there's some bizarre loophole that allows them to run completely
> > untrusted binary code, but not to run legitimate code that can be
> > fetched from a variety of trusted places (including python.org, the
> > Windows store, etc), then I'm afraid you're on your own, and will
> > probably need to play around with the exact loophole to figure out
> > what is going to be permitted.
> >
> > Alternatively, just go find the person who decides what gets
> > installed, and request a Python interpreter to be added to the
> > permitted list. That's probably easier, and it's certainly going to be
> > better long-term.
> >
> > ChrisA
>
> My first guess is it isn't so much what is 'allowed' but what can be
> easily done.
>
> On a somewhat locked down computer, the user does not have admin rights,
> so needs to get 'IT' to run any installers that need admin permissions
> to run.

Can someone confirm that it's still possible to run the Python
installer without admin rights, for a per-user installation? It always
used to be possible, but I haven't checked.

> Likely, just copying an EXE file from an outside source may still be
> against the rules (and needs approval), but some think if they can do it
> and no one complains, it must be ok. On the other hand, they may have
> given approval, knowing the source.

Maybe. I would still consider it unlikely that you can run an EXE from
an arbitrary source, but can't run a trusted installer from a known
source. You're right that admin perms would be harder, but that
shouldn't stop you from installing Python.

Also, obligatory XKCD: https://xkcd.com/1200/

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


Re: pyinstaller wrong classified as Windows virus

2021-11-25 Thread Richard Damon

On 11/25/21 12:21 PM, Chris Angelico wrote:

On Fri, Nov 26, 2021 at 4:18 AM Ulli Horlacher
 wrote:

Chris Angelico  wrote:


Unfortunately, if you're not going to go to the effort of getting your
executables signed

I cannot sign my executables (how can I do it anyway?), because Windows
deletes my executable as soon as I have compiled them! They exist only
for a few seconds and then they are gone.



another reason to just distribute .py files.

I cannot do that because my users do not have Python installed and they
are not allowed to do it.


Are they really allowed to install your unsigned executables but are
not allowed to install Python from a known and trusted source?

If there's some bizarre loophole that allows them to run completely
untrusted binary code, but not to run legitimate code that can be
fetched from a variety of trusted places (including python.org, the
Windows store, etc), then I'm afraid you're on your own, and will
probably need to play around with the exact loophole to figure out
what is going to be permitted.

Alternatively, just go find the person who decides what gets
installed, and request a Python interpreter to be added to the
permitted list. That's probably easier, and it's certainly going to be
better long-term.

ChrisA


My first guess is it isn't so much what is 'allowed' but what can be 
easily done.


On a somewhat locked down computer, the user does not have admin rights, 
so needs to get 'IT' to run any installers that need admin permissions 
to run.


And EXE that just needs to be copied to the computer and rhen just RUN, 
doesn't need IT to 'install' it (they just can't put it into Program 
Files, but that isn't really that important for programs that don't need 
an installer.


Likely, just copying an EXE file from an outside source may still be 
against the rules (and needs approval), but some think if they can do it 
and no one complains, it must be ok. On the other hand, they may have 
given approval, knowing the source.


--
Richard Damon

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


[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-11-25 Thread Irit Katriel


Change by Irit Katriel :


--
pull_requests: +28017
pull_request: https://github.com/python/cpython/pull/29780

___
Python tracker 

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



Re: pyinstaller wrong classified as Windows virus

2021-11-25 Thread Barry


> On 25 Nov 2021, at 16:51, Ulli Horlacher  
> wrote:
> 
> Barry Scott  wrote:
>> 
>> 
 On 25 Nov 2021, at 09:20, Ulli Horlacher  
 wrote:
>>> 
>>> When I compile my programs with pyinstaller, Windows classifies them as
>>> virus and even deletes them!
>> 
>> Microsoft will fix the malware detection if you provide the info they need.
>> 
>> Submit false positive info to: 
>> https://www.microsoft.com/security/portal/submission/submit.aspx 
>> 
> 
> I cannot submit my executables, because the Windows Virus scannners
> deletes them as soon as I compile my program!

You should be able to tell the software to quarantine instead of delete.
Or even disable while you build one instance.
I am assuming you have admin control.

> And I need a Microsoft login to submit a file!
> I do not have such a login.
It’s free to get an account. How badly do you want to fix this?

> 
> 
> -- 
> Ullrich Horlacher  Server und Virtualisierung
> Rechenzentrum TIK 
> Universitaet Stuttgart E-Mail: horlac...@tik.uni-stuttgart.de
> Allmandring 30aTel:++49-711-68565868
> 70569 Stuttgart (Germany)  WWW:http://www.tik.uni-stuttgart.de/
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

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


[issue45568] @asynccontextmanager is missing in decorator usage example

2021-11-25 Thread Andrew Svetlov


Change by Andrew Svetlov :


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



[issue45568] @asynccontextmanager is missing in decorator usage example

2021-11-25 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
versions: +Python 3.11

___
Python tracker 

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



Re: pyinstaller wrong classified as Windows virus

2021-11-25 Thread Chris Angelico
On Fri, Nov 26, 2021 at 4:18 AM Ulli Horlacher
 wrote:
>
> Chris Angelico  wrote:
>
> > Unfortunately, if you're not going to go to the effort of getting your
> > executables signed
>
> I cannot sign my executables (how can I do it anyway?), because Windows
> deletes my executable as soon as I have compiled them! They exist only
> for a few seconds and then they are gone.
>
>
> > another reason to just distribute .py files.
>
> I cannot do that because my users do not have Python installed and they
> are not allowed to do it.
>

Are they really allowed to install your unsigned executables but are
not allowed to install Python from a known and trusted source?

If there's some bizarre loophole that allows them to run completely
untrusted binary code, but not to run legitimate code that can be
fetched from a variety of trusted places (including python.org, the
Windows store, etc), then I'm afraid you're on your own, and will
probably need to play around with the exact loophole to figure out
what is going to be permitted.

Alternatively, just go find the person who decides what gets
installed, and request a Python interpreter to be added to the
permitted list. That's probably easier, and it's certainly going to be
better long-term.

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


[issue45568] @asynccontextmanager is missing in decorator usage example

2021-11-25 Thread Andrew Svetlov


Andrew Svetlov  added the comment:


New changeset 52d10f6485a168141e7a50d68f9a9566fdd8379d by Andrew Svetlov in 
branch '3.10':
[3.10] bpo-45568: Actually use @asynccontextmanager in usage example (GH-29151) 
(GH-29779)
https://github.com/python/cpython/commit/52d10f6485a168141e7a50d68f9a9566fdd8379d


--

___
Python tracker 

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



Re: pyinstaller wrong classified as Windows virus

2021-11-25 Thread Ulli Horlacher
Chris Angelico  wrote:

> Unfortunately, if you're not going to go to the effort of getting your
> executables signed

I cannot sign my executables (how can I do it anyway?), because Windows
deletes my executable as soon as I have compiled them! They exist only
for a few seconds and then they are gone.


> another reason to just distribute .py files.

I cannot do that because my users do not have Python installed and they
are not allowed to do it.

-- 
Ullrich Horlacher  Server und Virtualisierung
Rechenzentrum TIK 
Universitaet Stuttgart E-Mail: horlac...@tik.uni-stuttgart.de
Allmandring 30aTel:++49-711-68565868
70569 Stuttgart (Germany)  WWW:http://www.tik.uni-stuttgart.de/
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue45900] Type annotations needed for convenience functions in ipaddress module

2021-11-25 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

Typing for stdlib is provided by https://github.com/python/typeshed
CPython policy discourages embedded typing declarations.

--
nosy: +asvetlov
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue45299] SMTP.send_message() does from mangling when it should not

2021-11-25 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Grant: sounds good! I can do the initial PR review. Note that the PR will need 
a test and a news entry. See the link below on authoring PRs:

https://devguide.python.org/pullrequest/

--

___
Python tracker 

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



Re: pyinstaller wrong classified as Windows virus

2021-11-25 Thread Chris Angelico
On Fri, Nov 26, 2021 at 3:49 AM Ulli Horlacher
 wrote:
>
> Ulli Horlacher  wrote:
> > Dan Purgert  wrote:
> >
> > > > When I compile my programs with pyinstaller, Windows classifies them as
> > > > virus and even deletes them!
> > > > [...]
> > >
> > > Have you tried compiling from a different machine? Maybe there's
> > > something broken on the one that's flagging them.
> >
> > I have only this Windows installation.
> >
> > But meanwhile I can compile my program and Windows does not complain any
> > more about Viruses, though I have not changed anything in my source code!
>
> And now the bad virus reports are back. With the SAME sourcecode!
> It is totally erratic.
>

Your Python source code is only a very small part of the code.
Unfortunately, if you're not going to go to the effort of getting your
executables signed and added to the full ecosystem, this sort of
hassle is going to be eternal. It's yet another way that turning
Python scripts into executables is a ridiculous amount of hassle. Yet
another reason to just distribute .py files.

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


[issue45568] @asynccontextmanager is missing in decorator usage example

2021-11-25 Thread Andrew Svetlov


Change by Andrew Svetlov :


--
nosy: +asvetlov
nosy_count: 3.0 -> 4.0
pull_requests: +28016
pull_request: https://github.com/python/cpython/pull/29779

___
Python tracker 

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



Re: pyinstaller wrong classified as Windows virus

2021-11-25 Thread Ulli Horlacher
Barry Scott  wrote:
> 
> 
> > On 25 Nov 2021, at 09:20, Ulli Horlacher  
> > wrote:
> > 
> > When I compile my programs with pyinstaller, Windows classifies them as
> > virus and even deletes them!
> 
> Microsoft will fix the malware detection if you provide the info they need.
> 
> Submit false positive info to: 
> https://www.microsoft.com/security/portal/submission/submit.aspx 
> 

I cannot submit my executables, because the Windows Virus scannners
deletes them as soon as I compile my program!

And I need a Microsoft login to submit a file!
I do not have such a login.


-- 
Ullrich Horlacher  Server und Virtualisierung
Rechenzentrum TIK 
Universitaet Stuttgart E-Mail: horlac...@tik.uni-stuttgart.de
Allmandring 30aTel:++49-711-68565868
70569 Stuttgart (Germany)  WWW:http://www.tik.uni-stuttgart.de/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: pyinstaller wrong classified as Windows virus

2021-11-25 Thread Ulli Horlacher
Ulli Horlacher  wrote:
> Dan Purgert  wrote:
> 
> > > When I compile my programs with pyinstaller, Windows classifies them as
> > > virus and even deletes them!
> > > [...]
> > 
> > Have you tried compiling from a different machine? Maybe there's
> > something broken on the one that's flagging them. 
> 
> I have only this Windows installation.
> 
> But meanwhile I can compile my program and Windows does not complain any
> more about Viruses, though I have not changed anything in my source code!

And now the bad virus reports are back. With the SAME sourcecode!
It is totally erratic.

-- 
Ullrich Horlacher  Server und Virtualisierung
Rechenzentrum TIK 
Universitaet Stuttgart E-Mail: horlac...@tik.uni-stuttgart.de
Allmandring 30aTel:++49-711-68565868
70569 Stuttgart (Germany)  WWW:http://www.tik.uni-stuttgart.de/
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue45299] SMTP.send_message() does from mangling when it should not

2021-11-25 Thread Grant Edwards


Grant Edwards  added the comment:

Yes, passing the mangle_from value to BytesGenerator seems like the safest fix. 
It's unfortunate that BytesGenerator defaults to doing "the wrong thing" in the 
absence of a policy argument, but there might be code that depends on it.

I've never done a PR before, but I could work on it next week.

--

___
Python tracker 

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



[issue45900] Type annotations needed for convenience functions in ipaddress module

2021-11-25 Thread William George


Change by William George :


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

___
Python tracker 

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



[issue45886] Fix Program/_freeze_module for cross compiling Python

2021-11-25 Thread Guido van Rossum

Guido van Rossum  added the comment:

Imthink I prefer the ‘make clean’ extension.--
--Guido (mobile)

--

___
Python tracker 

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



[issue45900] Type annotations needed for convenience functions in ipaddress module

2021-11-25 Thread William George


New submission from William George :

The convenience factory functions in the ipaddress module each return one of 
two types (IPv4Network vs IPv6Network, etc).  Modern code wants to be friendly 
to either stack, and these functions are great at enabling that, but current 
implementation blocks type inference for most (all?) IDEs.

Proposal is easy enough, specifying return type of e.g. `Union[IPv4Network, 
IPv6Network]` for these factory functions.  

I believe the rest of the public interface for this module is unambiguous 
enough that annotations aren't needed, but if others see value they could be 
added easily enough.

For some of these there exists a version-independent base class that could be 
referenced instead of a union, but it's not clear to me how well IDEs will 
actually honor such an annotation referencing an internal class 
(single-underscore).  My limited testing of that didn't work well and there's 
no such base class for the Interface classes anyway. 

PR for this incomming.

--
components: Library (Lib)
messages: 407005
nosy: pmoody, wrgeorge1983
priority: normal
severity: normal
status: open
title: Type annotations needed for convenience functions in ipaddress module
type: enhancement
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue45899] NameError on if clause of class-level list comprehension

2021-11-25 Thread Matthew Barnett


Matthew Barnett  added the comment:

It's not just in the 'if' clause:

>>> class Foo:
... a = ['a', 'b']
... b = ['b', 'c']
... c = [b for x in a]
...
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 4, in Foo
  File "", line 4, in 
NameError: name 'b' is not defined

--
nosy: +mrabarnett

___
Python tracker 

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



[issue45899] NameError on if clause of class-level list comprehension

2021-11-25 Thread Mark Dickinson

Mark Dickinson  added the comment:

This is expected behaviour. See the docs here: 
https://docs.python.org/3.9/reference/executionmodel.html#resolution-of-names

> The scope of names defined in a class block is limited to the class block; it 
> does not extend to the code blocks of methods – this includes comprehensions 
> and generator expressions since they are implemented using a function scope.

--
nosy: +mark.dickinson
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



[issue45899] NameError on if clause of class-level list comprehension

2021-11-25 Thread ThiefMaster


Change by ThiefMaster :


--
nosy: +ThiefMaster

___
Python tracker 

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



[issue45899] NameError on if clause of class-level list comprehension

2021-11-25 Thread jhpfjyne


New submission from jhpfjyne :

Accessing an attribute defined at class-level in the if clause of a list 
comprehension at class-level throws a NameError.

>>> class Foo:
... a = ['a', 'b']
... b = ['b', 'c']
... c = [x for x in a if x not in b]
...
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 4, in Foo
  File "", line 4, in 
NameError: name 'b' is not defined

--
components: Interpreter Core
messages: 407002
nosy: jhpfjyne
priority: normal
severity: normal
status: open
title: NameError on if clause of class-level list comprehension
type: behavior
versions: Python 3.10

___
Python tracker 

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



Re: pyinstaller wrong classified as Windows virus

2021-11-25 Thread Michael Torrie
On 11/25/21 2:20 AM, Ulli Horlacher wrote:
> When I compile my programs with pyinstaller, Windows classifies them as
> virus and even deletes them!
> 
> pyinstaller.exe --onefile --noconsole -i fex.ico fextasy.py
> 187 INFO: PyInstaller: 4.7
> 187 INFO: Python: 3.10.0
> 218 INFO: Platform: Windows-10-10.0.19041-SP0
> 218 INFO: wrote P:\W10\fextasy.spec
> (...)
> 14392 INFO: Copying 0 resources to EXE
> 14392 INFO: Emedding manifest in EXE
> 14392 INFO: Updating manifest in P:\W10\dist\fextasy.exe
> 14533 INFO: Updating resource type 24 name 1 language 0
> 14579 INFO: Appending PKG archive to EXE
> 18836 INFO: Building EXE from EXE-00.toc completed successfully.
> 
> https://fex.flupp.org/fop/ylds7Y9d/X-20211125101112.png
> 
> What can I do?

False positive virus detection is pretty common with pyinstaller from
what I can see on the Googles.  It's actually very common problem with
less-popular compilers and languages too. Not sure what it is that trips
them all up.

Submit your exe to virustotal.com and then the only real solution is to
submit it to each major antivirus vendor as a false positive and hope
things get changed.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue43656] TracebackException or StackSummary.extract with capture_locals=True fail to catch exceptions raised by repr() on value of frame local variable in FrameSummary.__init__.

2021-11-25 Thread Irit Katriel


Irit Katriel  added the comment:

Try the search function on the tracker (that's what I would need to do to find 
what to link).

--

___
Python tracker 

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



[issue45299] SMTP.send_message() does from mangling when it should not

2021-11-25 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

R. David: `mangle_from_` is the only exception; I agree it seems likely it was 
done this way for backwards compatibility.

Grant: do you agree with the fix to logic? Also do you agree that mangle_from_ 
is the only setting that's not being applied to msg generation from message 
policy? Would you like to work on the PR? If not, I can create the PR.

--

___
Python tracker 

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



[issue43656] TracebackException or StackSummary.extract with capture_locals=True fail to catch exceptions raised by repr() on value of frame local variable in FrameSummary.__init__.

2021-11-25 Thread Martin


Martin  added the comment:

Thanks for your definitive answer, this is what I was waiting for.

I understand and I totally agree that subclassing is the way to go to make 
traceback more flexible.

Would you mind linking the other issues concerning the general improvement of 
traceback?

--

___
Python tracker 

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



Re: pyinstaller wrong classified as Windows virus

2021-11-25 Thread Barry Scott



> On 25 Nov 2021, at 09:20, Ulli Horlacher  
> wrote:
> 
> When I compile my programs with pyinstaller, Windows classifies them as
> virus and even deletes them!

Microsoft will fix the malware detection if you provide the info they need.

Submit false positive info to: 
https://www.microsoft.com/security/portal/submission/submit.aspx 


I have done this for a false positive in the past and they do resolve the false 
positive.

Barry


> 
> pyinstaller.exe --onefile --noconsole -i fex.ico fextasy.py
> 187 INFO: PyInstaller: 4.7
> 187 INFO: Python: 3.10.0
> 218 INFO: Platform: Windows-10-10.0.19041-SP0
> 218 INFO: wrote P:\W10\fextasy.spec
> (...)
> 14392 INFO: Copying 0 resources to EXE
> 14392 INFO: Emedding manifest in EXE
> 14392 INFO: Updating manifest in P:\W10\dist\fextasy.exe
> 14533 INFO: Updating resource type 24 name 1 language 0
> 14579 INFO: Appending PKG archive to EXE
> 18836 INFO: Building EXE from EXE-00.toc completed successfully.
> 
> https://fex.flupp.org/fop/ylds7Y9d/X-20211125101112.png
> 
> What can I do?
> 
> Rebooting does not help :-}
> 
> -- 
> Ullrich Horlacher  Server und Virtualisierung
> Rechenzentrum TIK 
> Universitaet Stuttgart E-Mail: horlac...@tik.uni-stuttgart.de
> Allmandring 30aTel:++49-711-68565868
> 70569 Stuttgart (Germany)  WWW:http://www.tik.uni-stuttgart.de/
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

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


[issue43656] TracebackException or StackSummary.extract with capture_locals=True fail to catch exceptions raised by repr() on value of frame local variable in FrameSummary.__init__.

2021-11-25 Thread Irit Katriel

Irit Katriel  added the comment:

While I do think this module should be more customisable than it is, I think it 
should be done via support for subclassing rather than injecting functions that 
get forwarded on as you do here.

There are other issues on bpo related to customising this module, with more 
convincing use cases than suppressing errors. I think it’s more likely that a 
patch will be accepted which solves the general problem of this module being 
inflexible (while being backwards compatible).

The patch you propose here solves a small part of the problem while making the 
api clunkier and it commits us to supporting this new parameter when we try to 
solve the general problem.

--

___
Python tracker 

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



Re: Eventfd with epoll BlockingIOError

2021-11-25 Thread Barry Scott


> On 24 Nov 2021, at 22:42, Jen via Python-list  wrote:
> 
> I have a C program that uses fork-execv to run Python 3.10 in a child 
> process, and I am using eventfd with epoll for IPC between them.  The eventfd 
> file descriptor is created in C and passed to Python through execv.  Once the 
> Python child process starts I print the file descriptor to verify that it is 
> correct (it is).  
> 
> In this scenario C will write to the eventfd at intervals and Python will 
> read the eventfd and take action based on the value in the eventfd.  But in 
> the Python while True loop I get "BlockingIOError: [Errno 11] Resource 
> temporarily unavailable" then with each new read it prints "Failed epoll_wait 
> Bad file descriptor." 
> 
> This is the Python code:
> 
> #!/usr/bin/python3
> import sys
> import os
> import select
> 
> print("Inside Python")
> 
> event_fd = int(sys.argv[3])
> 
> print("Eventfd received by Python")
> print(event_fd)
> 
> ep = select.epoll(-1)
> ep.register(event_fd, select.EPOLLIN | select.EPOLLOUT)

This says tell me if I can read or write to the event_fd.
write will be allowed until the kernel buffers are full.

Usually you only add EPOLLOUT if you have data to write.
In this case do not set EPOLLOUT.

And if you know that you will never fill the kernel buffers then you
do not need to bother polling for write.

> 
> event_write_value = 100
> 
> while True:
> 
> print("Waiting in Python for event")
> ep.poll(timeout=None, maxevents=- 1)

You have to get the result of the poll() and process the list of entries that 
are returned.

You must check that POLLIN is set before attempting the read.


> v = os.eventfd_read(event_fd)

Will raise EWOULDBLOCK because there is no data available to read.

Here is the docs from python:

poll.poll([timeout]) 

Polls the set of registered file descriptors, and returns a possibly-empty list 
containing (fd, event) 2-tuples for the descriptors that have events or errors 
to report. fd is the file descriptor, and event is a bitmask with bits set for 
the reported events for that descriptor — POLLIN for waiting input, POLLOUT to 
indicate that the descriptor can be written to, and so forth. An empty list 
indicates that the call timed out and no file descriptors had any events to 
report. If timeout is given, it specifies the length of time in milliseconds 
which the system will wait for events before returning. If timeout is omitted, 
negative, or None 
,
 the call will block until there is an event for this poll object.

You end up with code like this:

for fd_event in ep.poll():
fd, event == fd_event
if (event) != 0 and fd == event_fd:
v = os.eventfd_read(event_fd)

> 
> if v != 99:
> print("found")
> print(v)
> os.eventfd_write(event_fd, event_write_value)
> 
> if v == 99:
> os.close(event_fd)
> 
> This is the C code that writes to Python, then waits for Python to write back:
> 
> ssize_t epoll_write(int event_fd, int epoll_fd, struct epoll_event * 
> event_struc, int action_code)
> {
>int64_t ewbuf[1];
>ewbuf[0] = (int64_t)action_code;
>int maxevents = 1;
>int timeout = -1;
> 
>fprintf(stdout, " Writing to Python \n%d", event_fd);
> 
>write(event_fd, , 8);
> 
> if (epoll_wait(epoll_fd, event_struc, maxevents, timeout) == -1)
> {
> fprintf(stderr, "Failed epoll_wait %s\n", strerror(errno));
> }
> 
> ssize_t rdval = read(event_fd, , 8);   
> 
> fprintf(stdout, " Received from Python \n%ld", rdval);
> 
> return 0;
> }
> 
> This is the screen output when I run with gdb:
> 
>   Inside Python
> Eventfd received by Python
> 5
> Waiting in Python for event
> Traceback (most recent call last):
>   File "/usr/local/lib/python3.10/runpy.py", line 196, in 
> _run_module_as_main
> return _run_code(code, main_globals, None,
>   File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
> exec(code, run_globals)
>   File "/opt/P01_SH/NPC_CPython.py", line 36, in 
> v = os.eventfd_read(event_fd)
> BlockingIOError: [Errno 11] Resource temporarily unavailable

Expected as there you have not checked that there is data to read.
Check for POLLIN being set.

> Writing to Python
> 5 Received from Python
> 8 Writing to Python
> Failed epoll_wait Bad file descriptor
> 5 Received from Python
> 8 Writing to Python
> Failed epoll_wait Bad file descriptor
> 5 Received from Python
> -1time taken 0.000548
> Failed to close epoll file descriptor
> Unlink_shm status: Bad file descriptor
> fn() took 0.000648 seconds to execute
> [Inferior 1 (process 12618) exited normally]
> (gdb)
> 
> So my question is why do I get "BlockingIOError: [Errno 11] Resource 
> temporarily unavailable" and "Failed epoll_wait Bad file descriptor" from 
> Python? 

If your protocol is not trivia you should implement a state machine to know 
what to do at each event.

Barry

> 
> -- 
> Sent with Tutanota, the secure & ad-free mailbox. 
> -- 

[issue43656] TracebackException or StackSummary.extract with capture_locals=True fail to catch exceptions raised by repr() on value of frame local variable in FrameSummary.__init__.

2021-11-25 Thread Martin


Martin  added the comment:

Irit, would you be able to take a look at the patch?

---

I found another application scenario for the patch: In Numpy and Pandas, the 
assert_* functions in testing have a __tracebackhide__ local that advises 
pytest to hide the frame. With the patch in place, we could at least not 
display any locals if __tracebackhide__ is present.

--

___
Python tracker 

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



Re: pyinstaller wrong classified as Windows virus

2021-11-25 Thread Dan Purgert
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

Ulli Horlacher wrote:
> When I compile my programs with pyinstaller, Windows classifies them as
> virus and even deletes them!
> [...]
> What can I do?

Stop writing viruses ;)

Have you tried compiling from a different machine? Maybe there's
something broken on the one that's flagging them. 

Alternatively, maybe run updates?

> Rebooting does not help :-}
If testing from a different machine works ... format and reinstall might
be the fastest fix for the affected machine.

-BEGIN PGP SIGNATURE-

iQIzBAEBCgAdFiEE3asj+xn6fYUcweBnbWVw5UznKGAFAmGfbS8ACgkQbWVw5Uzn
KGBvQA//YuSJChhmj5fXzkOHD5W+horNsyS3psmFjQzp/opeeF+tqfkeDNXyUwkb
+YxDgq7KDvpaUbaMiYtmzs0fZ6fLaWPHA6pJFS3+DS8Wu/EoPmHyfe6bw0OOFiBI
AB8Zr8Y7e1GntyE/HQ53+outTxDwpTStU+MTyqTjfMDRYl3NyYhnb0rbt0aTQWP0
LzYC6HM5g2EFTrfiAImuoJisu5aofw90QjJEqlRn+MQNcFm8bvAdXpWQ6fp0iNRx
IbXhb+HoL/WNy9sxeWoBRMrNY9wu1lgBDI8IPIu8m+rz13WgIX/l2CMbgxiXW3bN
WbKa4UZ1z7NB2sYhhJ9D0V4pUukFae2A9RaDV6aDC5Vm7ZNQ7eLuEsbjgXABP/qc
0OZODTUN/KYSlMa6E5azdxR5um4jQ85hcsKjtOr7UqwMurrzRL9KxSgsZVlj5FzY
vCxCw1aoqD8WBxunOLnwKd8Fonch0/Ov8a6IA1ZKxx3VbDlY3ZgVMpqYtjzw+wgH
hMD2Int0fJtiC+TBl18P7s47q5RlXbA7mCrjEXuJGdIbZ6K9SxMjWnWycCcVwNHC
LrAKWiA2xOSNcJzpXYN8U2TMsYZCLdLeuNyR5T8QLTvHokQTYuTba2M2EYraQt73
oWQsu47ws/IIAQ/EXOBGMcenhE3wTPHT/36a6udOAQktHzbqKGg=
=nm2S
-END PGP SIGNATURE-

-- 
|_|O|_| Github: https://github.com/dpurgert
|_|_|O| PGP: DDAB 23FB 19FA 7D85 1CC1  E067 6D65 70E5 4CE7 2860
|O|O|O| Former PGP: 05CA 9A50 3F2E 1335 4DC5  4AEE 8E11 DDF3 1279 A281
-- 
https://mail.python.org/mailman/listinfo/python-list


pyinstaller wrong classified as Windows virus

2021-11-25 Thread Ulli Horlacher
When I compile my programs with pyinstaller, Windows classifies them as
virus and even deletes them!

pyinstaller.exe --onefile --noconsole -i fex.ico fextasy.py
187 INFO: PyInstaller: 4.7
187 INFO: Python: 3.10.0
218 INFO: Platform: Windows-10-10.0.19041-SP0
218 INFO: wrote P:\W10\fextasy.spec
(...)
14392 INFO: Copying 0 resources to EXE
14392 INFO: Emedding manifest in EXE
14392 INFO: Updating manifest in P:\W10\dist\fextasy.exe
14533 INFO: Updating resource type 24 name 1 language 0
14579 INFO: Appending PKG archive to EXE
18836 INFO: Building EXE from EXE-00.toc completed successfully.

https://fex.flupp.org/fop/ylds7Y9d/X-20211125101112.png

What can I do?

Rebooting does not help :-}

-- 
Ullrich Horlacher  Server und Virtualisierung
Rechenzentrum TIK 
Universitaet Stuttgart E-Mail: horlac...@tik.uni-stuttgart.de
Allmandring 30aTel:++49-711-68565868
70569 Stuttgart (Germany)  WWW:http://www.tik.uni-stuttgart.de/
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: pyinstaller wrong classified as Windows virus

2021-11-25 Thread Ulli Horlacher
Dan Purgert  wrote:

> > When I compile my programs with pyinstaller, Windows classifies them as
> > virus and even deletes them!
> > [...]
> 
> Have you tried compiling from a different machine? Maybe there's
> something broken on the one that's flagging them. 

I have only this Windows installation.

But meanwhile I can compile my program and Windows does not complain any
more about Viruses, though I have not changed anything in my source code!


> Alternatively, maybe run updates?

I have done this before without any success (in respect to the wrong virus
report).

-- 
Ullrich Horlacher  Server und Virtualisierung
Rechenzentrum TIK 
Universitaet Stuttgart E-Mail: horlac...@tik.uni-stuttgart.de
Allmandring 30aTel:++49-711-68565868
70569 Stuttgart (Germany)  WWW:http://www.tik.uni-stuttgart.de/
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue45476] [C API] Disallow using PyFloat_AS_DOUBLE() as l-value

2021-11-25 Thread STINNER Victor


STINNER Victor  added the comment:

I decided to exclude macros which can be used as l-value from the PEP 670, 
since the motivation to disallow using them as l-value is different, and I 
prefer to restrict PEP 670 scope.

Disallowing using macros as l-value is more about hide implementation details 
and improving compatibility with Python implementations other than CPython, 
like PyPy or RustPython.

The PEP 670 is restricted to advantages and disavantages of converting macros 
to functions (static inline or regular functions).

--

___
Python tracker 

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



[issue45897] Frozen dataclasses with slots raise TypeError

2021-11-25 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think the error should be AttributeError, which is what you'd get if the 
class weren't frozen.

--

___
Python tracker 

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



[issue45866] Out of tree build of Python 3.11.0a2+ breaks regen-frozen

2021-11-25 Thread STINNER Victor


Change by STINNER Victor :


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

___
Python tracker 

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



[issue39026] Include/cpython/pystate.h contains non-relative of initconfig.h include causing macOS Framework include failure

2021-11-25 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +28013
pull_request: https://github.com/python/cpython/pull/29776

___
Python tracker 

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



[issue39026] Include/cpython/pystate.h contains non-relative of initconfig.h include causing macOS Framework include failure

2021-11-25 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ce5a6460aebdc51a810d2755782fe8f0d7918ec2 by Victor Stinner in 
branch '3.10':
bpo-39026: Fix Python.h when building with Xcode (GH-29488) (GH-29732)
https://github.com/python/cpython/commit/ce5a6460aebdc51a810d2755782fe8f0d7918ec2


--

___
Python tracker 

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



[issue45568] @asynccontextmanager is missing in decorator usage example

2021-11-25 Thread miss-islington


miss-islington  added the comment:


New changeset 4dd82194f4a0e48a94191655e571b3aad1c4a22a by Zbigniew Siciarz in 
branch 'main':
bpo-45568: Actually use @asynccontextmanager in usage example (GH-29151)
https://github.com/python/cpython/commit/4dd82194f4a0e48a94191655e571b3aad1c4a22a


--
nosy: +miss-islington

___
Python tracker 

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



[issue45759] Improve error messages for non-matching `elif`/`else` statements

2021-11-25 Thread theeshallnotknowethme


Change by theeshallnotknowethme :


--
pull_requests: +28012
pull_request: https://github.com/python/cpython/pull/29775

___
Python tracker 

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



[issue41498] Undefinied _Py_Sigset_Converter function when HAVE_SIGSET_T not set

2021-11-25 Thread Christian Heimes


Change by Christian Heimes :


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



[issue41498] Undefinied _Py_Sigset_Converter function when HAVE_SIGSET_T not set

2021-11-25 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset 71b414750eee7af98cc3cee3a64c59d48302a17a by Christian Heimes in 
branch '3.9':
[3.9] bpo-41498: Fix build on platforms without sigset_t (GH-29770) (GH-29774)
https://github.com/python/cpython/commit/71b414750eee7af98cc3cee3a64c59d48302a17a


--

___
Python tracker 

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



[issue45898] ctypes cfield.c defines duplicate ffi_type_* symbols

2021-11-25 Thread Christian Heimes


New submission from Christian Heimes :

ctypes's cfield.c redefines a couple of symbols like ffi_type_void and others. 
The symbols are exported by ffi.h and libffi for more than 12 years: 
https://github.com/libffi/libffi/blame/e1539266e6c6dde3c99832323586f33f977d1dc0/include/ffi.h.in#L184

I think we can safely remove the symbols from the file. The idea is inspired by 
pyodide patch 
https://github.com/pyodide/pyodide/blob/main/cpython/patches/remove-duplicate-symbols-from-cfield.c.patch

--
components: ctypes
messages: 406991
nosy: christian.heimes
priority: normal
severity: normal
status: open
title: ctypes cfield.c defines duplicate ffi_type_* symbols
type: behavior
versions: Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue41498] Undefinied _Py_Sigset_Converter function when HAVE_SIGSET_T not set

2021-11-25 Thread miss-islington


miss-islington  added the comment:


New changeset 632d589afcaac3b8441c8c042a98e1ae452533e0 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-41498: Fix build on platforms without sigset_t (GH-29770) (GH-29773)
https://github.com/python/cpython/commit/632d589afcaac3b8441c8c042a98e1ae452533e0


--

___
Python tracker 

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



[issue41498] Undefinied _Py_Sigset_Converter function when HAVE_SIGSET_T not set

2021-11-25 Thread Christian Heimes


Change by Christian Heimes :


--
pull_requests: +28011
pull_request: https://github.com/python/cpython/pull/29774

___
Python tracker 

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



[issue41498] Undefinied _Py_Sigset_Converter function when HAVE_SIGSET_T not set

2021-11-25 Thread Christian Heimes


Christian Heimes  added the comment:


New changeset dc19e8698327cae3d6274b73c135375955f1d0d0 by Christian Heimes in 
branch 'main':
bpo-41498: Fix build on platforms without sigset_t (GH-29770)
https://github.com/python/cpython/commit/dc19e8698327cae3d6274b73c135375955f1d0d0


--

___
Python tracker 

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



[issue41498] Undefinied _Py_Sigset_Converter function when HAVE_SIGSET_T not set

2021-11-25 Thread miss-islington


Change by miss-islington :


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

___
Python tracker 

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



[issue45886] Fix Program/_freeze_module for cross compiling Python

2021-11-25 Thread Christian Heimes


Christian Heimes  added the comment:

The FREEZE_MODULE trick fails with out-of-tree builds when SRCDIR contains the 
frozen_modules header files from a previous build. When doing OOT building, 
make includes the SRCDIR in the search path for dependencies (VPATH). It 
considers $(srcdir)/Python/frozen_modules/importlib._bootstrap_external.h as 
recent enough and therefore does not generate 
$(builddir)/Python/frozen_modules/importlib._bootstrap_external.h. The 
freeze_module program does not know about VPATH and looks up the file in the 
$(builddir) tree:

$ make 
FREEZE_MODULE=/cpython/builddep/ubuntu-impish-x86_64/Programs/_freeze_module
...
python3.9 ../../Tools/scripts/deepfreeze.py 
Python/frozen_modules/importlib._bootstrap_external.h -m 
importlib._bootstrap_external -o 
Python/deepfreeze/importlib._bootstrap_external.c
Traceback (most recent call last):
  File "/cpython/builddep/wasi/../../Tools/scripts/deepfreeze.py", line 463, in 

main()
  File "/cpython/builddep/wasi/../../Tools/scripts/deepfreeze.py", line 451, in 
main
with open(args.file, encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: 
'Python/frozen_modules/importlib._bootstrap_external.h'
make: *** [Makefile:1055: Python/deepfreeze/importlib._bootstrap_external.c] 
Error 1

$ make 
FREEZE_MODULE=/cpython/builddep/ubuntu-impish-x86_64/Programs/_freeze_module 
Python/frozen_modules/importlib._bootstrap_external.h  
make: '../../Python/frozen_modules/importlib._bootstrap_external.h' is up to 
date.


I see two possible solutions for the problem:

* extend ``make clean`` to also remove $(FROZEN_FILES_OUT). The make clean 
command is suppose to remove all files that interferes with OOT builds (see 
check-clean-src in Makefile.pre.in).
* prefix $(FROZEN_FILES_OUT) and their targets with $(abs_builddir) to avoid 
VPATH lookups. abs_builddir is the absolute path to the build directory.

--

___
Python tracker 

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



[issue45019] Freezing modules has manual steps but could be automated.

2021-11-25 Thread Oleg Iarygin


Oleg Iarygin  added the comment:

If a directory is renamed anyway, maybe `deepfrozen_modules` is better? 
`deepfreeze_modules` looks like "modules that are part of deepfreeze tool 
itself". Also it rhymes with `frozen_modules`.

--

___
Python tracker 

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



[issue45019] Freezing modules has manual steps but could be automated.

2021-11-25 Thread Kumar Aditya


Change by Kumar Aditya :


--
nosy: +kumaraditya303
nosy_count: 6.0 -> 7.0
pull_requests: +28009
pull_request: https://github.com/python/cpython/pull/29772

___
Python tracker 

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



[issue40280] Consider supporting emscripten/webassembly as a build target

2021-11-25 Thread Christian Heimes


Christian Heimes  added the comment:

Our config.sub is recent enough and has support for wasm32, wasm64, wasi, and 
emscripten:

$ grep was[mi] config.sub 
| wasm32 | wasm64 \
 | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \

--

___
Python tracker 

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



[issue40280] Consider supporting emscripten/webassembly as a build target

2021-11-25 Thread Christian Heimes


Christian Heimes  added the comment:

I have added wasm32/wasm64 architectures with emscripten/wasi operating system 
as cross-build targets. The values are based on Rust targets: 

$ rustc --print target-list | grep wasm
wasm32-unknown-emscripten
wasm32-unknown-unknown
wasm32-wasi
wasm64-unknown-unknown

wasm (WebAssembly) is "native instruction set" for the JavaScript VM while wasi 
or emscripten provide operating system facilities like memory management and 
I/O.

--
nosy: +brett.cannon
versions: +Python 3.11 -Python 3.9

___
Python tracker 

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



[issue40280] Consider supporting emscripten/webassembly as a build target

2021-11-25 Thread Christian Heimes


Change by Christian Heimes :


--
keywords: +patch
nosy: +christian.heimes
nosy_count: 7.0 -> 8.0
pull_requests: +28008
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29771

___
Python tracker 

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



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-11-25 Thread Irit Katriel


Irit Katriel  added the comment:

Following the analysis/discussion on 
https://github.com/faster-cpython/ideas/issues/106:

* exc_info is always normalized, so we actually will never need to create a 
tuple of these three values (exc_curinfo, the exception raised but not yet 
caught can be unnormalized, but it is not pushed/popped on the stack). 

* We will reduce the interpreter's exc_info representation to just the 
exception instance.

* There are two APIs that are impacted, both in non-documented edge cases:

1. sys.exc_info()[2] can currently be different from 
sys.exc_info()[1].__traceback__ because changes to the latter (while an except 
clause is executing) don't show up in the former. This is arguably a bug, we 
will change it so that the type and traceback are always consistent with the 
exception.

2. PyErr_SetExcInfo does no arg checking, and will set exc_info to an 
inconsistent triplet if you ask it to. However, the exc_value arg must be an 
exception instance so the only thing you can do is pass in nonsensical args 
where the type/traceback do not match the exception. This function's purpose is 
to save/restore exc_info. We will make it ignore the type and traceback and 
document that change.

--

___
Python tracker 

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



[issue45711] Simplify the interpreter's (type, val, tb) exception representation

2021-11-25 Thread Irit Katriel


Irit Katriel  added the comment:


New changeset c456dfafe9f9f6614fbcf2213a93707f0e101f4e by Irit Katriel in 
branch 'main':
bpo-45711: use exc_value instead of exc_type to determine if exc_info is valid. 
Add more assertions. (GH-29627)
https://github.com/python/cpython/commit/c456dfafe9f9f6614fbcf2213a93707f0e101f4e


--

___
Python tracker 

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



[issue45892] Improve REPL with the underscore separators for int/float

2021-11-25 Thread Alex


Alex  added the comment:

Thanks a lot Eric for your answers, I did not know about sys.displayhook.
Now I know I can easily implement this myself, but the larger question would 
be: "do we want to update the default displayhook for those simple use cases".

--

___
Python tracker 

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



[issue41498] Undefinied _Py_Sigset_Converter function when HAVE_SIGSET_T not set

2021-11-25 Thread Christian Heimes


Change by Christian Heimes :


--
keywords: +patch
nosy: +christian.heimes
nosy_count: 3.0 -> 4.0
pull_requests: +28007
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29770

___
Python tracker 

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



[issue1284670] Allow to restrict ModuleFinder to get "direct" dependencies

2021-11-25 Thread Irit Katriel


Irit Katriel  added the comment:

Mike, from looking at the code the change proposed here is not there, so while 
the patch may not apply cleanly anymore, the commits you mention do not make 
this issue irrelevant.

--
nosy: +iritkatriel

___
Python tracker 

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



[issue44133] Some C-API symbols (e.g. Py_FrozenMain) are not always exported

2021-11-25 Thread Jakub Kulik


Jakub Kulik  added the comment:

On Solaris (and most likely several other platforms), 
`PyThread_get_thread_native_id` is also not available.

--
nosy: +kulikjak

___
Python tracker 

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



Re: Eventfd with epoll BlockingIOError

2021-11-25 Thread Barry


> On 24 Nov 2021, at 23:09, Jen via Python-list  wrote:
> 
> I have a C program that uses fork-execv to run Python 3.10 in a child 
> process, and I am using eventfd with epoll for IPC between them.  The eventfd 
> file descriptor is created in C and passed to Python through execv.  Once the 
> Python child process starts I print the file descriptor to verify that it is 
> correct (it is).  
> 
> In this scenario C will write to the eventfd at intervals and Python will 
> read the eventfd and take action based on the value in the eventfd.  But in 
> the Python while True loop I get "BlockingIOError: [Errno 11] Resource 
> temporarily unavailable" then with each new read it prints "Failed epoll_wait 
> Bad file descriptor." 
> 
> This is the Python code:
> 
> #!/usr/bin/python3
> import sys
> import os
> import select
> 
> print("Inside Python")
> 
> event_fd = int(sys.argv[3])
> 
> print("Eventfd received by Python")
> print(event_fd)
> 
> ep = select.epoll(-1)
> ep.register(event_fd, select.EPOLLIN | select.EPOLLOUT)
> 
> event_write_value = 100
> 
> while True:
> 
> print("Waiting in Python for event")
> ep.poll(timeout=None, maxevents=- 1)
> v = os.eventfd_read(event_fd)
> 
> if v != 99:
> print("found")
> print(v)
> os.eventfd_write(event_fd, event_write_value)
> 
> if v == 99:
> os.close(event_fd)
> 
> This is the C code that writes to Python, then waits for Python to write back:
> 
> ssize_t epoll_write(int event_fd, int epoll_fd, struct epoll_event * 
> event_struc, int action_code)
> {
>int64_t ewbuf[1];
>ewbuf[0] = (int64_t)action_code;
>int maxevents = 1;
>int timeout = -1;
> 
>fprintf(stdout, " Writing to Python \n%d", event_fd);
> 
>write(event_fd, , 8);
> 
> if (epoll_wait(epoll_fd, event_struc, maxevents, timeout) == -1)
> {
> fprintf(stderr, "Failed epoll_wait %s\n", strerror(errno));
> }
> 
> ssize_t rdval = read(event_fd, , 8);   
> 
> fprintf(stdout, " Received from Python \n%ld", rdval);
> 
> return 0;
> }
> 
> This is the screen output when I run with gdb:
> 
>   Inside Python
> Eventfd received by Python
> 5
> Waiting in Python for event
> Traceback (most recent call last):
>   File "/usr/local/lib/python3.10/runpy.py", line 196, in
> _run_module_as_main
> return _run_code(code, main_globals, None,
>   File "/usr/local/lib/python3.10/runpy.py", line 86, in _run_code
> exec(code, run_globals)
>   File "/opt/P01_SH/NPC_CPython.py", line 36, in 
> v = os.eventfd_read(event_fd)
> BlockingIOError: [Errno 11] Resource temporarily unavailable
> Writing to Python
> 5 Received from Python
> 8 Writing to Python
> Failed epoll_wait Bad file descriptor
> 5 Received from Python
> 8 Writing to Python
> Failed epoll_wait Bad file descriptor
> 5 Received from Python
> -1time taken 0.000548
> Failed to close epoll file descriptor
> Unlink_shm status: Bad file descriptor
> fn() took 0.000648 seconds to execute
> [Inferior 1 (process 12618) exited normally]
> (gdb)
> 
> So my question is why do I get "BlockingIOError: [Errno 11] Resource 
> temporarily unavailable" and "Failed epoll_wait Bad file descriptor" from 
> Python? 

Is the fd set to non blocking? Try use fcntl to set the fd non blocking.
I am not sure if the non block state is inherited on a fork.

Do you have a C version of this code that works as a test?
Try running the python version under strace to see exactly what system calls 
are used.

Barry

> 
> -- 
> Sent with Tutanota, the secure & ad-free mailbox. 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

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


[issue45842] AddressSanitizer: bad-free - hello world c extension

2021-11-25 Thread Francesc Elies


Francesc Elies  added the comment:

I tested the same script in ubuntu and got the following.

==1361==ASan runtime does not come first in initial library list; you should 
either link runtime to your application or manually preload it with LD_PRELOAD.

While on windows he does not complain about ASan runtime not bein first in 
initial library list.

Once I use LD_PRELOAD in linux. Lsan detected memory leaks, after suppressing 
them with LSAN_OPTIONS=detect_leaks=0, the script ran fine.

So far I could not find an LD_PRELOAD equivalent in windows.

I am suspecting if one would compile python with asan and run the test on 
windows, I would get similar results as in linux. Sadly at the moment asan 
suppressions doesn't seem to work on windows.

I think this is not a real bug on python but the way we are loading asan-rt in 
windows. Once I am sure I will colse this bug.

--

___
Python tracker 

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



  1   2   >