Skip to content
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

RuntimeWarning and Correct invocation on the shell command line (not python script) #158

Open
m040601 opened this issue Nov 27, 2020 · 1 comment

Comments

@m040601
Copy link

m040601 commented Nov 27, 2020

Thanks for your work maintaining and keeping this very usefull library up to date.

Could you please add a line to the README front page,
describing the correct invocation of this library on the command line ?

Apologies if this may sound "obvious" to the developer, but I'm just an end user, not a python expert.

I use it a lot in shell scripts, not python scripts.
For a long time I had just simply typed:

python -m readability -h

or

python -m readability -u https://someurl

Some time ago something changed,
and I had to start invoking it like this

python -m readability.readability -u ...

But lately I can't get rid of this anoying error message, that gets output to STDERR

/usr/lib/python3.8/runpy.py:127: RuntimeWarning: readability.readability found in sys.modules after import of package readability, but prior to execution of readability.readability; this may result in unpredictable behaviour
  warn(RuntimeWarning(msg))

It still works, but then that STDERR "pollutes" my shell scripts execution. Tried googling for what it means, but my python skills are lacking.

I'm on Arch Linux, system python version 3.8.6, and I get python-readability library installed via this package, https://aur.archlinux.org/packages/python-readability-lxml. My system if of course up to date, and python wise I dont get any other problems.

I just cant understand if this error, is something intrinsic to this tool, my Python installation or the way I'm am calling this library on the command line.

Thanks in advance

@m040601 m040601 changed the title Correct invocation on the command line (not python script) RuntimeWarning and Correct invocation on the command line (not python script) Nov 27, 2020
@m040601 m040601 changed the title RuntimeWarning and Correct invocation on the command line (not python script) RuntimeWarning and Correct invocation on the shell command line (not python script) Nov 27, 2020
@buriy
Copy link
Owner

buriy commented Nov 27, 2020

Thanks a lot! We had command line usage, which was always "python -m readability.readability -u ...", I need to put it back to the docs (not sure why I removed it), but yes, it's python 3.8 who apparently doesn't like it.
Even though it's just a warning, I'll fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants