Re: Strange behaviour with os.linesep

2013-07-24 Thread Terry Reedy
On 7/23/2013 7:41 PM, Dennis Lee Bieber wrote: On 23 Jul 2013 15:25:12 GMT, Steven D'Aprano declaimed the following: On Tue, 23 Jul 2013 13:42:13 +0200, Vincent Vande Vyvre wrote: On Windows a script where de endline are the system line sep, the files are open with a double line in Eric4, No

Re: Strange behaviour with os.linesep

2013-07-24 Thread Chris Angelico
On Wed, Jul 24, 2013 at 5:02 PM, Vincent Vande Vyvre wrote: > In fact, in my code, the original file is open in binary mode, the line > separator is translate to \n and it is parsed by the module tokenise. > > I'm not a Windows user but my code must be run also on Win, this is the > reason of the

Re: Strange behaviour with os.linesep

2013-07-24 Thread Vincent Vande Vyvre
Le 23/07/2013 17:25, Steven D'Aprano a écrit : On Tue, 23 Jul 2013 13:42:13 +0200, Vincent Vande Vyvre wrote: On Windows a script where de endline are the system line sep, the files are open with a double line in Eric4, Notepad++ or Gedit but they are correctly displayed in the MS Bloc-Notes.

Re: Strange behaviour with os.linesep

2013-07-23 Thread Steven D'Aprano
On Tue, 23 Jul 2013 13:42:13 +0200, Vincent Vande Vyvre wrote: > On Windows a script where de endline are the system line sep, the files > are open with a double line in Eric4, Notepad++ or Gedit but they are > correctly displayed in the MS Bloc-Notes. I suspect the problem lies with Eric4, Notep

Re: Strange behaviour with os.linesep

2013-07-23 Thread Jason Swails
On Tue, Jul 23, 2013 at 9:26 AM, Vincent Vande Vyvre < vincent.vandevy...@swing.be> wrote: > Le 23/07/2013 15:10, Vincent Vande Vyvre a écrit : > > The '\n' are in the original file. >> >> I've tested these other versions: >> >> --**- >> def write(): >> strings = [

Re: Strange behaviour with os.linesep

2013-07-23 Thread Vincent Vande Vyvre
Le 23/07/2013 15:10, Vincent Vande Vyvre a écrit : The '\n' are in the original file. I've tested these other versions: --- def write(): strings = ['# -*- coding: utf-8 -*-\n', 'import os\n', 'import sys\n'] with open('writetes

Re: Strange behaviour with os.linesep

2013-07-23 Thread Vincent Vande Vyvre
Le 23/07/2013 14:39, Jason Swails a écrit : On Tue, Jul 23, 2013 at 7:42 AM, Vincent Vande Vyvre mailto:vincent.vandevy...@swing.be>> wrote: On Windows a script where de endline are the system line sep, the files are open with a double line in Eric4, Notepad++ or Gedit but they

Re: Strange behaviour with os.linesep

2013-07-23 Thread Jason Swails
On Tue, Jul 23, 2013 at 7:42 AM, Vincent Vande Vyvre < vincent.vandevy...@swing.be> wrote: > On Windows a script where de endline are the system line sep, the files > are open with a double line in Eric4, Notepad++ or Gedit but they are > correctly displayed in the MS Bloc-Notes. > > Example with

Strange behaviour with os.linesep

2013-07-23 Thread Vincent Vande Vyvre
On Windows a script where de endline are the system line sep, the files are open with a double line in Eric4, Notepad++ or Gedit but they are correctly displayed in the MS Bloc-Notes. Example with this code: -- # -*- coding: utf-8 -*- import os L_SEP