parser: fix CRLF(\r\n) file parsing error, SyntaxError: 'invalid syntax' by wetor · Pull Request #219 · go-python/gpython
Repository navigation
parser: fix CRLF(\r\n) file parsing error, SyntaxError: 'invalid syntax' - #219
Merged
ncw merged 1 commit into go-python:main from wetor:main Mar 14, 2023
Merged
parser: fix CRLF(\r\n) file parsing error, SyntaxError: 'invalid syntax' #219 ncw merged 1 commit into go-python:main from wetor:main
Conversation
wetor commented Mar 12, 2023
Copy link Copy Markdown
Contributor
The python file on the Windows platform may be in CRLF format. For example, git may convert the file to CRLF under Windows, resulting in parsing failure
parser: fix CRLF(\r\n) file parsing error, SyntaxError: 'invalid syntax'
42f20b7
ncw commented Mar 13, 2023
Copy link Copy Markdown
Collaborator
|
The fix looks reasonable to me. Can you link some docs showing .py files can end CR LF please? |
codecov
Bot
commented
Mar 13, 2023
Copy link Copy Markdown
Codecov ReportPatch coverage: Additional details and impacted files @@ Coverage Diff @@ ## main #219 +/- ## ======================================= Coverage 74.41% 74.42% ======================================= Files 76 76 Lines 12673 12675 +2 ======================================= + Hits 9431 9433 +2 Misses 2567 2567 Partials 675 675
Help us with your feedback. Take ten seconds to tell us how you rate us . Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry . |
wetor commented Mar 13, 2023
Copy link Copy Markdown
Contributor
Author
|
here https://docs.python.org/3.5/reference/lexical_analysis.html |
ncw commented Mar 14, 2023
Copy link Copy Markdown
Collaborator
|
The docs you linked are quite clear
So this should be done on any platform, so we don't need build tags. Also, theoretically, we should be looking at CR terminated lines. However that is a bigger change to the lexer, so let's not do that until someone requests it as I don't think macs have used CR terminated files for a very long time. I'll merge this now - thank you :-) |
652daef
into
go-python : main
Mar 14, 2023
Sign up for free
to join this conversation on GitHub .
Already have an account?
Sign in to comment