PyCharm does not strip trailing whitespaces in docstrings
已回答
I'm running PyCharm since 2016.3 and I don't recall having this issue at the beginning. I'm now at 2017.1.2 and PyCharm does not strip trailing whitespaces within Python's docstrings.

As you can see in the above screenshot trailing whitespaces in the function body are stripped as expected but not the ones in the docstring.
My settings are set to strip trailing spaces on modified lines only but still, this is not the expected behavior.

请先登录再写评论。
Hi Jimmy! I am very sorry for the inconvenience. It's a known regression problem https://youtrack.jetbrains.com/issue/PY-23453 and is fixed in 2017.1.3 EAP, would you mind trying Release Candidate build?
@pavel I'm still having problems with this in 2017.1.4 (any line inside triple quotes does not get trimmed)
Any ideas why?
Hi Eli! Could you please specify what option do you have in Editor | General | Strip trailing spaces on Save? Do all lines inside string literals affected? Are not this literals raw (e.g. r"""hello world""")?
It still doesnt trim them.
Editor | General | Strip trailing spaces on Save is set to 'all'.
PyCharm 2018.2.1 (Community Edition)
Build #PC-182.3911.33, built on August 5, 2018
JRE: 1.8.0_152-release-1248-b8 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 7 6.1
Hi, make sure caret isn't placed on the line with the trailing spaces, by default it is ignored (see Editor | General | Always keep trailing spaces on caret line). Also please disable Editor | Code Style | EditorConfig support. Has it helped?
Hi, I'm still having this problem with triple quoted strings('''). I have "strip trailing spaces" set to "All" and uncheked "Always Keep trailing spaces on caret line". I'm using PyCharm 2019.3
Hi Francisco, could you please create a ticket in PyCharm's bug tracker https://youtrack.jetbrains.com/issues/PY and provide expected/actual details?
Hi Pavel, there's already an issue for this:
https://youtrack.jetbrains.com/issue/PY-23871
Although I think it's a bug and not an improvement