Skip to content

Reference target not found: _thread.allocate_loc #9338

@kasium

Description

@kasium

Describe the bug
If I use sphinx with autodoc and a typing hint on lock, I get the nitpick error:
picky/picky/__init__.py:docstring of picky.do_lock::py:class reference target not found: _thread.allocate_loc

To Reproduce

setup

virtualenv venv --python=python3.7
source venv/bin/activate
pip install Sphinx==4.0.2

docs/conf.py

import os
import sys
sys.path.insert(0, os.path.abspath('..'))
extensions = ["sphinx.ext.autodoc"]

docs/index.rst

PICKY
=====

.. automodule:: picky
   :members:
   :undoc-members:
   :show-inheritance:

picky/__init__.py

import threading
def do_lock(lock: threading.Lock):
    """dummy"""
    pass

Build

rm -rf docs/_build/ && sphinx-build -b html -W -n -a  docs docs/_build/

Expected behavior
It should work fine

Environment info

  • OS: Linux
  • Python version: 3.7.1
  • Sphinx version: 4.0.2
  • Sphinx extensions: sphinx.ext.autodoc

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions