How to catch a fatal error in Python 2.7?

2024-12-09 Thread marc nicole via Python-list
Hello,

The fatal error exits the program with a code -1 while referencing the
memory address involved and nothing else.

How to catch it in Python 2.7?

PS: please not I am not talking about exceptions but an error resulting
from the disconnection of my bluetooth microphone abruptly and leading to
the halting of the whole program, I need to be able to do something when it
occurs.

Thanks for the help!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to catch a fatal error in Python 2.7?

2024-12-09 Thread Michael Torrie via Python-list
On 12/9/24 12:19 PM, marc nicole via Python-list wrote:
> Hello,
> 
> The fatal error exits the program with a code -1 while referencing the
> memory address involved and nothing else.
> 
> How to catch it in Python 2.7?

Does the problem occur with Python 3.x?  At this date, Python 2.7 is
only supported by your vendor if you are using an enterprise Linux
distribution.

I don't think there is a way to recover from that error in your python
script.  It could be a bug in the Python interpreter (which will never
be fixed in 2.7), or it could be a bug in a library somewhere. The
latter is most likely.  There's nothing you can do about it from a
Python script to recover.

> PS: please not I am not talking about exceptions but an error resulting
> from the disconnection of my bluetooth microphone abruptly and leading to
> the halting of the whole program, I need to be able to do something when it
> occurs.
> 
> Thanks for the help!

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


Re: ModuleNotFoundError for youtube_dl

2024-12-09 Thread Tim Johnson via Python-list


On 12/9/24 14:59, Tim Johnson wrote:


Recently did a refresh of ubuntu 24.04

With no code changes am now getting a *ModuleNotFoundError *for youtube_dl

Relevant code is

import sys
sys.path.append("/home/tim/.local/share/pipx/venvs/youtube-dl/lib/python3.12/site-packages/youtube_dl")

import youtube_dl '

Navigating to 
/home/tim/.local/share/pipx/venvs/youtube-dl/lib/python3.12/site-packages/youtube_dl,


I see the following

tim@beelink:~/.local/share/pipx/venvs/youtube-dl/lib/python3.12/site-packages/youtube_dl$ 
ls
aes.py    compat.py   extractor    jsinterp.py  options.py 
__pycache__  swfinterp.py  utils.py    YoutubeDL.py
cache.py  downloader  __init__.py  __main__.py  postprocessor 
socks.py update.py version.


I should not have appended 'youtube_dl' to the path. I used the content 
from 
/home/tim/.local/share/pipx/shared/lib/python3.12/site-packages/pipx_shared.pth


("/home/tim/.local/share/pipx/shared/lib/python3.12/site-packages") and 
added that to /usr/lib/python3.12/sitecustomize.py as appended to sys.path


and it appears to be solved.
--
https://mail.python.org/mailman/listinfo/python-list


ModuleNotFoundError for youtube_dl

2024-12-09 Thread Tim Johnson via Python-list

Recently did a refresh of ubuntu 24.04

With no code changes am now getting a *ModuleNotFoundError *for youtube_dl

Relevant code is

import sys
sys.path.append("/home/tim/.local/share/pipx/venvs/youtube-dl/lib/python3.12/site-packages/youtube_dl")

import youtube_dl '

Navigating to 
/home/tim/.local/share/pipx/venvs/youtube-dl/lib/python3.12/site-packages/youtube_dl,


I see the following

tim@beelink:~/.local/share/pipx/venvs/youtube-dl/lib/python3.12/site-packages/youtube_dl$ 
ls
aes.py    compat.py   extractor    jsinterp.py  options.py __pycache__  
swfinterp.py  utils.py    YoutubeDL.py
cache.py  downloader  __init__.py  __main__.py  postprocessor 
socks.py update.py version.py


I've been retired from python programming for 10 years now, and just 
tinker or write stuff for myself to


use on my own workstation, so I have obviously forgotten a lot (if you 
don't use it you lose it, right)


I hope that someone can help me correct this.

thanks

tim

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