[Zope-dev] Running Zope tests in 2.7 fails

2004-08-20 Thread Lennart Regebro
I have finally realized that the way tests are run in 2.7 is different 
from earlier version of Zope, and I'm trying to get them to run.

It's Zope 2.7.2 on Debian. Python 2.3.4 and 2.3.2, so I guess 2.3.3 
would give the same error. Could it be a side effect of the compiling or 
something?


Here is the traceback:
Running unit tests from /home/regebro/Zopes/Zope-2.7.2-0
/home/regebro/Zopes/Zope-2.7.2-0/lib/python/DocumentTemplate/cDocumentTemplate.so: 
undefined symbol: PyUnicodeUCS4_DecodeLatin1
['/home/regebro/Zopes/Zope-2.7.2-0/lib/python', 
'/home/regebro/Zopes/Zope-2.7.2-0', '/usr/local/lib/python23.zip', 
'/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2', 
'/usr/local/lib/python2.3/lib-tk', 
'/usr/local/lib/python2.3/lib-dynload', 
'/usr/local/lib/python2.3/site-packages']
Traceback (most recent call last):
  File test.py, line 841, in ?
process_args()
  File test.py, line 831, in process_args
bad = main(module_filter, test_filter, libdir)
  File test.py, line 629, in main
files = find_tests(module_filter)
  File test.py, line 460, in find_tests
os.path.walk(walkdir, finder.visit, rx)
  File /usr/local/lib/python2.3/posixpath.py, line 290, in walk
walk(name, func, arg)
  File /usr/local/lib/python2.3/posixpath.py, line 290, in walk
walk(name, func, arg)
  File /usr/local/lib/python2.3/posixpath.py, line 282, in walk
func(arg, top, names)
  File test.py, line 439, in visit
__import__(pkg)
  File 
/home/regebro/Zopes/Zope-2.7.2-0/lib/python/AccessControl/__init__.py, 
line 16, in ?
import DTML
  File 
/home/regebro/Zopes/Zope-2.7.2-0/lib/python/AccessControl/DTML.py, 
line 18, in ?
from DocumentTemplate import DT_Util
  File 
/home/regebro/Zopes/Zope-2.7.2-0/lib/python/DocumentTemplate/__init__.py, 
line 22, in ?
from DocumentTemplate import String, File, HTML, HTMLDefault, HTMLFile
  File 
/home/regebro/Zopes/Zope-2.7.2-0/lib/python/DocumentTemplate/DocumentTemplate.py, 
line 112, in ?
from DT_String import String, File
  File 
/home/regebro/Zopes/Zope-2.7.2-0/lib/python/DocumentTemplate/DT_String.py, 
line 17, in ?
from DT_Util import ParseError, InstanceDict, TemplateDict, 
render_blocks, str
  File 
/home/regebro/Zopes/Zope-2.7.2-0/lib/python/DocumentTemplate/DT_Util.py, 
line 42, in ?
from cDocumentTemplate import InstanceDict, TemplateDict, \
ImportError: 
/home/regebro/Zopes/Zope-2.7.2-0/lib/python/DocumentTemplate/cDocumentTemplate.so: 
undefined symbol: PyUnicodeUCS4_DecodeLatin1

Any ideas why this is? The Zope in itself seems to work fine. I have a 
2.7.0 instance to, it also fails, but with a completely different error.

//Lennart
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Patch: let non-seekable streams be input for ZPublisher (updated)

2004-08-20 Thread Ames Andreas (MPA/DF)
Hi,

Andreas Ames wrote:

 next trial.  I hope I've got it straight now.

Not quite so (although this may only be nitpicking ;-).

fs_env = environ

should have read

fs_env = environ.copy()

obviously.  See attachment.


cheers,

andreas



--- lib.orig/python/ZPublisher/HTTPRequest.py	2004-08-18 16:37:18.0 +0200
+++ lib/python/ZPublisher/HTTPRequest.py	2004-08-20 13:07:25.0 +0200
@@ -60,6 +60,37 @@
 class NestedLoopExit( Exception ):
 pass
 
+FILELIST_ENV_ENTRY = 'request.filestorage.filelist'
+
+class ZFieldStorage(cgi.FieldStorage):
+\
+Tame the FieldStorage.
+
+This class overrides the stock implementation to add all file
+objects, generated while parsing a request, to a list.  This list
+is given by the caller.
+
+Unfortunately cgi.FieldStorage is not generic enough, to adapt the
+list of constructor parameters, by just deriving from it.  Thus
+the list is specified within the environ dict, given to the
+constructor.  This is ugly and could be fixed by a simple patch
+against cgi.FieldStorage.
+
+
+def __init__(self, fp=None, headers=None, outerboundary=,
+ environ=os.environ, keep_blank_values=0, strict_parsing=0):
+self._filelist = environ.get(FILELIST_ENV_ENTRY, [])
+cgi.FieldStorage.__init__(self, fp, headers, outerboundary,
+  environ, keep_blank_values,
+  strict_parsing)
+
+def make_file(self, binary=None):
+import tempfile
+res = tempfile.TemporaryFile(w+b)
+self._filelist.append(res)
+return res
+
+
 class HTTPRequest(BaseRequest):
 \
 Model HTTP request data.
@@ -125,10 +156,15 @@
 
 def retry(self):
 self.retry_count=self.retry_count+1
-self.stdin.seek(0)
+if not self._fs:# not really needed
+raise ValueError, Retrying on partially initialized request is not supported.  Call processInputs().
+for f in self._fs_filelist:
+f.seek(0)
 r=self.__class__(stdin=self.stdin,
  environ=self._orig_env,
- response=self.response.retry()
+ response=self.response.retry(),
+ fs = self._fs,
+ flist = self._fs_filelist
  )
 r.retry_count=self.retry_count
 return r
@@ -138,6 +174,8 @@
 # removing tempfiles.
 self.stdin = None
 self._file = None
+self._fs = None
+self._fs_filelist = None
 self.form.clear()
 # we want to clear the lazy dict here because BaseRequests don't have
 # one.  Without this, there's the possibility of memory leaking
@@ -237,7 +275,7 @@
 
 return self._client_addr
 
-def __init__(self, stdin, environ, response, clean=0):
+def __init__(self, stdin, environ, response, clean=0, fs=None, flist=None):
 self._orig_env=environ
 # Avoid the overhead of scrubbing the environment in the
 # case of request cloning for traversal purposes. If the
@@ -261,7 +299,11 @@
 self.steps=[]
 self._steps=[]
 self._lazies={}
-
+self._fs = fs
+if flist is None:
+self._fs_filelist = []
+else:
+self._fs_filelist = flist
 
 if environ.has_key('REMOTE_ADDR'):
 self._client_addr = environ['REMOTE_ADDR']
@@ -382,23 +424,26 @@
 taintedform=self.taintedform
 
 meth=None
-fs=FieldStorage(fp=fp,environ=environ,keep_blank_values=1)
-if not hasattr(fs,'list') or fs.list is None:
+if not self._fs:
+fs_env = environ.copy()
+fs_env[FILELIST_ENV_ENTRY] = self._fs_filelist
+self._fs=ZFieldStorage(fp=fp,environ=fs_env,keep_blank_values=1)
+if not hasattr(self._fs,'list') or self._fs.list is None:
 # Hm, maybe it's an XML-RPC
-if (fs.headers.has_key('content-type') and
-fs.headers['content-type'] == 'text/xml' and
+if (self._fs.headers.has_key('content-type') and
+self._fs.headers['content-type'] == 'text/xml' and
 method == 'POST'):
 # Ye haaa, XML-RPC!
 global xmlrpc
 if xmlrpc is None: import xmlrpc
-meth, self.args = xmlrpc.parse_input(fs.value)
+meth, self.args = xmlrpc.parse_input(self._fs.value)
 response=xmlrpc.response(response)
 other['RESPONSE']=self.response=response
 self.maybe_webdav_client = 0
 else:
-self._file=fs.file
+self._file=self._fs.file
 else:
-fslist=fs.list
+fslist=self._fs.list
 tuple_items={}
 lt=type([])
 CGI_name=isCGI_NAME

Re: [Zope-dev] Running Zope tests in 2.7 fails

2004-08-20 Thread Lennart Regebro
Lennart Regebro wrote:
I have finally realized that the way tests are run in 2.7 is different 
from earlier version of Zope, and I'm trying to get them to run.

It's Zope 2.7.2 on Debian. Python 2.3.4 and 2.3.2, so I guess 2.3.3 
would give the same error. Could it be a side effect of the compiling or 
something?
Ah. OK. if you run python test.py, it fails.
If you run bin/python test.py it works. Not exactly obvious...
And why is there a test.py in the root of the install, and one in the 
bin folder? Is there a difference?

//Still trying to get a hang on Zope 2.7 testing.
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] More unit test questions

2004-08-20 Thread Lennart Regebro
OK, I got test.py running. But if I run
   bin/python test.py Products
it will happily try to run the tests in all products. But if I type
   bin/python test.py Products/Productname
It will find no tests at all.
   bin/python test.py Products/Productname/tests
is no better.
BUT!
If I type
   bin/python test.py lib/python/Products/ZCTextIndex
it does find the tests for ZCTextIndex.
In short: Heuh? What are the difference that makes it impossible to test 
just one products unit test if it's located in Products instead of 
lib/python/Products. Or is there a difference in how the CMF tests are 
written? Anybody know?


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Patch: let non-seekable streams be input for ZPublisher (updated)

2004-08-20 Thread Dieter Maurer
Ames Andreas (MPA/DF) wrote at 2004-8-18 17:22 +0200:
I had a thinko in my previous patch
(http://mail.zope.org/pipermail/zope-dev/2004-August/023630.html)
which is corrected in the attached version of the patch.  Sorry for
any inconvenience, I might have caused.

I do not think that your patch can work:

  The FieldStorage must be rebuilt, because it can contain
  file objects. These file objects must be reset as they may
  have been (partially) read in the previous request.
  This prevent reusing the previous FieldStorage.

-- 
Dieter
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Zope 2.7.2, restrictedTraverse or hasattr

2004-08-20 Thread sureshvv
Why dont you try:

'myobject' in Object3.objectIds('meta_type_name')

HTH,  Suresh

Kai Hoppert [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi all,

i actually have a Problem with restrictedTraverse and hasattr.

Object1
Object2
Object3


I want to test if there exists a Object in Object3 wich has the same id and
meta type how Object2 (id=myobject).
so i ask

Object3.restrictedTraverse('myobject',None) or

hasattr(Object3,'myobject')

i every time get's true back. I know that he jump's to Object2. i testet
this with absolute_url, but this makes no sense i think. Either i never
noticed that this both funktions works in this way or it is a bug. If it is
no bug has anybody a solution for my problem?

Greetings

Kai Hoppert
___
tomcom Gesellschaft für Informationstechnologie mbH
Heuriedweg 14 | D-88131 Lindau
Fon +49 (0)8382 975844 | Fax +49 (0)8382 975855
[EMAIL PROTECTED] | http://www.tomcom.de

This document should only be read by those persons to whom it is addressed
and is not intended to be relied upon by any person without subsequent
written confirmation of its contents.  tomcom disclaims all responsibility
and accepts no liability for the consequences of any person acting, or
refraining from acting on the contents of this document.  Any unauthorised
form of dissemination, copying, disclosure, modification, distribution
and/or publication of this message is strictly prohibited. For information
about tomcom please contact us on +49.8382.975844 or visit our web site at
www.tomcom.de


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )



___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Zope-CMF] More unit test questions

2004-08-20 Thread Dieter Maurer
Lennart Regebro wrote at 2004-8-20 17:39 +0200:
OK, I got test.py running. But if I run
bin/python test.py Products

This should probably be:

 ... test.py --libdir Products

Note also, that test.py treats symbolic links in an unexpected
way (it resolves the path and may then no longer find its library).

-- 
Dieter
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Running Zope tests in 2.7 fails

2004-08-20 Thread Dieter Maurer
Lennart Regebro wrote at 2004-8-20 12:12 +0200:
 ...
line 42, in ?
 from cDocumentTemplate import InstanceDict, TemplateDict, \
ImportError: 
/home/regebro/Zopes/Zope-2.7.2-0/lib/python/DocumentTemplate/cDocumentTemplate.so: 
undefined symbol: PyUnicodeUCS4_DecodeLatin1

This means: cDocumentTemplate.so was build with a different Python
interpreter (one that uses UCS4 unicode) than you are using now
for your tests (one that uses UCS2 unicode).

Use the same Python interpreter both for generation as well
as testing.

-- 
Dieter
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Patch: let non-seekable streams be input for ZPublisher (updated)

2004-08-20 Thread Ames Andreas (MPA/DF)
Hi Dieter, *,

Dieter Maurer wrote:

   The FieldStorage must be rebuilt, because it can contain
   file objects. These file objects must be reset as they may
   have been (partially) read in the previous request.
   This prevent reusing the previous FieldStorage.

As you may have seen in my first patch proposal I actually tried to
address this problem, although halfbaken and buggy.  So here's the
next trial.  I hope I've got it straight now.

Why didn't I do something to reset the files, FiledStorage creates?

Because I thought it wouldn't be needed.  If you look at
cgi.FieldStorage you will see, that accessing FieldStorage's 'value'
field, will always reset the file before reading it and HTTPRequest's
'BODY' field does the same.

Cause of your hint I looked again and realised that I was wrong.
HTTPRquest's 'BODYFILE' field fails to reset the file before accessing
it (as in OFS/Image.py the File class does).  That could be easily
fixed.  What's worse is that FiledStorage can possibly create
subinstances of itsellf which can possibly contain other fileobjects.
This is the case for multipart-type requests.


How to solve this?

I can see three alternative aproaches:

1) In HTTPRequest.retry loop through self._fs.list (if it exists) and
   call seek(0) on every fileobject, you can find there.  This can
   only work if the maximum depth of the FiledStorage tree is
   predictable, which in turn depends on the possible input.  I don't
   know enough about the possible HTTP requests to determine such a
   limit or to even 'prove' its existance.

2) In HTTPRequest.retry recursively walk through the FieldStorage
   trees in self._fs.list (if it exists).  I wouldn't do that in
   Python without being able to predict the (worst case) number of
   function calls needed to do this recursion.  And without refreshing
   my knowledge of compiler techniques I wouldn't be able to roll the
   recursion out to a loop.

3) This is a somewhat drastic (and possibly conceived as hackish?)
   approach which OTOH is independent of the input and should perform
   quite well.  I overwrite cgi.FieldStorage, esp. its make_file
   method, such that it adds all fileobjects, that it creates, to a
   (possibly caller provided) list.  Thus the caller
   (i.e. HTTPRequest) has a list of all those fileobjects that need to
   be reset if the FieldStorage should be reused (as in ZPublisher's
   retries).

For the patch attached I chose the third approach.  Please let me
know, what you think about it.  If it is assessed to be ok I will
update the collctor item, I opened yesterday.


cheers,

andreas



--- lib.orig/python/ZPublisher/HTTPRequest.py	2004-08-18 16:37:18.0 +0200
+++ lib/python/ZPublisher/HTTPRequest.py	2004-08-19 17:42:31.0 +0200
@@ -60,6 +60,37 @@
 class NestedLoopExit( Exception ):
 pass
 
+FILELIST_ENV_ENTRY = 'request.filestorage.filelist'
+
+class ZFieldStorage(cgi.FieldStorage):
+\
+Tame the FieldStorage.
+
+This class overrides the stock implementation to add all file
+objects, generated while parsing a request, to a list.  This list
+is given by the caller.
+
+Unfortunately cgi.FieldStorage is not generic enough, to adapt the
+list of constructor parameters, by just deriving from it.  Thus
+the list is specified within the environ dict, given to the
+constructor.  This is ugly and could be fixed by a simple patch
+against cgi.FieldStorage.
+
+
+def __init__(self, fp=None, headers=None, outerboundary=,
+ environ=os.environ, keep_blank_values=0, strict_parsing=0):
+self._filelist = environ.get(FILELIST_ENV_ENTRY, [])
+cgi.FieldStorage.__init__(self, fp, headers, outerboundary,
+  environ, keep_blank_values,
+  strict_parsing)
+
+def make_file(self, binary=None):
+import tempfile
+res = tempfile.TemporaryFile(w+b)
+self._filelist.append(res)
+return res
+
+
 class HTTPRequest(BaseRequest):
 \
 Model HTTP request data.
@@ -125,10 +156,15 @@
 
 def retry(self):
 self.retry_count=self.retry_count+1
-self.stdin.seek(0)
+if not self._fs:
+raise ValueError, Retrying on partially initialized request is not supported.  Call processInputs().
+for f in self._fs_filelist:
+f.seek(0)
 r=self.__class__(stdin=self.stdin,
  environ=self._orig_env,
- response=self.response.retry()
+ response=self.response.retry(),
+ fs = self._fs,
+ flist = self._fs_filelist
  )
 r.retry_count=self.retry_count
 return r
@@ -138,6 +174,8 @@
 # removing tempfiles.
 self.stdin = None
 self._file = None
+self._fs = None
+self._fs_filelist = None
 self.form.clear()
 # we want 

Re: [Zope-dev] Re: Debian and Zope

2004-08-20 Thread Chris Withers
Hi Thaddeus,
Thaddeus H. Black wrote:
Please let me know if it doesn't show up
there...
I see your message there
[http://bugs.debian.org/251038] presently.
Cool, the bug's going to look a bit bloated due to the way the Zope 
Collector sends mails, but at least everyone will know where things are ;-)

might mention to them that Debian Zope has an
inactive maintainer and seems ripe for takeover.
Can you tell us who that maintainer is?
cheers,
Chris
--
Simplistix - Content Management, Zope  Python Consulting
   - http://www.simplistix.co.uk
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: Running Zope tests in 2.7 fails

2004-08-20 Thread Casey Duncan
IIRC this is caused by having a Python compiled without UCS4 support.
Some pre-built pythons that come with certain Linux distros (RedHat is
one I think) are built with different unicode support then the default.

I would suggest building your own python from source and trying it with
that instead.

-Casey

On Fri, 20 Aug 2004 12:12:31 +0200
Lennart Regebro [EMAIL PROTECTED] wrote:

 I have finally realized that the way tests are run in 2.7 is different
 
 from earlier version of Zope, and I'm trying to get them to run.
 
 It's Zope 2.7.2 on Debian. Python 2.3.4 and 2.3.2, so I guess 2.3.3 
 would give the same error. Could it be a side effect of the compiling
 or something?
 
 
 
 Here is the traceback:
 
 Running unit tests from /home/regebro/Zopes/Zope-2.7.2-0
 /home/regebro/Zopes/Zope-2.7.2-0/lib/python/DocumentTemplate/cDocumen
 tTemplate.so: undefined symbol: PyUnicodeUCS4_DecodeLatin1
 ['/home/regebro/Zopes/Zope-2.7.2-0/lib/python', 
 '/home/regebro/Zopes/Zope-2.7.2-0', '/usr/local/lib/python23.zip', 
 '/usr/local/lib/python2.3', '/usr/local/lib/python2.3/plat-linux2', 
 '/usr/local/lib/python2.3/lib-tk', 
 '/usr/local/lib/python2.3/lib-dynload', 
 '/usr/local/lib/python2.3/site-packages']
 Traceback (most recent call last):
File test.py, line 841, in ?
  process_args()
File test.py, line 831, in process_args
  bad = main(module_filter, test_filter, libdir)
File test.py, line 629, in main
  files = find_tests(module_filter)
File test.py, line 460, in find_tests
  os.path.walk(walkdir, finder.visit, rx)
File /usr/local/lib/python2.3/posixpath.py, line 290, in walk
  walk(name, func, arg)
File /usr/local/lib/python2.3/posixpath.py, line 290, in walk
  walk(name, func, arg)
File /usr/local/lib/python2.3/posixpath.py, line 282, in walk
  func(arg, top, names)
File test.py, line 439, in visit
  __import__(pkg)
File 
 /home/regebro/Zopes/Zope-2.7.2-0/lib/python/AccessControl/__init__.p
 y, line 16, in ?
  import DTML
File 
 /home/regebro/Zopes/Zope-2.7.2-0/lib/python/AccessControl/DTML.py, 
 line 18, in ?
  from DocumentTemplate import DT_Util
File 
 /home/regebro/Zopes/Zope-2.7.2-0/lib/python/DocumentTemplate/__init_
 _.py, line 22, in ?
  from DocumentTemplate import String, File, HTML, HTMLDefault,
  HTMLFile
File 
 /home/regebro/Zopes/Zope-2.7.2-0/lib/python/DocumentTemplate/Documen
 tTemplate.py, line 112, in ?
  from DT_String import String, File
File 
 /home/regebro/Zopes/Zope-2.7.2-0/lib/python/DocumentTemplate/DT_Stri
 ng.py, line 17, in ?
  from DT_Util import ParseError, InstanceDict, TemplateDict, 
 render_blocks, str
File 
 /home/regebro/Zopes/Zope-2.7.2-0/lib/python/DocumentTemplate/DT_Util
 .py, line 42, in ?
  from cDocumentTemplate import InstanceDict, TemplateDict, \
 ImportError: 
 /home/regebro/Zopes/Zope-2.7.2-0/lib/python/DocumentTemplate/cDocumen
 tTemplate.so: undefined symbol: PyUnicodeUCS4_DecodeLatin1
 
 
 Any ideas why this is? The Zope in itself seems to work fine. I have a
 
 2.7.0 instance to, it also fails, but with a completely different
 error.
 
 //Lennart
 
 ___
 Zope-Dev maillist  -  [EMAIL PROTECTED]
 http://mail.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists - 
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope )
 

___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: [Zope-CMF] More unit test questions

2004-08-20 Thread Lennart Regebro
Lennart Regebro wrote:
OK, I got test.py running. But if I run
   bin/python test.py Products
it will happily try to run the tests in all products. But if I type
   bin/python test.py Products/Productname
It will find no tests at all.
   bin/python test.py Products/Productname/tests
is no better.
Mööp! I was wrong. In fact, I have so far been completely unable to run 
any unit tests outside of lib/python with test.py.

Running bin/python test.py Products will run all tests in 
lib/python/Products. Hardly obvious I must say...


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Patch: let non-seekable streams be input for ZPublisher (updated)

2004-08-20 Thread Dieter Maurer
Ames Andreas (MPA/DF) wrote at 2004-8-19 18:04 +0200:
 ...
Cause of your hint I looked again and realised that I was wrong.
HTTPRquest's 'BODYFILE' field fails to reset the file before accessing
it (as in OFS/Image.py the File class does).  That could be easily
fixed.  What's worse is that FiledStorage can possibly create
subinstances of itsellf which can possibly contain other fileobjects.
This is the case for multipart-type requests.

Maybe, I have a much simpler solution:

  Something in ZServer makes all file fields seekable by
  delivering them through some temporary (either a StringIO
  or a temporary file).

  Maybe, you could do the same for your requests?

-- 
Dieter
___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )