Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong line ending on python 3 + windows #135

Open
GoogleCodeExporter opened this issue Apr 18, 2015 · 0 comments
Open

Wrong line ending on python 3 + windows #135

GoogleCodeExporter opened this issue Apr 18, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

It seems that there is a bug in txt2tag on windows. Newlines are written as  
the ascii sequence 10 10 13 rather than 10 13. This makes all new lines become 
double new lines. 

It seems to be rooted in python 3 and its handling of newlines. The solution is 
simple but took me forever to figure out.


change the Savefile() to 

  def Savefile(file_path, contents):
    try:
      f = open(file_path, 'w', newline="\n") 

Essentially adding the newline="\n" argument



Original issue reported on code.google.com by spammer....@googlemail.com on 13 Jan 2012 at 10:05

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant