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

Python 3.9 Deprecation Warning: 'encoding' #151

Open
ukanuk opened this issue Apr 13, 2020 · 1 comment
Open

Python 3.9 Deprecation Warning: 'encoding' #151

ukanuk opened this issue Apr 13, 2020 · 1 comment
Assignees
Labels
Milestone

Comments

@ukanuk
Copy link

ukanuk commented Apr 13, 2020

After running through the readme and installing via pip install wptools, running get_parse() raises a deprecation warning that'encoding' is ignored and deprecated and will be removed.

I'm running Python 3.8.2 32-bit on Win 10 v1909.

>>> import wptools
>>> page = wptools.page('Gandhi')
>>> page.get_parse()
en.wikipedia.org (parse) Gandhi

Warning (from warnings module):
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\wptools\utils.py", line 95
    return json.loads(data, encoding='utf-8')
DeprecationWarning: 'encoding' is ignored and deprecated. It will be removed in Python 3.9
en.wikipedia.org (imageinfo) File:Mahatma-Gandhi, studio, 1931.jpg

Warning (from warnings module):
  File "C:\Program Files (x86)\Python38-32\lib\site-packages\wptools\utils.py", line 95
    return json.loads(data, encoding='utf-8')
DeprecationWarning: 'encoding' is ignored and deprecated. It will be removed in Python 3.9
Mahatma Gandhi (en) data
{
  image: <list(1)> {'kind': 'parse-image', 'file': 'File:Mahatma-G...
  infobox: <dict(29)> honorific_prefix, name, office, term, nation...
  iwlinks: <list(8)> https://commons.wikimedia.org/wiki/Special:Se...
  pageid: 19379
  parsetree: <str(359143)> <root><template><title>Short descriptio...
  requests: <list(2)> parse, imageinfo
  title: Mahatma Gandhi
  wikibase: Q1001
  wikidata_url: https://www.wikidata.org/wiki/Q1001
  wikitext: <str(283423)> {{Short description|Pre-eminent leader o...
}
<wptools.page.WPToolsPage object at 0x04FBD748>
@siznax
Copy link
Owner

siznax commented Apr 15, 2020

Thank you for noting this @ukanuk. Will add to next milestone.

@siznax siznax self-assigned this Apr 15, 2020
@siznax siznax added the Bug label Apr 15, 2020
@siznax siznax added this to the Release v0.4.18 milestone Apr 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants