Skip to content

autodoc does not support unicode docstrings #47291

Closed

Description

@cdevienne
mannequin
BPO 3041
Nosy @birkenfeld
PRs
  • bpo-3041: fix running subprocess.run() with shell=True and args being a list #1083
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/birkenfeld'
    closed_at = <Date 2008-06-05.17:06:46.555>
    created_at = <Date 2008-06-05.10:21:33.434>
    labels = ['type-crash', 'docs']
    title = 'autodoc does not support unicode docstrings'
    updated_at = <Date 2017-04-11.10:06:41.096>
    user = 'https://bugs.python.org/cdevienne'

    bugs.python.org fields:

    activity = <Date 2017-04-11.10:06:41.096>
    actor = 'Dimitri Merejkowsky'
    assignee = 'georg.brandl'
    closed = True
    closed_date = <Date 2008-06-05.17:06:46.555>
    closer = 'georg.brandl'
    components = ['Documentation tools (Sphinx)']
    creation = <Date 2008-06-05.10:21:33.434>
    creator = 'cdevienne'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 3041
    keywords = []
    message_count = 2.0
    messages = ['67710', '67718']
    nosy_count = 2.0
    nosy_names = ['georg.brandl', 'cdevienne']
    pr_nums = ['1083']
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue3041'
    versions = []

    Activity

    1. cdevienne commented on Jun 5, 2008

      cdeviennemannequin
      MannequinAuthor

      If I define unicode docstrings in my python source, autodoc crash
      because it tries to decode them, which force a ascii encode first.

      A trivial patch fix the issue :

      Index: sphinx/ext/autodoc.py
      ===================================================================

      --- sphinx/ext/autodoc.py	(révision 63954)
      +++ sphinx/ext/autodoc.py	(copie de travail)
      @@ -218,7 +218,7 @@
           module = getattr(todoc, '__module__', None)
           if module is not None:
               charset = get_module_charset(module)
      -        docstrings = [docstring.decode(charset) for docstring in
      docstrings]
      +        docstrings = [docstring.decode(charset) for docstring in
      docstrings if not isinstance(docstring, unicode)]
       
           # add docstring content
           for docstring in docstrings:
    2. added
      docs
      type-crash
      on Jun 5, 2008
    3. birkenfeld commented on Jun 5, 2008

      @birkenfeld
      Member

      Thanks, fixed in r63958.

    4. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    docstype-crash

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions