[Zope3-dev] Re: [Zope3-checkins] CVS: Zope3/src/zope/publisher - browser.py:1.7

Marius Gedminas mgedmin@codeworks.lt
Thu, 13 Feb 2003 09:39:50 +0200


On Thu, Feb 13, 2003 at 09:32:45AM +0200, Tres Seaver wrote:
> === Zope3/src/zope/publisher/browser.py 1.6 => 1.7 ===
> --- Zope3/src/zope/publisher/browser.py:1.6	Tue Feb 11 11:00:08 2003
> +++ Zope3/src/zope/publisher/browser.py	Thu Feb 13 00:06:24 2003
> @@ -19,7 +19,9 @@
>  import re
>  from types import ListType, TupleType, StringType, StringTypes
>  from cgi import FieldStorage, escape
> +from datetime import datetime
> 
> +from zope.app.datetimeutils import parse as parseDateTime
>  from zope.i18n.interfaces import IUserPreferredLanguages
>  from zope.i18n.interfaces import IUserPreferredCharsets
>  from zope.publisher.interfaces.browser import IBrowserPresentation

I thought modules outside zope.app weren't supposed to import anything
from zope.app.  This import creates a dependency loop and breaks unit
tests for our Zope3 product:

  >>> import zope.publisher.browser
  Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File "/home/users/mg/Zope3/src/zope/publisher/browser.py", line 24, in ?
      from zope.app.datetimeutils import parse as parseDateTime
    File "/home/users/mg/Zope3/src/zope/app/__init__.py", line 18, in ?
      from _app import config, Application
    File "/home/users/mg/Zope3/src/zope/app/_app.py", line 22, in ?
      from zope.publisher.browser import TestRequest
  ImportError: cannot import name TestRequest

I think zope.app.datetimeutils should be moved to zope.datetimeutils.

Marius Gedminas
-- 
Codeworks is available for Zope consulting -- http://www.codeworks.lt/