Line ending handling broken on Win32 platform
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 459
- Forks
- 90
- PR merge metrics
- No merged PRs in 30d
Description
Migrated issue, originally created by Anonymous
Version 0.3.4
Line ending handling of templates is broken on Windows:
For each "CR-LF" sequence in the template file you get "CR-CR-LF" in the output.
This only happens when using the filename argument to Template.init(), not if the text argument is used to supply the template.
I think this is due to opening file with mode "rb" where mode "rU" should be used to automatically convert line endings to the correct internal format on all platforms.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Inspect the filename path in Template.init and compare it with the text argument path, focusing on the mentioned rb versus rU file-opening modes. Reproduce the issue with a CR-LF template on Windows and verify that the output preserves each line ending without adding an extra carriage return.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100