Re: unable to resolve readline issues

2022-12-04 Thread Sabrina Almodóvar
On 04/12/2022 17:08, Eryk Sun wrote:
> On 12/2/22, biglee12...@gmail.com  wrote:
>>
>> From this point on Python became unusable as I uninstalled rebooted then
>> reinstalled to find I have the same issues as stated.  Finally uninstalled
>> Python as it doesn't perform as usual especially trying to understand the
>> use of pyreadline, gnureadline and or just readline.
> 
> When Python runs interactively, it implicitly tries to import the
> readline module. On POSIX, Python has a builtin readline module that
> usually uses the GNU Readline library.
> 
> On Windows, Python does not include a readline module. Instead, if
> standard I/O is a console, the high-level WinAPI ReadConsoleW()
> function is used, which implements its own line editor and
> command-line history. It's not as general, flexible, or capable as the
> readline interface, so a third-party pyreadline package was
> implemented for Windows. However, as far as I know, pyreadline is no
> longer actively developed. Thus it has out-of-date code, which may be
> broken in newer releases of Python, such as isinstance(x,
> collections.Callable).
> 
> Your choice is to either patch pyreadline to fix the bug or uninstall it.

(*) How to patch it

Open the file

  Lib/site-packages/pyreadline/py3k_compat.py

and locate the procedure

def callable(x):
return isinstance(x, collections.Callable)

Change it to

def callable(x):
return isinstance(x, collections.abc.Callable)

You're done.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: unable to resolve readline issues

2022-12-04 Thread MRAB

On 2022-12-02 22:38, biglee12...@gmail.com wrote:
> Dear Sir:
>
> For whatever reason I have lost functionality of using Python 3.11. 
While

> opening Python (standalone or from CMD prompt) as usual this AM the
> following message appeared.   Did read that it is not compatible with
> Windows but I can't get it to work as I don't know what module will load.
>
> Python 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit 
(AMD64)] on

> win32
> Type "help", "copyright", "credits" or "license" for more information.
> Failed calling sys.__interactivehook__
> Traceback (most recent call last):
>File "", line 445, in register_readline
>File 
"C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\readline.py", 
line 34, in 

>  rl = Readline()
>   ^^
>File 
"C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyreadline\rlmain.py", 
line 422, in __init__

>  BaseReadline.__init__(self)
>File 
"C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyreadline\rlmain.py", 
line 62, in __init__

>  mode.init_editing_mode(None)
>File 
"C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyreadline\modes\emacs.py", 
line 633, in init_editing_mode

>  self._bind_key('space',   self.self_insert)
>File 
"C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyreadline\modes\basemode.py", 
line 162, in _bind_key

>  if not callable(func):
> ^^
>File 
"C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\pyreadline\py3k_compat.py", 
line 8, in callable

>  return isinstance(x, collections.Callable)rer
>   
> AttributeError: module 'collections' has no attribute 'Callable'
>
>   From this point on Python became unusable as I uninstalled rebooted 
then
> reinstalled to find I have the same issues as stated.  Finally 
uninstalled

> Python as it doesn't perform as usual especially trying to understand the
> use of pyreadline, gnureadline and or just readline.
>
> If you can help great.
>
> Regards,
> Leon Pearlman
>
Looking at PyPI, it appears that it was last supported on Python 3.5.

I'd suggest that after uninstalling Python, you delete the Python folder
if it's still there (because of any installed 3rd-party modules) before
re-installing.
--
https://mail.python.org/mailman/listinfo/python-list


Re: unable to resolve readline issues

2022-12-04 Thread Eryk Sun
On 12/2/22, biglee12...@gmail.com  wrote:
>
> From this point on Python became unusable as I uninstalled rebooted then
> reinstalled to find I have the same issues as stated.  Finally uninstalled
> Python as it doesn't perform as usual especially trying to understand the
> use of pyreadline, gnureadline and or just readline.

When Python runs interactively, it implicitly tries to import the
readline module. On POSIX, Python has a builtin readline module that
usually uses the GNU Readline library.

On Windows, Python does not include a readline module. Instead, if
standard I/O is a console, the high-level WinAPI ReadConsoleW()
function is used, which implements its own line editor and
command-line history. It's not as general, flexible, or capable as the
readline interface, so a third-party pyreadline package was
implemented for Windows. However, as far as I know, pyreadline is no
longer actively developed. Thus it has out-of-date code, which may be
broken in newer releases of Python, such as isinstance(x,
collections.Callable).

Your choice is to either patch pyreadline to fix the bug or uninstall it.
-- 
https://mail.python.org/mailman/listinfo/python-list


unable to resolve readline issues

2022-12-04 Thread biglee12672
Dear Sir:

 

For whatever reason I have lost functionality of using Python 3.11.  While
opening Python (standalone or from CMD prompt) as usual this AM the
following message appeared.   Did read that it is not compatible with
Windows but I can't get it to work as I don't know what module will load.

 

Python 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)] on
win32

Type "help", "copyright", "credits" or "license" for more information.

Failed calling sys.__interactivehook__

Traceback (most recent call last):

  File "", line 445, in register_readline

  File
"C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\re
adline.py", line 34, in 

rl = Readline()

 ^^

  File
"C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\py
readline\rlmain.py", line 422, in __init__

BaseReadline.__init__(self)

  File
"C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\py
readline\rlmain.py", line 62, in __init__

mode.init_editing_mode(None)

  File
"C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\py
readline\modes\emacs.py", line 633, in init_editing_mode

self._bind_key('space',   self.self_insert)

  File
"C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\py
readline\modes\basemode.py", line 162, in _bind_key

if not callable(func):

   ^^

  File
"C:\Users\bigle\AppData\Local\Programs\Python\Python311\Lib\site-packages\py
readline\py3k_compat.py", line 8, in callable

return isinstance(x, collections.Callable)rer

 

AttributeError: module 'collections' has no attribute 'Callable'

 

>From this point on Python became unusable as I uninstalled rebooted then
reinstalled to find I have the same issues as stated.  Finally uninstalled
Python as it doesn't perform as usual especially trying to understand the
use of pyreadline, gnureadline and or just readline.

 

If you can help great. 

 

Regards,

Leon Pearlman

 

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


[Python-announce] NumPy 1.24.0rc2 released

2022-12-04 Thread Charles R Harris
Hi All,

On behalf of the NumPy team, I'm pleased to announce the release of NumPy
1.24.0rc1. The NumPy 1.24.0 release continues the ongoing work to improve
the handling and promotion of dtypes, increase execution speed, and
clarify the documentation. There are also a large number of new and expired
deprecations due to changes in promotion and cleanups. This might be called
a deprecation release. Highlights are

   - Many new deprecations.
   - Many expired deprecations.
   - New f2py features and fixes.
   - New "dtype" and "casting" keywords for stacking functions.

The Python versions supported in this release are 3.8-3.11 Note that 32 bit
wheels are only provided for Windows, all other wheels are 64 bits on
account of Ubuntu, Fedora, and other Linux distributions dropping 32 bit
support. Wheels can be downloaded from PyPI
; source archives, release
notes, and wheel hashes are available on Github
.

*Contributors*

A total of 175 people contributed to this release.  People with a "+" by
their
names contributed a patch for the first time.

   - @DWesl
   - @amagicmuffin +
   - @dg3192 +
   - @h-vetinari
   - @juztamau5 +
   - @swagatip +
   - Aaron Meurer
   - Aayush Agrawal +
   - Adam Knapp +
   - Adarsh Singh +
   - Al-Baraa El-Hag
   - Alban Desmaison +
   - Ales Crocaro +
   - Alex Low +
   - Alexander Grund +
   - Alexander Kanavin +
   - Andras Deak
   - Angéllica Araujo +
   - Anselm Hahn +
   - Ari Cooper Davis +
   - Axel Huebl +
   - Bas van Beek
   - Bhavuk Kalra
   - Bram Ton +
   - Brent Tan +
   - Brigitta Sipőcz
   - Callum O'Riley +
   - Charles Harris
   - Chiara Marmo
   - Christoph Reiter
   - Damien Caliste
   - Dan Schult +
   - Daniel da Silva
   - DanielHabenicht +
   - Dave Goel +
   - David Gilbertson +
   - Developer-Ecosystem-Engineering
   - Digya Acharya +
   - Dimitri Papadopoulos Orfanos
   - Eric-Shang +
   - Evgeni Burovski
   - Ewout ter Hoeven
   - Felix Hirwa Nshuti +
   - Frazer McLean +
   - Ganesh Kathiresan
   - Gavin Zhang +
   - Gaëtan de Menten
   - Greg Lucas
   - Greg Sadetsky +
   - Gregory P. Smith [Google LLC] +
   - Hameer Abbasi
   - Hannah Aizenman +
   - Hood Chatham
   - I-Shen Leong
   - Iantra Solari +
   - Ikko Ashimine +
   - Inessa Pawson
   - Jake Bowhay +
   - Jake Close +
   - Jarrod Millman
   - Jason Thai
   - JessePires +
   - Jessé Pires +
   - Jhonatan Cunha +
   - Jingxuan He +
   - Johnathon Cusick +
   - Jon Morris
   - Jordy Williams +
   - Josh Wilson
   - João Fontes Gonçalves +
   - Juan Luis Cano Rodríguez
   - Jyn Spring 琴春 +
   - KIU Shueng Chuan
   - Karl Otness +
   - Kevin Sheppard
   - Kinshuk Dua +
   - Leo Fang
   - Leona Taric +
   - Lev Maximov +
   - Lillian Zha +
   - Loïc Estève
   - M. Eric Irrgang +
   - Mariusz Felisiak
   - Mark Harfouche
   - Martin Zacho +
   - Matheus Santana Patriarca +
   - Matt Williams +
   - Matteo Raso +
   - Matthew Barber
   - Matthew Brett
   - Matthew Sterrett +
   - Matthias Bussonnier
   - Matthias Koeppe +
   - Matti Picus
   - Meekail Zain +
   - Melissa Weber Mendonça
   - Michael Osthege +
   - Michael Siebert +
   - Mike Toews
   - Miki Watanabe +
   - Miles Cranmer +
   - Monika Kubek +
   - Muhammad Jarir Kanji +
   - Mukulika Pahari
   - Namami Shanker
   - Nathan Goldbaum +
   - Nathan Rooy +
   - Navpreet Singh +
   - Noritada Kobayashi +
   - Oleksiy Kononenko +
   - Omar Ali +
   - Pal Barta +
   - Pamphile Roy
   - Patrick Hoefler +
   - Pearu Peterson
   - Pedro Nacht +
   - Petar Mlinarić +
   - Peter Hawkins
   - Pey Lian Lim
   - Pieter Eendebak
   - Pradipta Ghosh
   - Pranab Das +
   - Precision Wordcraft LLC +
   - PrecisionWordcraft +
   - Rafael CF Sousa +
   - Rafael Cardoso Fernandes Sousa
   - Rafael Sousa +
   - Raghuveer Devulapalli
   - Ralf Gommers
   - Rin Cat (鈴猫) +
   - Robert Kern
   - Rohit Davas +
   - Rohit Goswami
   - Ross Barnowski
   - Ruth Comer +
   - Sabiha Tahsin Soha +
   - Sachin Krishnan T V +
   - Sanjana M Moodbagil +
   - Sanya Sinha +
   - Sarah Coffland +
   - Saransh Chopra +
   - Satish Kumar Mishra +
   - Satish Mishra +
   - Sayed Adel
   - Schrijvers Luc +
   - Sebastian Berg
   - Serge Guelton
   - Seva Lotoshnikov +
   - Shashank Gupta +
   - Shoban Chiddarth +
   - Shreya Singh +
   - Shreyas Joshi +
   - Sicheng Zeng +
   - Simran Makandar +
   - Shuangchi He +
   - Srimukh Sripada +
   - Stefan van der Walt
   - Stefanie Molin +
   - Stuart Archibald
   - Tania Allard
   - Thomas A Caswell
   - Thomas Kastl +
   - Thomas Mansencal +
   - Tony Newton / Teng Liu +
   - Toshiki Kataoka
   - Tyler Reddy
   - Vardhaman Kalloli +
   - Warren Weckesser
   - Will Ayd +
   - William Stein +
   - XinRu Lin +
   - Yin Li +
   - Yunika Bajracharya +
   - Zachary Blackwood +
   - 渡邉 美希 +

Cheers,

Charles Harris
___
Python-announce-list mailing list -- python-announce-list@python.org
To 

Re: Calling pselect/ppoll/epoll_pwait

2022-12-04 Thread Barry
 On 3 Dec 2022, at 13:13, Weatherby,Gerard  wrote:

 

 Signalfd and select could probably be made to work if one codes around
 the race conditions pselect is provided to avoid. I’m not sure if using
 the GIL (for CPython) is sufficient or if a dedicated concurrency
 control (e.g. lock, mutex, semaphore) is necessary.

 An alternative is to call the C library function via a wrapper. I had
 need to use setfsuid on a project a couple of years ago and found this
 example:

 [1]https://gist.github.com/atdt/ebafa299e843a767139b

  

   I read this on SO when researching your question.
   Search for epoll and signal.

   (I would post the link but ipad turns the link into an image…)

   I assume that the lack of pepoll means you can use epoll and

   signalfd without race conditions. The trick seems to be setting

   the signal to ignore.

   Barry

  

 From: Python-list 
 on behalf of Barry 

 Date: Friday, December 2, 2022 at 7:02 PM
 To: Ian Pilcher 
 Cc: python-list@python.org 
 Subject: Re: Calling pselect/ppoll/epoll_pwait

 *** Attention: This is an external email. Use caution responding,
 opening attachments or clicking on links. ***

 > On 2 Dec 2022, at 20:03, Ian Pilcher  wrote:
 >
 > Does Python provide any way to call the "p" variants of the I/O
 > multiplexing functions?
 >
 > Looking at the documentation of the select[1] and selectors[2]
 modules,
 > it appears that they expose only the "non-p" variants.
 >
 > [1]
 
[2]https://urldefense.com/v3/__https://docs.python.org/3/library/select.html__;!!Cn_UX_p3!hClFFo4XdiwQAhHxDbHA5zFr490Of9uheHSf84V9cREMHyw1kX-baG5HzXWMt-hFLP30q6DpSUb2G_OD5qBjeA$
 > [2]
 
[3]https://urldefense.com/v3/__https://docs.python.org/3/library/selectors.html__;!!Cn_UX_p3!hClFFo4XdiwQAhHxDbHA5zFr490Of9uheHSf84V9cREMHyw1kX-baG5HzXWMt-hFLP30q6DpSUb2G_MwNjgO8A$

 Can you use signalfd and select/poll/epoll?

 Barry

 >
 > --
 >
 
 > Google  Where SkyNet meets
 Idiocracy
 >
 
 > --
 >
 
[4]https://urldefense.com/v3/__https://mail.python.org/mailman/listinfo/python-list__;!!Cn_UX_p3!hClFFo4XdiwQAhHxDbHA5zFr490Of9uheHSf84V9cREMHyw1kX-baG5HzXWMt-hFLP30q6DpSUb2G_PhasKBfg$
 >

 --
 
[5]https://urldefense.com/v3/__https://mail.python.org/mailman/listinfo/python-list__;!!Cn_UX_p3!hClFFo4XdiwQAhHxDbHA5zFr490Of9uheHSf84V9cREMHyw1kX-baG5HzXWMt-hFLP30q6DpSUb2G_PhasKBfg$

References

   Visible links
   1. https://gist.github.com/atdt/ebafa299e843a767139b
   2. 
https://urldefense.com/v3/__https:/docs.python.org/3/library/select.html__;!!Cn_UX_p3!hClFFo4XdiwQAhHxDbHA5zFr490Of9uheHSf84V9cREMHyw1kX-baG5HzXWMt-hFLP30q6DpSUb2G_OD5qBjeA$
   3. 
https://urldefense.com/v3/__https:/docs.python.org/3/library/selectors.html__;!!Cn_UX_p3!hClFFo4XdiwQAhHxDbHA5zFr490Of9uheHSf84V9cREMHyw1kX-baG5HzXWMt-hFLP30q6DpSUb2G_MwNjgO8A$
   4. 
https://urldefense.com/v3/__https:/mail.python.org/mailman/listinfo/python-list__;!!Cn_UX_p3!hClFFo4XdiwQAhHxDbHA5zFr490Of9uheHSf84V9cREMHyw1kX-baG5HzXWMt-hFLP30q6DpSUb2G_PhasKBfg$
   5. 
https://urldefense.com/v3/__https:/mail.python.org/mailman/listinfo/python-list__;!!Cn_UX_p3!hClFFo4XdiwQAhHxDbHA5zFr490Of9uheHSf84V9cREMHyw1kX-baG5HzXWMt-hFLP30q6DpSUb2G_PhasKBfg$
-- 
https://mail.python.org/mailman/listinfo/python-list