mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #7839: autosummary: cannot handle umlauts in function names
This commit is contained in:
parent
8f184e07bb
commit
9c0bf231ab
1
CHANGES
1
CHANGES
@ -16,6 +16,7 @@ Features added
|
|||||||
Bugs fixed
|
Bugs fixed
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
* #7839: autosummary: cannot handle umlauts in function names
|
||||||
* #7715: LaTeX: ``numfig_secnum_depth > 1`` leads to wrong figure links
|
* #7715: LaTeX: ``numfig_secnum_depth > 1`` leads to wrong figure links
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
|
@ -755,7 +755,8 @@ def process_generate_options(app: Sphinx) -> None:
|
|||||||
with mock(app.config.autosummary_mock_imports):
|
with mock(app.config.autosummary_mock_imports):
|
||||||
generate_autosummary_docs(genfiles, suffix=suffix, base_path=app.srcdir,
|
generate_autosummary_docs(genfiles, suffix=suffix, base_path=app.srcdir,
|
||||||
app=app, imported_members=imported_members,
|
app=app, imported_members=imported_members,
|
||||||
overwrite=app.config.autosummary_generate_overwrite)
|
overwrite=app.config.autosummary_generate_overwrite,
|
||||||
|
encoding=app.config.source_encoding)
|
||||||
|
|
||||||
|
|
||||||
def setup(app: Sphinx) -> Dict[str, Any]:
|
def setup(app: Sphinx) -> Dict[str, Any]:
|
||||||
|
@ -347,7 +347,7 @@ def generate_autosummary_docs(sources: List[str], output_dir: str = None,
|
|||||||
info: Callable = None, base_path: str = None,
|
info: Callable = None, base_path: str = None,
|
||||||
builder: Builder = None, template_dir: str = None,
|
builder: Builder = None, template_dir: str = None,
|
||||||
imported_members: bool = False, app: Any = None,
|
imported_members: bool = False, app: Any = None,
|
||||||
overwrite: bool = True) -> None:
|
overwrite: bool = True, encoding: str = 'utf-8') -> None:
|
||||||
if info:
|
if info:
|
||||||
warnings.warn('info argument for generate_autosummary_docs() is deprecated.',
|
warnings.warn('info argument for generate_autosummary_docs() is deprecated.',
|
||||||
RemovedInSphinx40Warning, stacklevel=2)
|
RemovedInSphinx40Warning, stacklevel=2)
|
||||||
@ -415,17 +415,17 @@ def generate_autosummary_docs(sources: List[str], output_dir: str = None,
|
|||||||
|
|
||||||
filename = os.path.join(path, name + suffix)
|
filename = os.path.join(path, name + suffix)
|
||||||
if os.path.isfile(filename):
|
if os.path.isfile(filename):
|
||||||
with open(filename) as f:
|
with open(filename, encoding=encoding) as f:
|
||||||
old_content = f.read()
|
old_content = f.read()
|
||||||
|
|
||||||
if content == old_content:
|
if content == old_content:
|
||||||
continue
|
continue
|
||||||
elif overwrite: # content has changed
|
elif overwrite: # content has changed
|
||||||
with open(filename, 'w') as f:
|
with open(filename, 'w', encoding=encoding) as f:
|
||||||
f.write(content)
|
f.write(content)
|
||||||
new_files.append(filename)
|
new_files.append(filename)
|
||||||
else:
|
else:
|
||||||
with open(filename, 'w') as f:
|
with open(filename, 'w', encoding=encoding) as f:
|
||||||
f.write(content)
|
f.write(content)
|
||||||
new_files.append(filename)
|
new_files.append(filename)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user