[Zope3-dev] Failure to load functional test - test_datetimewidget.py

Dave Harris dpharris76 at msn.com
Sun Jan 18 11:18:55 EST 2004


There I go again...rescuing Herbert [1].

The problem is not MS-DOS line endings.

The problem is that each line ends with _two_ carriage returns followed by a 
newline.

And I _know_ that's not normal.

Testing everyone's patience,
Dave Harris

[1] Another Monty Python reference, bound to appear in subsequent posts. In
'Monty Python and the Holy Grail', Launcelot jumps to a conventional 
conclusion
when ("Message for you, sir") he receives a request for assistance.



----- Original Message ----- 
From: "Dave Harris" <dpharris76 at msn.com>
To: "zope3-dev" <zope3-dev at zope.org>
Sent: Sunday, January 18, 2004 9:18 AM
Subject: [Zope3-dev] Failure to load functional test - 
test_datetimewidget.py


> I finally got through the unit tests (8 failures, 2 errors) under Windows 
> XP/mingw32 (effusive thanks to Tim Peters for the recent changes to 
> wrapper.c - worked great!).
>
> I decided to try the functional tests (for the first time) and directly 
> encountered a problem. While unittest is assembling the test suite, it 
> coughs up a syntax error in 
> src/zope/app/browser/form/ftests/test_datetimewidget.py:
>
> Traceback (most recent call last):
>   File "test.py", line 937, in ?
>     process_args()
>   File "test.py", line 927, in process_args
>     bad = main(module_filter, test_filter, libdir)
>   File "test.py", line 698, in main
>     runner(files, test_filter, debug)
>   File "test.py", line 616, in runner
>     s = get_suite(file)
>   File "test.py", line 521, in get_suite
>     mod = package_import(modname)
>   File "test.py", line 513, in package_import
>     mod = __import__(modname)
>   File 
> "D:\sf\Zope3\src\zope\app\browser\form\ftests\test_datetimewidget.py", 
> line 163
>     '<option value="(.*)" selected>*.</select>' % field
>     ^
> SyntaxError: invalid syntax
>
> As I reviewed the source file with 'vim', I saw MSDOS line endings - that 
> is, ^M at the end of each line. And the line identified in the traceback 
> is actually line 82 in the source file.
>
>         pattern = '<select .* name="field.%s".*>.*' \^M
>             '<option value="(.*)" selected>*.</select>' % field^M
>
> The source of the syntax error? The backslash is escaping only one of the 
> line termination characters which causes grief for the string 
> continuation.
>
> Of all the functional test files in Zope3, only those in 
> app/browser/form/ftests have the MSDOS line endings.
>
> Am I the only one seeing this failure? Are *nix testers having any 
> problems? Should all Zope3 files stick with the UNIX line-ending 
> convention of a single newline? I can strip the carriage returns myself 
> for now.
>
> [An aside: does unittest use readline() to build the test suite? If so, 
> should it be using 'U' recently introduced for PEP 278?]
>
> Snip, snip, back to testing,
> Dave Harris
> _______________________________________________
> Zope3-dev mailing list
> Zope3-dev at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-dev
> 



More information about the Zope3-dev mailing list