[Zope] Return code for Authentication error

2006-12-09 Thread Sébastien VINOT

Hello,

I try some tests with my zope (2.9.4-final on Debian) and Python about 
accessing private pages.


I'm using the examples on page 
http://www.voidspace.org.uk/python/articles/authentication.shtml with 
the HTTPBasicAuthentication. Unfortunately that does not work.


I set the View Permission to Member to one page. Of course I cannot 
access it if I'm not authenticated. I use the code below (extracted from 
the URL I gave above) but I only receive the Please login page.

How can I do ?

The code :

import urllib2

theurl = 'www.someserver.com/toplevelurl/somepage.htm'
protocol = 'http://'
username = 'johnny'
password = 'XX'
# a great password

passman = urllib2.HTTPPasswordMgrWithDefaultRealm()
# this creates a password manager
passman.add_password(None, theurl, username, password)
# because we have put None at the start it will always
# use this username/password combination for  urls
# for which `theurl` is a super-url

authhandler = urllib2.HTTPBasicAuthHandler(passman)
# create the AuthHandler

opener = urllib2.build_opener(authhandler)

urllib2.install_opener(opener)
# All calls to urllib2.urlopen will now use our handler
# Make sure not to include the protocol in with the URL, or
# HTTPPasswordMgrWithDefaultRealm will be very confused.
# You must (of course) use it when fetching the page though.

pagehandle = urllib2.urlopen(protocol + theurl)
# authentication is now handled automatically for us
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Export format documentation

2006-06-08 Thread Sébastien VINOT
Hello,

I have an export file of objects (that come from a Plone 2.0.5
instance). Unfortunately, the products are not compatible with a newer
Plone version. I'm building a new version of this product (but it will
be quite different from the initial one).

I'm wondering if it is possible to load datas for a zexp file without
the old product and then build new instances of my new product. That is
why I'd like to know if there is a good documentation concerning the
internal structure of zexp files.

Thanks in advance

Sebastien

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


RE : [Zope] Export format documentation

2006-06-08 Thread Sébastien VINOT


 -Message d'origine-
 De : Andreas Jung [mailto:[EMAIL PROTECTED] 
 Envoyé : jeudi 8 juin 2006 14:38
 À : Sébastien VINOT; zope@zope.org
 Objet : Re: [Zope] Export format documentation
 
 
 
 
 --On 8. Juni 2006 14:28:31 +0200 Sébastien VINOT 
 [EMAIL PROTECTED] wrote:
 
 
 
  I'm wondering if it is possible to load datas for a zexp 
 file without 
  the old product and then build new instances of my new 
 product. That 
  is why I'd like to know if there is a good documentation concerning 
  the internal structure of zexp files.
 
 The .zexp files are Python pickles. The XML generated through 
 export/import is basically an XML representation of the 
 Python pickle. The most straight 
 forward solution would be to write a migration script for 
 your stuff and 
 not to look into pickles...but you can of course follow the 
 pickle road if 
 you like it the hard way :-)
 
 -aj

You're right, I did not think about XML : thanks for the very good idea
!

Sebastien

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


RE : RE : [Zope] Export format documentation

2006-06-08 Thread Sébastien VINOT


 -Message d'origine-
 De : Andreas Jung [mailto:[EMAIL PROTECTED] 
 Envoyé : jeudi 8 juin 2006 14:48
 À : Sébastien VINOT; zope@zope.org
 Objet : Re: RE : [Zope] Export format documentation
 
 
 
 
 --On 8. Juni 2006 14:44:39 +0200 Sébastien VINOT 
 [EMAIL PROTECTED] wrote:
 
 
  
   I'm wondering if it is possible to load datas for a zexp
  file without
   the old product and then build new instances of my new
  product. That
   is why I'd like to know if there is a good documentation 
 concerning 
   the internal structure of zexp files.
 
  The .zexp files are Python pickles. The XML generated through 
  export/import is basically an XML representation of the Python 
  pickle. The most straight forward solution would be to write a 
  migration script for your stuff and
  not to look into pickles...but you can of course follow the
  pickle road if
  you like it the hard way :-)
 
  -aj
 
  You're right, I did not think about XML : thanks for the very good 
  idea !
 
 Possibly my reply wasn't clear enough. The pickle format 
 (binary or XML) 
 appears too low-level in order to write a reasonable 
 migration script. The recommended solution would be to write 
 a reasonable migration on the 
 application level based on your current data...
 
 -aj
 

That's right I misunderstood your answer. Thanks for your explanations.

Sebastien.

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


RE : [Zope] zope 2.8.5 becomes unresponsive.

2006-04-21 Thread Sébastien VINOT


 -Message d'origine-
 De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De 
 la part de Paul Winkler
 Envoyé : jeudi 20 avril 2006 15:30
 À : zope@zope.org
 Objet : Re: [Zope] zope 2.8.5 becomes unresponsive.
 
 
 On Thu, Apr 20, 2006 at 05:58:29AM -0700, Erik Myllymaki wrote:
  Environment is RHEL 3, Zope v2.8.5 (Python 2.3.5).
  
  Every couple of days the zope instance will become unresponsive and 
  require
  a restart. ZMI is inaccessible at these times so I have to 
 do run service 
  my_zope_service restart in the usual redhat way.
  
  There is nothing in the logs, and if I do service y_zope_service 
  status I
  am told program running; pid=22671
  
  This is a service under very light load.
  
  I viewed the chanelog for v2.8.6 and didn't see any changes that 
  address
  this, and for various reasons I do not want to move into 
 the v2.9.x builds.
  
  Any guidance appreciated.
 
 google for two things:
 zope deadlock debugger
 debug spinning zope
 
 -- 
 

Hello,

I've read documentation about deadlock and apparently the CPU usage
should be high, isn't it ? Because in my case the CPU usage is falling
to 0.0 (while the python process is still alive).

Sebastien

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