Skip to content

Remove extraneous CR characters from normalized code snippets.#2927

Merged
d3r3kk merged 3 commits into
microsoft:masterfrom
d3r3kk:2857_win_run_selection
Oct 17, 2018
Merged

Remove extraneous CR characters from normalized code snippets.#2927
d3r3kk merged 3 commits into
microsoft:masterfrom
d3r3kk:2857_win_run_selection

Conversation

@d3r3kk
Copy link
Copy Markdown

@d3r3kk d3r3kk commented Oct 17, 2018

Fix the normalizeForInterpreter.py script.

The script would split lines using os.linesep which on Windows is CRLF. On Windows, when Python detects any LF being written to stdout, it replaces it with CRLF. Therefore, our script was unintentionally causing CRCRLF to be written to stdout.

For #2857

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • Title summarizes what is changing
  • Has a news entry file (remember to thank yourself!)
  • Unit tests & system/integration tests are added/updated
  • package-lock.json has been regenerated by running npm install (if dependencies have changed)

- Replace any /r/r with /r
- Add comment calling the issue out for me to follow up with later.
- Correct fix is for the normalization python  script to be corrected.
@d3r3kk d3r3kk requested a review from DonJayamanne October 17, 2018 20:18
- Normalization script uses LF for splitting lines
  - Python replaces LF with CRLF when writing to stdout.
- codeExecution helper tests were not unit tests
  - they shell out to Python, unit tests don't do this.
- Remove hack-fix to correct output from normalization script.
Comment thread src/client/terminals/codeExecution/helper.ts Outdated
@d3r3kk d3r3kk merged commit d7a8f3a into microsoft:master Oct 17, 2018
@d3r3kk d3r3kk deleted the 2857_win_run_selection branch October 17, 2018 21:46
DonJayamanne pushed a commit that referenced this pull request Oct 18, 2018
Remove extraneous CR characters from normalized code snippets.

- Correct normalization python script to use LF instead of CRLF to split lines.
  - On windows, Python will inject CR whenever it sees an LF written to stdout.
  - This was the root cause of the CRCRLF coming back from normalization.
- Change helper.unit.test to helper.test, it shells out to Python and is not a unit test suite.
- Re-enable tests for helper.
@lock lock Bot locked as resolved and limited conversation to collaborators Jul 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants