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

sphinx.locale.l_() (deprecated in v1.18) has been removed in 3.x #1816

Closed
sten0 opened this issue Jun 25, 2020 · 1 comment · Fixed by #1817
Closed

sphinx.locale.l_() (deprecated in v1.18) has been removed in 3.x #1816

sten0 opened this issue Jun 25, 2020 · 1 comment · Fixed by #1817

Comments

@sten0
Copy link
Contributor

sten0 commented Jun 25, 2020

Summary

Hi,

sphinx.locale.l_() (elispdomain.py:L11) was deprecated in v1.18 and no longer exists in 3.x. Upstream Sphinx appears to recommend switching to sphinx.locale._()

I'm wondering if you'll be be able to look into this in the next couple of weeks, because I don't think I'll be able to find time to work on this until the deadline has past, and I'm guessing there may be other vestigial Sphinx 1.x bits ;-) The only reason there's a timeline is Debian sid (development of next version) is switching to 3.1.1 sometime "in a couple of weeks" (Bug#963647), and Ubuntu groovy will switch a few weeks afterwards. Worst-case scenario I'll temporarily remove the local copy of the docs, leaving users who don't have internet access (eg: the Read The Docs copy) without documentation until October.

Steps to reproduce

With Elpy 1.34 (also 03a7517):

python3 -m sphinx -N -bhtml docs/ build/html
Running Sphinx v3.1.1

Extension error:
Could not import extension elispdomain (exception: cannot import name 'l_' from 'sphinx.locale' (/usr/lib/python3/dist-packages/sphinx/locale/__init__.py))

My configuration

OS

Debian sid + Sphinx 3.1.1

@sten0
Copy link
Contributor Author

sten0 commented Jun 26, 2020

I was compelled to see if I could learn how to check for deprecated functions, and found that I could have spotted this a year ago if only I'd been parsing build logs for warnings. Here's the full list, using Sphinx 2.4.3, which warns on deprecated functions that will be (or in this case have been) removed in 3.x:

/<<PKGBUILDDIR>>/docs/elispdomain.py:109: RemovedInSphinx30Warning: sphinx.locale.l_() is deprecated.  Please use `_()` instead.
  'function': ObjType(l_('function'), 'function'),
/<<PKGBUILDDIR>>/docs/elispdomain.py:110: RemovedInSphinx30Warning: sphinx.locale.l_() is deprecated.  Please use `_()` instead.
  'variable': ObjType(l_('variable'), 'variable'),
/<<PKGBUILDDIR>>/docs/elispdomain.py:111: RemovedInSphinx30Warning: sphinx.locale.l_() is deprecated.  Please use `_()` instead.
  'command': ObjType(l_('function'), 'command'),
/<<PKGBUILDDIR>>/docs/elispdomain.py:112: RemovedInSphinx30Warning: sphinx.locale.l_() is deprecated.  Please use `_()` instead.
  'option': ObjType(l_('variable'), 'option'),
/<<PKGBUILDDIR>>/docs/quickstart.rst:14: WARNING: duplicate description of command elpy-shell-send-region-or-buffer, other instance in /<<PKGBUILDDIR>>/docs/ide.rst
/<<PKGBUILDDIR>>/docs/quickstart.rst:20: WARNING: duplicate description of command elpy-shell-send-statement-and-step, other instance in /<<PKGBUILDDIR>>/docs/ide.rst
/<<PKGBUILDDIR>>/docs/quickstart.rst:26: WARNING: duplicate description of command elpy-shell-switch-to-shell, other instance in /<<PKGBUILDDIR>>/docs/ide.rst
/<<PKGBUILDDIR>>/docs/quickstart.rst:31: WARNING: duplicate description of command elpy-doc, other instance in /<<PKGBUILDDIR>>/docs/ide.rst

So it looks like my PR will be sufficient to close this issue :-)

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

Successfully merging a pull request may close this issue.

1 participant