Re: [Zope-dev] windows newslines in doctests

2010-01-11 Thread Chris Withers
Benji York wrote:
 Manuel 1.0.3 -- available on PyPI -- opens files in universal newline
 mode.  I hope that fixes your newline problem

Seems to have for now, I've removed my use of from 
zc.buildout.testing.normalize_endings and all tests still pass.

I'll let you know if I hit any other issues in this area...

thanks,

Chris

-- 
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] windows newslines in doctests

2010-01-06 Thread Benji York
Manuel 1.0.3 -- available on PyPI -- opens files in universal newline
mode.  I hope that fixes your newline problem
-- 
Benji York
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] windows newslines in doctests

2010-01-04 Thread Chris Withers
Benji York wrote:
 Manuel uses Python's doctest module for the actual work, but the file
 reading is done by Manuel itself.  I could switch to using universal new
 line mode, but since I haven't seen an example of a filing test I can't
 be sure if it'll help or not.

Easy way to test:

- create a doctest file on linux
- run unix2dos on it
- try runnng the test

Or, better yet, in Manuel's tests, have a file with svn:eol-style *not* 
set and make sure it has Windows line endings... or even manually write 
such a file as part of the Manuel tests...

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing  Python Consulting
 - http://www.simplistix.co.uk
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] windows newslines in doctests

2010-01-01 Thread Chris Withers
Benji York wrote:
 On Tue, Dec 29, 2009 at 2:15 PM, Chris Withers ch...@simplistix.co.uk wrote:
 Fred Drake wrote:
 It's interesting to note that Python 2.6's doctest doesn't use
 universal newlines, but zope.testing.doctest.
 
 Interestingly, the doctests I referred to in my original post were
 Manuel doctests, which (Benji, lemme know if I'm wrong...) use Python's
 doctest module rather than zope.testing's one, in which case I think you
  may have hit the nail precisely on the head...
 
 Manuel uses Python's doctest module for the actual work, but the file
 reading is done by Manuel itself.  I could switch to using universal new
 line mode, but since I haven't seen an example of a filing test I can't
 be sure if it'll help or not.

The problems I had were with tests originally authored on Windows, 
checked into svn without an svn:eol-style and then checked out on linux. 
The error message was about inconsistent line endings even though they 
were all consistent, just \r\n rather than \n. I had to dos2unix them 
and then add an svn:eol-style (which not all RCS support) to get things 
working properly...

Chris

-- 
Simplistix - Content Management, Batch Processing  Python Consulting
 - http://www.simplistix.co.uk
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] windows newslines in doctests

2009-12-31 Thread Benji York
On Tue, Dec 29, 2009 at 2:15 PM, Chris Withers ch...@simplistix.co.uk wrote:
 Fred Drake wrote:

 It's interesting to note that Python 2.6's doctest doesn't use
 universal newlines, but zope.testing.doctest.

 Interestingly, the doctests I referred to in my original post were
 Manuel doctests, which (Benji, lemme know if I'm wrong...) use Python's
 doctest module rather than zope.testing's one, in which case I think you
  may have hit the nail precisely on the head...

Manuel uses Python's doctest module for the actual work, but the file
reading is done by Manuel itself.  I could switch to using universal new
line mode, but since I haven't seen an example of a filing test I can't
be sure if it'll help or not.
-- 
Benji York
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] windows newslines in doctests

2009-12-29 Thread Chris Withers
Fred Drake wrote:
 
 It's interesting to note that Python 2.6's doctest doesn't use
 universal newlines, but zope.testing.doctest.

Good think we haven't just deprecated zope.testing.doctest and defecated
  on zope.testing in the process...

...oh wait.

Interestingly, the doctests I referred to in my original post were 
Manuel doctests, which (Benji, lemme know if I'm wrong...) use Python's 
doctest module rather than zope.testing's one, in which case I think you 
  may have hit the nail precisely on the head...

Chris

-- 
Simplistix - Content Management, Batch Processing  Python Consulting
 - http://www.simplistix.co.uk


___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] windows newslines in doctests

2009-12-28 Thread Chris Withers
Benji York wrote:
 On Mon, Dec 14, 2009 at 9:02 AM, Chris Withers ch...@simplistix.co.uk wrote:
 I've run into problems with Windows newlines in doctests a couple of
 times now and so thought I'd ask what people do in general to work
 around this...
 
 I don't think line ending problems happen very often.  I'd be interested
 in seeing a doctest that has problems.

I think if your development environment involves Windows checkouts, they 
happen more often that you'd like, especially when a single Windows 
developer doesn't have svn:eol-style set for all types that end up being 
doctests.

This becomes even more problematic if your source control system doesn't 
have any notion of platform-specific line endings.

 Do you:
 ...
 - something else I'm not aware of :-)
 
 Maybe NORMALIZE_WHITESPACE would help.

That normalizes *all* whitespace, whereas I'm really only concerned 
about whitespace...

Chris


-- 
Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] windows newslines in doctests

2009-12-28 Thread Fred Drake
On Mon, Dec 28, 2009 at 4:57 PM, Chris Withers ch...@simplistix.co.uk wrote:
 I think if your development environment involves Windows checkouts, they
 happen more often that you'd like, especially when a single Windows
 developer doesn't have svn:eol-style set for all types that end up being
 doctests.

It's interesting to note that Python 2.6's doctest doesn't use
universal newlines, but zope.testing.doctest.

With the recent move to use the standard library's doctest, we may be
seeing more of this.


  -Fred

-- 
Fred L. Drake, Jr.fdrake at gmail.com
Chaos is the score upon which reality is written. --Henry Miller
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] windows newslines in doctests

2009-12-14 Thread Chris Withers
Hi All,

I've run into problems with Windows newlines in doctests a couple of 
times now and so thought I'd ask what people do in general to work 
around this...

Do you:

- make sure .txt that ends up being doctested only has \n line endings 
in it?

- use zope.testing.renormalizing to replace \r\n with \n?

- something else I'm not aware of :-)

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing  Python Consulting
 - http://www.simplistix.co.uk
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] windows newslines in doctests

2009-12-14 Thread Benji York
On Mon, Dec 14, 2009 at 9:02 AM, Chris Withers ch...@simplistix.co.uk wrote:
 I've run into problems with Windows newlines in doctests a couple of
 times now and so thought I'd ask what people do in general to work
 around this...

I don't think line ending problems happen very often.  I'd be interested
in seeing a doctest that has problems.


 Do you:
...
 - something else I'm not aware of :-)

Maybe NORMALIZE_WHITESPACE would help.
-- 
Benji York
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )