[Zope-dev] Zope2.7.0rc2 AttributeError: 'NoneType' object has no attribute 'setHeader'

2004-02-05 Thread Tony McDonald
Hi all,
We're in the process of migrating our sites to 2.7, so to get the guys 
up to speed we picked a site at random today. Did the 
/usr/local/zope/bin/mkzopeinstance.py jig (works very well), copied the 
Data.fs, some external methods, a Zwiki product and were good to go. 
This is from a Zope-2.6.1 site.

We found out that LocalFS needed updating, so found a 2.7 compatible 
version and installed that.
http://www.my-zope.org/Members/kedai/LocalFS-1-1-0.tgz/file_view

Now we have a very peculiar error, that I'm not posting to the Zope 
list as it's the RC2 version of Zope2.7 that we're using.

We have an index_html (initially DTML document, then tried method) that 
can be created (located at /prototype/myporfolio/index_html), have it's 
security settings changed quite happily. Then when the object is called 
we get the error in the subject line. The system specs are;

 Zope Version (2.7.0rc2, python 2.3.3, sunos5)
 Python Version 2.3.3 (#3, Jan 23 2004, 13:36:43) [GCC 2.95.3 20010315 
(release)]
 System Platform sunos5
 SOFTWARE_HOME /usr/local/zope/lib/python
 ZOPE_HOME /usr/local/zope

and the traceback is;

Traceback (innermost last):
  Module ZPublisher.Publish, line 100, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 40, in call_object
  Module Shared.DC.Scripts.Bindings, line 306, in __call__
  Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
  Module App.special_dtml, line 175, in _exec
  Module Shared.DC.Scripts.Bindings, line 320, in 
__render_with_namespace__
  Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
  Module App.special_dtml, line 175, in _exec
  Module DocumentTemplate.DT_Util, line 201, in eval
   - __traceback_info__: RESPONSE
  Module string, line 0, in ?
AttributeError: 'NoneType' object has no attribute 'setHeader'

I have never seen anything like this from Zope before (been using it 
since 1.0.3 so I've seen it do quite a bit! :).

I've looked through the zope-dev archives and can't find anything 
related (unless it's got something to do with manage_page_charset not 
being callable? The only thing I could find on the collector was issue 
381, http://collector.zope.org/Zope/381 'HEAD request method broken' - 
but that doesn't seem relevant in this condition.

*Any* thoughts would be gratefully received. To recap, we took a pretty 
plain 2.6.1 site, loaded it into 2.7.0rc2 and get the traceback 
above...

cheers
tone.
--
Dr Tony McDonald, Asst Director, FMSC. 0191 245 4223
Project Manager, FDTL-4 ePortfolios http://www.eportfolios.ac.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 )


Re: FW: [Zope-dev] strange behavior of VirtualHostMonster

2004-02-05 Thread Casey Duncan
On Wed, 4 Feb 2004 22:50:27 -0600
[EMAIL PROTECTED] wrote:

 Okay, I debugged a bit more:
  [u'loginUser', u'usermgrFolder', '/', 'VHM']  = this looks weird to
 me
 
 It seems it's pretty okay, however the last line in
 VirtualHostMonster.__bobo_traverse__ says:
 return parents.pop() # He'll get put back on
 
 Of course, the popped item is 'a', that's the one with the
 beforetraversal hook, so if it's really put back on later, than the
 hook will run again. I think this is the explanation, but the question
 remains: how can I avoid the second call to the beforetraverse hook?

I also ran into this problem recently with an extension I wrote to
CookieCrumber (which has a before traverse hook). It had the unfortunate
affect of working on my local machine (where I was not virtual hosted)
but not on the production box (which did). Luckily I had a test Zope
instance on the production box. The obvious lessons: you can't test too
much, when you're sure it works test it some more and always test in the
*exact* environment as production (in other words the actual production
boxen).

The way CC handles this issue is to set a flag on the REQUEST on the
first run and check for the flag on subsequent runs. Not elegant to be
sure, but workable.

It seems like at the very least this should be a documented feature of
VHM, if not a subtle bug.

-Casey

___
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] Minor windows intaller bug and a question

2004-02-05 Thread Chris McDonough
On Wed, 2004-02-04 at 08:55, Sergey Volobuev wrote:
 Hi all,
 
 Installing 2.7.0rc2 windows zope installer, i noticed that it uses 
 hard-coded value for instance directory. The proposed value is 
 C:\Zope-Instance. However, some users (me :) don't have C: drive. For 
 some reasons windows choose G: letter for boot drive and (unlike 
 not-boot drives) this letter can't be changed. Most installers 
 autodetect this situation but Zope installer not.

You can change the instance dir manually, no?  You mean it's a bug that
it doesn't detect your system drive and instead always uses C as the
default, right?  If so, yes, I agree, but likely it won't get fixed too
soon as it's so minor.

 And now the question: I want to make customized Zope installer. I.e. i 
 want to include some products, data in ZODB, etc. so i can give single 
 exe file to my customer, he will install it and get ready-to-work site 
 figurally in one click. Something like Plone installer did. So, are 
 there some guidelines how it can be done (howtos, docs, scripts, etc)? 
 Unfortunately, my expirience in making installers is limited to 
 InstallShield usage in mid 90th :(

This is very possible.  The way the ZC installer is built uses
http://cvs.zope.org/Packages/WinBuilders , and you could of course
change this around to make it suit you.  No howtos, but the code is
there.

- C



___
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] Minor windows intaller bug and a question

2004-02-05 Thread Lennart Regebro
From: Chris McDonough [EMAIL PROTECTED]
  Installing 2.7.0rc2 windows zope installer, i noticed that it uses
  hard-coded value for instance directory. The proposed value is
  C:\Zope-Instance. However, some users (me :) don't have C: drive. For
  some reasons windows choose G: letter for boot drive and (unlike
  not-boot drives) this letter can't be changed. Most installers
  autodetect this situation but Zope installer not.

 You can change the instance dir manually, no?  You mean it's a bug that
 it doesn't detect your system drive and instead always uses C as the
 default, right?  If so, yes, I agree, but likely it won't get fixed too
 soon as it's so minor.

I find the default value strange. The old installer put it into the program
files directory, which seem to me to be the reasonable place. Opinions on
this?


___
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] Minor windows intaller bug and a question

2004-02-05 Thread Tim Peters
[Chris McDonough, on the C:\Zope-Instance default]
 You can change the instance dir manually, no?  You mean it's a bug
 that it doesn't detect your system drive and instead always uses C
 as the default, right?  If so, yes, I agree, but likely it won't get
 fixed too soon as it's so minor.

The right drive letter is the value of InnoSetup's {sd} (system drive)
constant, but I don't know how to feed that into the Pascal code that sets
this up.

[Lennart Regebro]
 I find the default value strange. The old installer put it into the
 program files directory, which seem to me to be the reasonable place.
 Opinions on this?

PITA.  If you want to adhere to Windows standards, programs belong under
Program Files, but a Zope instance is more data so really belongs in some
confusing place like $WINDOWS_DIRECTORY\Application Data\Zope
Corporation\Zope-Instance\ (under an English version of Windows), or even
under a user-specific variant of that.

That makes it maximally difficult for you to find your data, and the
embedded spaces in the path make it maximally difficult for you to use
command-line tools too (e.g., maybe you want to do an fsdump on your
Data.fs).  I'd much rather have this stuff where it's easy to find, and easy
to use from a DOS box.  The installer *lets* you put it anywhere; the
default should favor ease of understanding and use.


___
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] Minor windows intaller bug and a question

2004-02-05 Thread Lennart Regebro
From: Chris McDonough [EMAIL PROTECTED]
 The old installer didn't create an instance home, it just created a
 software home.  The software home is still put into program files by the
 new installer.

Ah. Well, I'm not sure I think C:\ is such a good place for the default
anyway. I'll test things out and think about it, and maybe it get's
magically changed before 2.8. ;-)



___
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] Minor windows intaller bug and a question

2004-02-05 Thread Chris McDonough
On Thu, 2004-02-05 at 11:10, Lennart Regebro wrote:
 I find the default value strange. The old installer put it into the program
 files directory, which seem to me to be the reasonable place. Opinions on
 this?

The old installer didn't create an instance home, it just created a
software home.  The software home is still put into program files by the
new installer.

- C



___
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] Minor windows intaller bug and a question

2004-02-05 Thread Chris McDonough
On Thu, 2004-02-05 at 11:37, Tim Peters wrote:

 The right drive letter is the value of InnoSetup's {sd} (system drive)
 constant, but I don't know how to feed that into the Pascal code that sets
 this up.

I'm sure it's possible, I can probably figure it out.  I'll put it on my
todo list.

- C





___
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] Minor windows intaller bug and a question

2004-02-05 Thread Chris McDonough
On Thu, 2004-02-05 at 11:39, Lennart Regebro wrote:
 From: Chris McDonough [EMAIL PROTECTED]
  The old installer didn't create an instance home, it just created a
  software home.  The software home is still put into program files by the
  new installer.
 
 Ah. Well, I'm not sure I think C:\ is such a good place for the default
 anyway. I'll test things out and think about it, and maybe it get's
 magically changed before 2.8. ;-)

Do you mean that you don't think C:\Zope-Instance is a good default for
an instance home?  If so, I suppose I'd agree.  But I chose it because I
couldn't (and still can't) think of anything better.  As Tim said, we
could figure out the application data path, but as far as I can tell
no one really uses that or expects to actually find anything there, and
it's typically so verbose with so many path elements with spaces in them
that it would be painful to specify from the console, which for better
or worse, still needs to be used from time to time.

- C



___
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] Minor windows intaller bug and a question

2004-02-05 Thread Tim Peters
[Tim Peters]
 The right drive letter is the value of InnoSetup's {sd} (system
 drive) constant, but I don't know how to feed that into the Pascal
 code that sets this up.

[Chris McDonough]
 I'm sure it's possible, I can probably figure it out.  I'll put it on
 my todo list.

Staring at the docs, I think this Pascal expression:

ExpandConstant('xyz{sd}xyz')

would yield the string

xyzC:xyz

on my box today.  I don't have access to any box where the system drive
isn't C:, though -- PITA to test.


___
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] Zope2.7.0rc2 AttributeError: 'NoneType' object has no attribute 'setHeader'

2004-02-05 Thread Dieter Maurer
Tony McDonald wrote at 2004-2-5 12:43 +:
 ...
We have an index_html (initially DTML document, then tried method) that 
can be created (located at /prototype/myporfolio/index_html), have it's 
security settings changed quite happily. Then when the object is called 
we get the error in the subject line. The system specs are;
 ...
and the traceback is;

Traceback (innermost last):
 ...
   Module Shared.DC.Scripts.Bindings, line 320, in 
__render_with_namespace__
   Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
   Module App.special_dtml, line 175, in _exec
   Module DocumentTemplate.DT_Util, line 201, in eval
- __traceback_info__: RESPONSE
   Module string, line 0, in ?
AttributeError: 'NoneType' object has no attribute 'setHeader'

Looks like RESPONSE is None.

I do not see how this can happen...

Probably, I would start debugging.

-- 
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: Minor windows intaller bug and a question

2004-02-05 Thread Tres Seaver
Chris McDonough wrote:
On Thu, 2004-02-05 at 11:39, Lennart Regebro wrote:

From: Chris McDonough [EMAIL PROTECTED]

The old installer didn't create an instance home, it just created a
software home.  The software home is still put into program files by the
new installer.
Ah. Well, I'm not sure I think C:\ is such a good place for the default
anyway. I'll test things out and think about it, and maybe it get's
magically changed before 2.8. ;-)


Do you mean that you don't think C:\Zope-Instance is a good default for
an instance home?  If so, I suppose I'd agree.  But I chose it because I
couldn't (and still can't) think of anything better.  As Tim said, we
could figure out the application data path, but as far as I can tell
no one really uses that or expects to actually find anything there, and
it's typically so verbose with so many path elements with spaces in them
that it would be painful to specify from the console, which for better
or worse, still needs to be used from time to time.
Heh, we could just avoid the whole problem by using a 
WindowsRegistryStorage for the database :)

Tres.
--
===
Tres Seaver[EMAIL PROTECTED]
Zope Corporation  Zope Dealers   http://www.zope.com
___
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] Zope2.7.0rc2 AttributeError: 'NoneType' object has no attribute 'setHeader'

2004-02-05 Thread Tony McDonald
Thanks for the response Dieter,

On 5 Feb 2004, at 18:51, Dieter Maurer wrote:

Tony McDonald wrote at 2004-2-5 12:43 +:
...
We have an index_html (initially DTML document, then tried method) 
that
can be created (located at /prototype/myporfolio/index_html), have 
it's
security settings changed quite happily. Then when the object is 
called
we get the error in the subject line. The system specs are;
...
and the traceback is;

Traceback (innermost last):
...
  Module Shared.DC.Scripts.Bindings, line 320, in
__render_with_namespace__
  Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
  Module App.special_dtml, line 175, in _exec
  Module DocumentTemplate.DT_Util, line 201, in eval
   - __traceback_info__: RESPONSE
  Module string, line 0, in ?
AttributeError: 'NoneType' object has no attribute 'setHeader'
Looks like RESPONSE is None.

I do not see how this can happen...

Exactly! - this is why I said I'd never seen this before.

It's a 2.6.1 Data.fs that's been dropped into a stock 2.7.0rc2 release 
and I get this error.

I have no idea why this is happening, so I was hoping that it was an 
artifact of the 2.7.0rc2 release itself.

Probably, I would start debugging.

Quite likely, but I have *no* idea where to start with this. All the 
modules mentioned in the trackback are Zope supplied ones, not third 
party ones, so I'd assumed it might be the core software.

--
Dieter
once again, thanks for the reply Dieter.

tone.
--
Dr Tony McDonald, Asst Director, FMSC. 0191 245 4223
Project Manager, FDTL-4 ePortfolios http://www.eportfolios.ac.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: Zope2.7.0rc2 AttributeError: 'NoneType' object has no attribute 'setHeader'

2004-02-05 Thread Christian Heimes
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Dieter Maurer wrote:
~  Looks like RESPONSE is None.
|
| I do not see how this can happen...
aol / but a CMFPhoto user reported a bug like this to me today.
According to his traceback self.REQUEST had now attribute RESPONSE.
That's really strange. :(
Time 2004/02/05 07:16:58.953 US/Pacific
User Name (User Id) admin (admin)
Request URL
http://www.stewardville.com/photos/createObject
Exception Type AttributeError
Exception Value RESPONSE
Traceback (innermost last):

Module ZPublisher.Publish, line 98, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 39, in call_object
Module
Products.CMFFormController.FSControllerPythonScript,
line 87, in __call__
Module Products.CMFFormController.Script, line 127, in
__call__
Module Products.CMFCore.FSPythonScript, line 104, in
__call__
Module Shared.DC.Scripts.Bindings, line 306, in
__call__
Module Shared.DC.Scripts.Bindings, line 343, in
_bindAndExec
Module Products.CMFCore.FSPythonScript, line 160, in
_exec
Module None, line 16, in createObject
FSControllerPythonScript at
/stewardville/createObject used for
/stewardville/photos
Line 16
Module Products.CMFPlone.PloneFolder, line 373, in
invokeFactory
Module Products.CMFCore.TypesTool, line 709, in
constructContent
Module Products.CMFCore.TypesTool, line 398, in
constructInstance
Module Products.CMFPhoto.Photo, line 110, in addPhoto
Module Products.CMFPhoto.Photo, line 174, in __init__
Module Products.CMFDefault.Image, line 147, in
__init__
Module OFS.Image, line 124, in __init__
Module Products.CMFPhoto.Photo, line 400, in
update_data
Module Products.CMFPhoto.Photo, line 510, in
clearCache
AttributeError: RESPONSE
Used versions: Zope 2.6.4, Python 2.1.3, CMF
1.4.2, PIL 1.1.4, Plone 2.0-RC3.
Christian / Tiran
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Debian - http://enigmail.mozdev.org
iD8DBQFAIwAe9aLWrfOU0PgRAsKmAJ9tJiInLW1lCV1X7f8giidCoydKOgCfUP8e
ECBEAOJwkDuuTfBJx/xfsSM=
=4jZP
-END PGP SIGNATURE-
___
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 )