White space U+000C FORM FEED incorrectly removed by Spyder text editor
See original GitHub issueThe U+000C (FORM FEED) character is valid white space in text, including Python source code.
What steps will reproduce the problem?
-
Create a text file
foo.txt
containing several lines of text, including one line containing only a U+000C character. -
Open the file
foo.txt
in Spyder.Spyder will raise a modal dialogue “foo.txt contains mixed end-of-line characters. Spyder will fix this automatically.”
-
The U+000C characters have been removed.
What is the expected output? What do you see instead?
Actual: The text is altered, by removing the valid characters.
Expected: the U+000C character should be treated as valid vertical white space, no message, and left unchanged.
The non-printable U+000C is typically shown in text editors by a visible glyph (e.g. “^L” or “↡”) in a different colour.
Please provide any additional information below
“The form feed character is sometimes used in plain text files of source code as a delimiter for a page break, or as marker for sections of code.” — https://en.wikipedia.org/wiki/Page_break#Form_feed
“A logical line that contains only spaces, tabs, formfeeds and possibly a comment, is ignored” — https://docs.python.org/3/reference/lexical_analysis.html#blank-lines
Version and main components
- Spyder Version: 3.2.4
- Python Version: 3.6.4
- Qt Versions: 5.9.2, PyQt5 5.9.2 on Linux
Dependencies
pyflakes >=0.6.0 : 1.6.0 (OK)
pycodestyle >=2.3: 2.3.1 (OK)
pygments >=2.0 : 2.2.0 (OK)
pandas >=0.13.1 : 0.20.3 (OK)
numpy >=1.7 : 1.13.3 (OK)
sphinx >=0.6.6 : 1.6.5 (OK)
rope >=0.9.4 : 0.10.5 (OK)
jedi >=0.9.0 : 0.11.0 (OK)
psutil >=0.3 : 5.4.2 (OK)
nbconvert >=4.0 : 5.3.1 (OK)
sympy >=0.7.3 : 1.1.1 (OK)
cython >=0.21 : None (NOK)
qtconsole >=4.2.0: 4.3.1 (OK)
IPython >=4.0 : 6.2.1 (OK)
pylint >=0.25 : 1.7.4 (OK)
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (11 by maintainers)
Top GitHub Comments
Sorry, we’re pretty swamped and don’t have time to do your job. If you want your work integrated in Spyder, please open a pull request like everybody else.
In my opinion this is a bug. A formfeed character is not an end-of-line character. However, it is a very low priority issue for me because I don’t recall seeing formfeeds in Python source files.
I thought that closing as
wontfix
means we (as developers) don’t want to fix it. If we would consider pull requests, I think the bug should be kept open and perhaps given an appropriate label aswishlist
(which does not exist) orhelp wanted
(which does exist but is perhaps not so clear).