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

Fix non ascii object members #153

Merged
merged 8 commits into from
Aug 8, 2022
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Changes in sphinx-automodapi
0.15.0 (unreleased)
-------------------

- Fixed issue with non-ascii characters in object members on Windows as the default encoding there is not ``utf8`` [#153]
bsipocz marked this conversation as resolved.
Show resolved Hide resolved

0.14.1 (2022-01-12)
-------------------

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down
2 changes: 1 addition & 1 deletion sphinx_automodapi/automodsumm.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ def generate_automodsumm_docs(lines, srcfn, app=None, suffix='.rst',

new_files.append(fn)

f = open(fn, 'w')
f = open(fn, 'w', encoding='utf8')

try:

Expand Down
1 change: 1 addition & 0 deletions sphinx_automodapi/tests/cases/non_ascii/input/index.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Ceçi est un exemple qui inclus des charactères non-ASCII

.. automodapi:: sphinx_automodapi.tests.example_module.functions
.. automodapi:: sphinx_automodapi.tests.example_module.nonascii
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
NonAscii
========

.. currentmodule:: sphinx_automodapi.tests.example_module.nonascii

.. autoclass:: NonAscii
:show-inheritance:

.. rubric:: Methods Summary

.. autosummary::

~NonAscii.get_ß
~NonAscii.get_äöü

.. rubric:: Methods Documentation

.. automethod:: get_ß
.. automethod:: get_äöü
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,23 @@ Functions
.. automodsumm:: sphinx_automodapi.tests.example_module.functions
:functions-only:
:toctree: api


sphinx_automodapi.tests.example_module.nonascii Module
------------------------------------------------------

.. automodule:: sphinx_automodapi.tests.example_module.nonascii

Classes
^^^^^^^

.. automodsumm:: sphinx_automodapi.tests.example_module.nonascii
:classes-only:
:toctree: api

Class Inheritance Diagram
^^^^^^^^^^^^^^^^^^^^^^^^^

.. automod-diagram:: sphinx_automodapi.tests.example_module.nonascii
:private-bases:
:parts: 1
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@
add
subtract
multiply
.. currentmodule:: sphinx_automodapi.tests.example_module.nonascii
m-rossi marked this conversation as resolved.
Show resolved Hide resolved

.. autosummary::
:toctree: api

NonAscii

15 changes: 15 additions & 0 deletions sphinx_automodapi/tests/example_module/nonascii.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
__all__ = ['NonAscii']


class NonAscii(object):
def get_äöü(self):
"""
Return a string with common umlauts like äöüß
"""
return 'äöü'

def get_ß(self):
"""
Return a string with the eszett symbol
"""
return 'ß'