Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Line ending handling broken on Win32 platform

Open
#150 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
backend

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.

Description

bug low priority

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.

Dominant language
Python
Stars
459
Forks
96
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sqlalchemy/mako

All issues in sqlalchemy/mako

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.