mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Deprecate SphinxBaseFileInput
This commit is contained in:
parent
de49b991f6
commit
636ca67528
1
CHANGES
1
CHANGES
@ -63,6 +63,7 @@ Deprecated
|
||||
* ``sphinx.ext.autosummary.Autosummary.warnings``
|
||||
* ``sphinx.ext.autosummary.Autosummary.result``
|
||||
* ``sphinx.ext.doctest.doctest_encode()``
|
||||
* ``sphinx.io.SphinxBaseFileInput``
|
||||
* ``sphinx.io.SphinxRSTFileInput``
|
||||
* ``sphinx.registry.SphinxComponentRegistry.add_source_input()``
|
||||
* ``sphinx.testing.util.remove_unicode_literal()``
|
||||
|
@ -268,6 +268,11 @@ The following is a list of deprecated interfaces.
|
||||
- 3.0
|
||||
- N/A
|
||||
|
||||
* - ``sphinx.io.SphinxBaseFileInput``
|
||||
- 2.0
|
||||
- 3.0
|
||||
- N/A
|
||||
|
||||
* - ``sphinx.io.SphinxRSTFileInput``
|
||||
- 2.0
|
||||
- 3.0
|
||||
|
10
sphinx/io.py
10
sphinx/io.py
@ -185,15 +185,14 @@ class SphinxBaseFileInput(FileInput):
|
||||
self.app = app
|
||||
self.env = env
|
||||
|
||||
warnings.warn('%s is deprecated.' % self.__class__.__name__,
|
||||
RemovedInSphinx30Warning, stacklevel=2)
|
||||
|
||||
kwds['error_handler'] = 'sphinx' # py3: handle error on open.
|
||||
super().__init__(*args, **kwds)
|
||||
|
||||
def warn_and_replace(self, error):
|
||||
# type: (Any) -> Tuple
|
||||
warnings.warn('SphinxBaseFileInput.warn_and_replace() is deprecated. '
|
||||
'Use UnicodeDecodeErrorHandler instead.',
|
||||
RemovedInSphinx30Warning, stacklevel=2)
|
||||
|
||||
return UnicodeDecodeErrorHandler(self.env.docname)(error)
|
||||
|
||||
|
||||
@ -246,9 +245,6 @@ class SphinxRSTFileInput(SphinxBaseFileInput):
|
||||
|
||||
def read(self): # type: ignore
|
||||
# type: () -> StringList
|
||||
warnings.warn('SphinxRSTFileInput is deprecated.',
|
||||
RemovedInSphinx30Warning, stacklevel=2)
|
||||
|
||||
inputstring = super().read()
|
||||
lines = string2lines(inputstring, convert_whitespace=True)
|
||||
content = StringList()
|
||||
|
Loading…
Reference in New Issue
Block a user