pydocstyle icon indicating copy to clipboard operation
pydocstyle copied to clipboard

Fix TypeError with bytes docstrings

Open tushar-deepsource opened this issue 4 years ago • 4 comments

Let me know if the fix is adequate or if it should be fixed in some other way.

Resolves #569

Pending:

  • [ ] Add unit tests and integration tests where applicable.
    If you've added an error code or changed an error code behavior, you should probably add or change a test case file under tests/test_cases/ and add it to the list under tests/test_definitions.py.
    If you've added or changed a command line option, you should probably add or change a test in tests/test_integration.py.
  • [ ] Add a line to the release notes (docs/release_notes.rst) under "Current Development Version".
    Make sure to include the PR number after you open and get one.

tushar-deepsource avatar Jan 10 '22 07:01 tushar-deepsource

Seems like I can't approve the pipeline, do you know what's wrong with the rights @samj1912 ?

Pierre-Sassoulas avatar Feb 10 '23 10:02 Pierre-Sassoulas

@sigmavirus24 are you suggesting there be another lint rule?

tusharsadhwani avatar Feb 10 '23 14:02 tusharsadhwani

I'm suggesting that skipping byte string docstrings is going to be confusing for users. So we either need to try to do the right thing or emit an error code that this is a byte string and those aren't valid docstrings (because they're not if I understand the old discussion properly).

sigmavirus24 avatar Feb 10 '23 18:02 sigmavirus24

@sigmavirus24 I'm in favour of simply raising a new issue for bytes then.

Trying to do the right thing has its own edge case: if we're unable to decode the bytes object, we can't do much.

tusharsadhwani avatar Feb 10 '23 21:02 tusharsadhwani