Subject: [xml2rfc] #141: Line break characters are wrong

From: "xml2rfc issue tracker" <[email-masked]>
Date: Sat, 16 Mar 2013 02:07:28 -0000

#141: Line break characters are wrong

 On my Windows system I am getting the wrong line break characters written
 out.  Since this is using text files the line break character of '\n'
 should always be used and not os.linesep

-- 
------------------------------------+----------------------------------
 Reporter:  [email-masked]  |      Owner:  [email-masked]
     Type:  defect                  |     Status:  new
 Priority:  major                   |  Milestone:
Component:  Version 2 cli           |    Version:  2.4.x
 Keywords:  Line Breaks, Windows    |
------------------------------------+----------------------------------

Ticket URL: <http://tools.ietf.org/tools/xml2rfc/trac/ticket/141>
xml2rfc <http://tools.ietf.org/tools/xml2rfc/>

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Sun, 24 Mar 2013 14:39:13 -0000

Comment (by [email-masked]):

 Umm.  This needs some clarification -- as far as I know text-files on
 windows *do* use
 \r\n, which os.linesep should give.

 Did xml2rfc.tcl produce files with \r\n on Windows, or did it produce \n
 on all platforms?

-- 
-------------------------------------+----------------------------------
  Reporter:  [email-masked]  |      Owner:  [email-masked]
      Type:  defect                  |     Status:  new
  Priority:  major                   |  Milestone:
 Component:  Version 2 cli           |    Version:  2.4.x
Resolution:                          |   Keywords:  Line Breaks, Windows
-------------------------------------+----------------------------------

Ticket URL: <http://trac.tools.ietf.org/tools/xml2rfc/trac/ticket/141#comment:1>
xml2rfc <http://tools.ietf.org/tools/xml2rfc/>

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Sun, 24 Mar 2013 14:54:40 -0000

Changes (by [email-masked]):

 * priority:  major => medium

  Priority:  medium                  |  Milestone:

Ticket URL: <http://trac.tools.ietf.org/tools/xml2rfc/trac/ticket/141#comment:2>
xml2rfc <http://tools.ietf.org/tools/xml2rfc/>

---

From: "Jim Schaad" <[email-masked]>
Date: Sun, 24 Mar 2013 10:55:58 -0700

> -----Original Message-----
> From: [email-masked] [mailto:[email-masked]] On
> Behalf Of xml2rfc issue tracker
> Sent: Sunday, March 24, 2013 7:39 AM
> To: [email-masked]
> Cc: [email-masked]
> Subject: Re: [xml2rfc] #141: Line break characters are wrong
> 
windows
> *do* use  \r\n, which os.linesep should give.
> 
on
> all platforms?
> Ticket URL:
> <http://trac.tools.ietf.org/tools/xml2rfc/trac/ticket/141#comment:1>
> _______________________________________________
> xml2rfc mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/xml2rfc

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Sun, 24 Mar 2013 18:01:46 -0000

Comment (by [email-masked]):

 This is the difference between a  text output file and a binary output
 file.  A text output file will convert from \n to the correct line
 seperator on all platforms.  If you emit \n on Windows it is converted to
 \r\n for text files and not for binary files.  Thus emitting \r\n puts
 \r\r\n into the text file on windows.  This makes for more portable code
 as one only needs to thing about \n for both input and output if one is
 dealing with text files.

Ticket URL: <http://trac.tools.ietf.org/tools/xml2rfc/trac/ticket/141#comment:3>
xml2rfc <http://tools.ietf.org/tools/xml2rfc/>

---

From: Tom Taylor <[email-masked]>
Date: Sun, 24 Mar 2013 15:41:30 -0400

My routine has always been:

- use the web interface to XML2RFC
- use a binary editor to convert all instances of x0a to x0d x0a in the 
text file output.

So the web interface at least always produced /n only and still does.

Don't know if this is relevant.

Tom Taylor

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Sun, 24 Mar 2013 20:28:53 -0000

Ah.  So the current code outputs \r\r\n; ok, got it.  Will fix.

Ticket URL: <http://trac.tools.ietf.org/tools/xml2rfc/trac/ticket/141#comment:4>
xml2rfc <http://tools.ietf.org/tools/xml2rfc/>

---

From: "xml2rfc issue tracker" <[email-masked]>
Date: Sun, 24 Mar 2013 20:41:54 -0000

* status:  new => closed
 * resolution:   => fixed

Comment:

 Fixed in [831]:

 Changed os.linesep to '\n' when writing lines to text files.  The library
 takes care of doing the right thing on different platforms; writing
 os.linesep on the other hand will result in the file containing '\r\r\n',
 which is wrong.  Fixes issue #141.

-- 
-------------------------------------+----------------------------------
  Reporter:  [email-masked]  |      Owner:  [email-masked]
      Type:  defect                  |     Status:  closed
  Priority:  medium                  |  Milestone:
 Component:  Version 2 cli           |    Version:  2.4.x
Resolution:  fixed                   |   Keywords:  Line Breaks, Windows
-------------------------------------+----------------------------------

Ticket URL: </ticket/141#comment:5>
xml2rfc <http://tools.ietf.org/tools/xml2rfc/>