Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Crash: TypeError: a bytes-like object is required, not 'str' #569

Open
@tushar-deepsource

Description

@tushar-deepsource

Code snippet:

def f():
    b"""abc"""

Output:

$ pydocstyle mytest.py 
Traceback (most recent call last):
  File "/Users/tusharsadhwani/code/marvin-python/venv3/bin/pydocstyle", line 8, in <module>
    sys.exit(main())
  File "/Users/tusharsadhwani/code/marvin-python/venv3/lib/python3.10/site-packages/pydocstyle/cli.py", line 68, in main
    sys.exit(run_pydocstyle())
  File "/Users/tusharsadhwani/code/marvin-python/venv3/lib/python3.10/site-packages/pydocstyle/cli.py", line 44, in run_pydocstyle
    errors.extend(check((filename,), select=checked_codes,
  File "/Users/tusharsadhwani/code/marvin-python/venv3/lib/python3.10/site-packages/pydocstyle/checker.py", line 993, in check
    for error in ConventionChecker().check_source(source, filename,
  File "/Users/tusharsadhwani/code/marvin-python/venv3/lib/python3.10/site-packages/pydocstyle/checker.py", line 143, in check_source
    error = this_check(self, definition,
  File "/Users/tusharsadhwani/code/marvin-python/venv3/lib/python3.10/site-packages/pydocstyle/checker.py", line 204, in check_one_liners
    lines = safe_literal_eval(docstring).split('\n')
TypeError: a bytes-like object is required, not 'str'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions