[Zope3-dev] Newish Windows test failures

Tim Peters tim at zope.com
Wed Jun 30 15:36:16 EDT 2004


[Marius Gedminas]
...
> Please try the following patch:
>
> Index: src/zope/tal/driver.py
> =================================================================== ---
> src/zope/tal/driver.py      (revision 26005) +++ src/zope/tal/driver.py
> (working copy) @@ -190,6 +190,7 @@
>      prefix = os.path.dirname(os.path.abspath(__file__)) + os.path.sep
>      if filename.startswith(prefix):
>          filename = filename[len(prefix):]
> +    filename = filename.replace(os.sep, '/') # test files expect slashes
>      if mode == "html":
>          from zope.tal.htmltalparser import HTMLTALParser
>          p = HTMLTALParser(gen=TALGenerator(source_file=filename, xml=0))

That indeed fixes those 7 test failures on Windows.

> An alternative solution is to change the filename computation (half of
> which is visible in the diff above) to a simple
>
>   filename = os.path.basename(file)
>
> then remove subdirs from test_sa*.xml files in src/zope/tal/output and
> forget about slashes at all.

That didn't come with a patch, so I didn't try that one <wink>.

Forward slashes don't confuse anyone on Windows (indeed, all Windows
functions that accept file paths treat forward and back slashes the same, in
or out of Python), so the simple one-liner is fine by me.  Please check it
in.




More information about the Zope3-dev mailing list