-
Notifications
You must be signed in to change notification settings - Fork 5.7k
[BUG] python-telegram-bot-raw
deprecation warning appears incorrectly if compiled with Nuitka
#4296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Did you verify it fixes the issue and still gives an error when you use ptb-raw? |
Hi. Thanks for reaching out. TBH I'm a bit confused by your description: In step one you say that you install ptb-raw. In step 5 you claim that you installed PTB instead of PTB-raw. Is step 1 a typo? I'm not sure how common this use case is. I'm not familiar with nuitka and how it does the compilation. E.g. I'm wondering how nuitka can detect telegram.ext if it doesn't include that module in compilation... Additionally, I'd like to point out that instead of doing a release that addresses the false positive, we could instead just get #4288 going and drop the warning from PTB completely:) |
@Bibo-Joshi Yes that was a typo, corrected. @Poolitzer The fix is working only if
Might also affect pyinstaller (?)
Nice! No headache at all if that get merged. |
Closed by #4288 |
Steps to Reproduce
pip install python-telegram-bot nuitka
main.py
(The actual content does not matter as long astelegram
is imported and used)main.py
. Note that deprecation warning is not appearing (Which is correct behaviour)python -m nuitka --standalone main.py
python-telegram-bot
is installed instead ofpython-telegram-bot-raw
Expected behaviour
Deprecation warning should not appear when compiled with Nuitka
Actual behaviour
Deprecation warning appears when compiled with Nuitka even if
python-telegram-bot
is used instead ofpython-telegram-bot-raw
Operating System
Any (Recommend to test on Linux)
Version of Python, python-telegram-bot & dependencies
Relevant log output
No response
Additional Context
Related issue: #4261
Related PR: #4270
Related code:
python-telegram-bot/telegram/__init__.py
Lines 482 to 504 in a9f6afd
This is happening because
main.dist/telegram/ext
is missing in the Nuitka compilation result.Instead of checking by
if not (Path(__file__).parent.resolve().absolute() / "ext").exists():
, I propose using this check instead:The text was updated successfully, but these errors were encountered: