[Zope-dev] help identifying a structure inside Zope.

2001-10-23 Thread Anthony Baxter


I'm hunting for a very very obscure python-crashing bug on
Solaris with Zope2.4 on Python2.1.1. The structure that's 
getting corrupted looks something like:

 299, (300, (301, (302, (303, ( 304, ( 3, "c_o_s" ) ) ) ) ) ) 
(nested tuples)

I'm wondering if anyone can think of somewhere inside Zope that
generates this sort of structure? "c_o_s" is a string we use in
our code as a property, a database column, and a REQUEST variable.

As far as we can tell, it's not something being generated by
our code...

Thanks,
Anthony


--
Anthony Baxter <[EMAIL PROTECTED]>
It's never too late to have a happy childhood.


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



Re: [Zope-dev] BUG or FEATURE?

2001-10-23 Thread Andy McKay

Its the , that mucks up the namespace lookup for "value"




Doesnt work:, works: 



But with REQUEST is a rather wierd thing to do. Are you sure you want to do
that?

Cheers.
--
  Andy McKay.


- Original Message -
From: "R. David Murray" <[EMAIL PROTECTED]>
To: "Sidnei da Silva" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, October 23, 2001 3:15 PM
Subject: Re: [Zope-dev] BUG or FEATURE?


> On Tue, 23 Oct 2001, Sidnei da Silva wrote:
> > I dont know how it was supposed to work, but i think that if the REQUEST
was
> > immutable inside a dtml-with, it should be not allowed to call
REQUEST.set
> > inside it.
>
> It isn't immutable.  The second and subsequent sets should work.
>
> >  <== only works first
time it
>
> Well, I don't know quite what you are observing, but this code is broken.
> Inside the quotes you are in python mode, and 'sequence-item' in python
mode
> is the variable sequence minus the variable item.  Since it didn't throw
an
> error, you must have variables by those names that understand
substraction.
>
> Try _.getitem('sequence-item') instead.
>
> I suspect this thread belongs on zope, not zope-dev.
>
> --RDM
>
>
> ___
> Zope-Dev maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )
>


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



Re: [Zope-dev] Re: Install doesn't start properly

2001-10-23 Thread R. David Murray

On Mon, 22 Oct 2001, Martijn Pieters wrote:
> > First, actually, untarring as root sets the ownership of a lot of the
> > stuff in my solaris bindist to 506:100 (brian:users, it says in the
> > listing.)
>
> Default behaviour when using tar as root; it'll preserve the UID and GID of
> the person that created the tar.

Just FYI, this works "right" (IMO) under FreeBSD: files untarred as root are
owned by root unless you use the p flag.  Of course, this note only applies if
you are just handling this item via doc changes; if you have install do the
chown, it's moot.

--RDM


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



Re: [Zope-dev] Versions (still)

2001-10-23 Thread Andy McKay

> To my understanding, versions are implemented as long running transactions
> against the ZODB.  So I think to do anything with them you have to put in
> hooks at the level of the ZODB transaction machinery.  That might have
some
> interesting byproducts if you were to do it .  The zodb-dev list
> is probably the place to inquire

Hmmm. I'll give it a little while longer before I bug the gurus on
zodb-dev... :)

Cheers.
--
  Andy McKay.


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



Re: [Zope-dev] BUG or FEATURE?

2001-10-23 Thread R. David Murray

On Tue, 23 Oct 2001, Sidnei da Silva wrote:
> I dont know how it was supposed to work, but i think that if the REQUEST was
> immutable inside a dtml-with, it should be not allowed to call REQUEST.set
> inside it.

It isn't immutable.  The second and subsequent sets should work.

>  <== only works first time it

Well, I don't know quite what you are observing, but this code is broken.
Inside the quotes you are in python mode, and 'sequence-item' in python mode
is the variable sequence minus the variable item.  Since it didn't throw an
error, you must have variables by those names that understand substraction.

Try _.getitem('sequence-item') instead.

I suspect this thread belongs on zope, not zope-dev.

--RDM


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



Re: [Zope-dev] Versions (still)

2001-10-23 Thread R. David Murray

On Tue, 23 Oct 2001, Andy McKay wrote:
> and got into ZODB stuff I didnt understand. I would have thought having a
> little refactoring to give two more methods: getVersionContents and
> commitObject would be possible, but Im scratching my head at FileStorage
> now.

To my understanding, versions are implemented as long running transactions
against the ZODB.  So I think to do anything with them you have to put in
hooks at the level of the ZODB transaction machinery.  That might have some
interesting byproducts if you were to do it .  The zodb-dev list
is probably the place to inquire

---RDM


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



[Zope-dev] BUG or FEATURE?

2001-10-23 Thread Sidnei da Silva

Today i've got a problem with the dtml-with tag, as follows:

I was trying to set a variable, using REQUEST.set inside a dtml-in, inside a 
dtml-with, but it only works the first time i call REQUEST.set. Subsequent 
calls do not modify the variable, and do not raise an exception. Not even a 
simple error. 

I dont know how it was supposed to work, but i think that if the REQUEST was 
immutable inside a dtml-with, it should be not allowed to call REQUEST.set 
inside it.

Here goes some example code:


...
...

...
...


 <== only works first time it 
gets called and dont raise an error.
...
...


See ya!

-- 
Sidnei da Silva
X3ng Consultoria e Desenvolvimento Ltda.
[EMAIL PROTECTED]

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



Re: [Zope-dev] Versions (still)

2001-10-23 Thread Andy McKay

> And regrettably, the only idea I have come
> up with is copying attributes from one version into another, or
> disgusting things like that.  I haven't implemented anything because it
> sounds too icky, and I keep thinking there's gotta be a better way :)

You can actually search every object in the database to see if its in a
version. As you say "icky".

Cheers.
--
  Andy McKay.


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



Re: [Zope-dev] STX and underline symbology

2001-10-23 Thread Andreas Jung

Feel free to provide a patch and unittests *wink*

Andreas

- Original Message - 
From: "R. David Murray" <[EMAIL PROTECTED]>
To: "Alastair Burt" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, October 23, 2001 15:47
Subject: Re: [Zope-dev] STX and underline symbology


> On 19 Oct 2001, Alastair Burt wrote:
> >   1) there are no spaces in strings to underline, only more '_'
> >  (_this_is_an_example_), or
> 
> I'd vote for this.  I think it makes underlining more visual when reading
> the stx in text mode.
> 
> --RDM
> 
> 
> ___
> Zope-Dev maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )
> 


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



Re: [Zope-dev] STX and underline symbology

2001-10-23 Thread R. David Murray

On 19 Oct 2001, Alastair Burt wrote:
>   1) there are no spaces in strings to underline, only more '_'
>  (_this_is_an_example_), or

I'd vote for this.  I think it makes underlining more visual when reading
the stx in text mode.

--RDM


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



Re: [Zope-dev] Versions (still)

2001-10-23 Thread Tim McLaughlin

Andy McKay wrote:
> 
> So there I was in this discussion about Zope versioning (again) and there
> were two features requested that seemed perfectly reasonable at the time,
> 
> - to have a list of all the objects changed by a version
> - to be able to individually commit or discard changes in a version on a per
> object basis
> 
> This is would be extremely useful for those times when you forget to check
> out of a version and accidentally lock the root folder (This happens quite a
> bit). Simple I thought, but ugh versions go all the way down to FileStorage
> and got into ZODB stuff I didnt understand. I would have thought having a
> little refactoring to give two more methods: getVersionContents and
> commitObject would be possible, but Im scratching my head at FileStorage
> now.
> 
> Before I embark down this path is there an easier way?
> 
> Cheers.
> --
>   Andy McKay.
> 

This is something I've been thinking about (and inspecting code with
regard to) for a long time.  And regrettably, the only idea I have come
up with is copying attributes from one version into another, or
disgusting things like that.  I haven't implemented anything because it
sounds too icky, and I keep thinking there's gotta be a better way :)

Cheers,
Tim
-- 
Tim McLaughlin
iterationZERO - www.iterationzero.com
703.481.2233

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



Re: [Zope-dev] FYI: Zope version control project

2001-10-23 Thread Paul Everitt


We misfired on an Apache configuration and the Apache's weren't 
listening.  It should be back.

--Paul

Chris Withers wrote:

> Brian Lloyd wrote:
> 
>>Hi all -
>>
>>We've started a new fishbowl project to address version control
>>in Zope:
>>
>>http://dev.zope.org/Projects/Wikis/DevSite/Projects/ZopeVersionControl/
>>
> 
> Is dev.zope.org down?
> 
> Chris
> 
> ___
> Zope-Dev maillist  -  [EMAIL PROTECTED]
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )
> 




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



[Zope-dev] Versions (still)

2001-10-23 Thread Andy McKay

So there I was in this discussion about Zope versioning (again) and there
were two features requested that seemed perfectly reasonable at the time,

- to have a list of all the objects changed by a version
- to be able to individually commit or discard changes in a version on a per
object basis

This is would be extremely useful for those times when you forget to check
out of a version and accidentally lock the root folder (This happens quite a
bit). Simple I thought, but ugh versions go all the way down to FileStorage
and got into ZODB stuff I didnt understand. I would have thought having a
little refactoring to give two more methods: getVersionContents and
commitObject would be possible, but Im scratching my head at FileStorage
now.

Before I embark down this path is there an easier way?

Cheers.
--
  Andy McKay.





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



Re: [Zope-dev] FYI: Zope version control project

2001-10-23 Thread Chris Withers

Brian Lloyd wrote:
> 
> Hi all -
> 
> We've started a new fishbowl project to address version control
> in Zope:
> 
> http://dev.zope.org/Projects/Wikis/DevSite/Projects/ZopeVersionControl/

Is dev.zope.org down?

Chris

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



[Zope-dev] FYI: Zope version control project

2001-10-23 Thread Brian Lloyd

Hi all - 

We've started a new fishbowl project to address version control 
in Zope:

http://dev.zope.org/Projects/Wikis/DevSite/Projects/ZopeVersionControl/

It's still early in the process of initial artifacts, but we 
know that this is an issue dear to many hearts, so I wanted to 
let folks know about it as early as possible to get the feedback 
started on the initial proposal and risk list.


Brian Lloyd[EMAIL PROTECTED]
Software Engineer  540.361.1716   
Zope Corporation   http://www.zope.com


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



Re: [Zope-dev] Zope 2.4.2 Error

2001-10-23 Thread Matthew T. Kromer

E. Seifert wrote:

>Hi list,
>
>I just installed the 2.4.2 update over my Linux Zope 2.4.1 and I get the
>following traceback:
>
>Traceback (innermost last):
>[...]
>

>
>(Object: standard_html_header)
>  File /usr/local/zope/lib/python/Products/Renderable/Renderable.py, line
>17, in __str__
>(Object: standard_site_menue)
>  File /usr/local/zope/lib/python/OFS/DTMLMethod.py, line 195, in __call__
>(Object: render)
>  File /usr/local/zope/lib/python/DocumentTemplate/DT_String.py, line 546,
>in __call__
>(Object: render)
>  File /usr/local/zope/lib/python/DocumentTemplate/DT_In.py, line 770, in
>renderwob
>(Object: objectValues(['SimpleNav Element']))
>  File /usr/local/zope/lib/python/Products/Renderable/Renderable.py, line
>17, in __str__
>(Object: ab)
>  File /usr/local/zope/lib/python/OFS/DTMLMethod.py, line 203, in __call__
>(Object: render)
>KeyError: validate
>
>Is there someone who can help me?
>
>TIA
>Erich
>

Hi Erich,
 
Sorry it took me so long to read Zope-dev and see this question.

There's a section in lib/python/OFS/DTMLMethod.py which was changed in 
2.4.2 to accelerate DTML security processing, but it doesn't look like a 
subsequent patch to make it handle reentry was routed to 2.4 yet. 
 (Actually, I think it's waiting in a dev branch, because it's not on 
the trunk yet either.)  For the time being, what you can do is comment 
out both lines in DTMLMethod.py which read

self.__dict__['validate'] = security.DTMLValidate

and

   del self.__dict__['validate']

It looks like the renderable product you're using is causing the 
DTMLMethod to be reentered, which is tripping out this bug (ie you can 
only delete validate once -- the second time it fails).  


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



[Zope-dev] [Bug+Patch] Microseconds in DateTime

2001-10-23 Thread Nicola Larosa

[Sent to main list, ignored. Retrying here...]

The __str__ function in DateTime.DateTime cuts off two precision digits
from the time returned by time.time(), falling off to tenths of
milliseconds instead of keeping the microseconds.

If it feels unrighteous to put the hard work of gettimeofday() to waste,
apply the patch below to lib/python/DateTime/DateTime.py, and get back
that microsecond precision.

Yes, on some hardware/software platforms those microseconds are
significant, and yes, they can be useful in many situations.

Here is the patch.


--- DateTime.py Thu Jul 05 17:55:29 2001
+++ DateTime.py.NEW Mon Oct 22 16:00:36 2001
@@ -1558,11 +1558,11 @@
  y,m,d   =self._year,self._month,self._day
  h,mn,s,t=self._hour,self._minute,self._second,self._tz
  if(h+mn+s):
-if (s-int(s))> 0.0001:
+if (s-int(s)) >= 0.01:
  try:
  # For the seconds, print two digits
  # before the decimal point.
-subsec = split('%g' % s, '.')[1]
+subsec = split('%f' % s, '.')[1]
  return '%4.4d/%2.2d/%2.2d %2.2d:%2.2d:%2.2d.%s %s' % (
  y,m,d,h,mn,s,subsec,t)
  except:


-- 
Nicola Larosa - [EMAIL PROTECTED]


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



Re: [Zope-dev] IE and Zope MIME type handling

2001-10-23 Thread Oliver Bleutgen

> It is possible, as far as i know, to use the unix command "file -bi
> " and parse the returned result. It works very fine, but,
> unfortunatedly ;^)) just on Unix/Linux/*nix. Have read this on the [Zope]
> list and tested myself.

This is not quite correct,
http://sources.redhat.com/cygwin/

At least the cygwin UNIX for win environment includes
file(1). So this should work on any plattform
where zope works.

cheers,
oliver

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