Re: [Zope-dev] ohloh listings

2011-09-11 Thread Sidnei da Silva
From that same page:


Please do not simply delete and re-add the enlistment. In most cases
this does not have any effect (our system will recognize the URL and
simply re-add the existing broken download), and it will complicate
our debugging efforts.


On Sat, Sep 10, 2011 at 6:32 PM, Chris McDonough chr...@plope.com wrote:
 Hanno,

 Could you delete and readd the failed repository enlistments at
 https://www.ohloh.net/p/zope/enlistments?page=13

 I think these are them:

 svn://svn.zope.org/repos/main/zope.schema/trunk
 svn://svn.zope.org/repos/main/zope.security/trunk

 They're preventing Zope stats on ohloh from getting updated regularly, I
 think.

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

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


[Zope-dev] ztk on pypy?

2011-01-11 Thread Sidnei da Silva
There's a pypy sprint going on in Switzerland next week:

  
http://codespeak.net/svn/pypy/extradoc/sprintinfo/leysin-winter-2011/announcement.txt

Just wondering if anyone has plans to attend it and push some ztk on
pypy goodness. I would gladly go, but personal issues prevent me from
doing so.

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


Re: [Zope-dev] lxml dependency in Zope 2.12.10 KGS

2010-09-12 Thread Sidnei da Silva
On Fri, Sep 10, 2010 at 8:45 AM, Martin Aspeli optilude+li...@gmail.com wrote:
 Hi,

 The Zope 2.12.10 KGS at
 http://download.zope.org/Zope2/index/2.12.10/versions.cfg specifies

  lxml = 2.2.6

 There is no Python 2.6 Windows build for this egg, which means that this
 version cannot be installed on Windows under Python 2.6. Version 2.2.4 is
 the latest version with safe binary eggs for all platforms.

 What in Zope depends on lxml? Why did we pin to 2.2.6?

Eggs for lxml 2.2.8 have been uploaded for Python 2.6, 2.7 and 3.1,
for 32 and 64 bits Windows. Enjoy.

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


Re: [Zope-dev] .lock files on Windows

2010-09-03 Thread Sidnei da Silva
On Fri, Sep 3, 2010 at 1:16 PM, Jim Pharis binbr...@gmail.com wrote:
 https://bugs.launchpad.net/collective.buildout/+bug/596839

 Killing a fg instance with ctrl-c isn't the only scenario where the lock and
 pid files don't get cleaned up.

I thought the problem was only the .pid file, not the .lock. Can you
confirm? The .lock file should go away if the process dies in any way,
but the .pid file seems to only be deleted on clean shutdown.

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


Re: [Zope-dev] RFC: ETag support for zope.browserresource

2010-08-10 Thread Sidnei da Silva
On Tue, Aug 10, 2010 at 12:42 PM, Marius Gedminas mar...@gedmin.as wrote:
 How would you like that to be configured?

 Option #1:

  browser:resource/resourceDirectory etags=off / ?

 Option #2:

  getMultiAdapter((resource, request), IETag).computeETag() ?

  This is maybe a bit problematic, because the actual File object that
  contains all the data--such as filename--doesn't implement any
  interfaces.  And neither does FileResource.


So maybe Option #1?

 I see that your implementation uses last-modified + size, which should
 generally be fine. However if you're load-balancing across two
 different servers and the timestamps don't match then the ETag is
 useless.

 Would you prefer a sha1 checksum?

As a default? I'd say last-modified + size is OK.

 On a completely different note, I see that the File object reads the
 whole file into memory.

 And it does that twice for every request that results in a 200 response:
 once to auto-detect the content-type, the second time to return the
 actual data.

Ouch. That sounds pretty bad. I thought it kept the data in-memory
(didn't look close enough at the source).

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


Re: [Zope-dev] RFC: ETag support for zope.browserresource

2010-08-09 Thread Sidnei da Silva
On Mon, Aug 9, 2010 at 3:25 PM, Marius Gedminas mar...@gedmin.as wrote:
 I've added ETag support for zope.browserresource in a branch:
 http://zope3.pov.lt/trac/changeset/115596

 Does anybody have any comments/objections?  If not, I'd like to merge
 this to trunk and release zope.browserresource 3.11.0.

+1 as long as there's a way to disable or configure how it's computed.
There's some information about issues with ETags here:

  http://developer.yahoo.com/performance/rules.html#etags

I see that your implementation uses last-modified + size, which should
generally be fine. However if you're load-balancing across two
different servers and the timestamps don't match then the ETag is
useless.

On a completely different note, I see that the File object reads the
whole file into memory. Hum. Maybe RAM is cheaper than Disk these days
and it doesn't matter, but reading whole files into memory generally
raises a red flag for me.

hoping-no-one-is-serving-iso-files-through-zope.browserresource-ly yours,

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


Re: [Zope-dev] Zope summit topics

2010-07-05 Thread Sidnei da Silva
On Mon, Jul 5, 2010 at 3:52 PM, Martijn Faassen faas...@startifact.com wrote:
 (But hurry.resource is not perfect; I think it'd be better to step out
 of Python land and create a Javascript packaging system somewhat modeled
 on Python's, with easy integration into Python projects. A sprint task?)

YUI 3's loader comes to mind (as its the one I have most experience with).

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


Re: [Zope-dev] All sponsored MSDN licenses received?

2010-06-15 Thread Sidnei da Silva
Has not arrived here. But then again Brazil is far away.

Em 15/06/2010 12:06, Christian Theune c...@gocept.comescreveu:

Hi,

at the meeting Adam said he has his copy of MSDN received. Did everybody
else who subscribed?

Christian

--
Christian Theune · c...@gocept.com
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 0 · fax +49 345 1229889 1
Zope and Plone consulting and development

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


Re: [Zope-dev] Summary (Was: Developer meeting today 15:30 UTC, Agenda attached)

2010-05-26 Thread Sidnei da Silva
FWIW, YES. It is possible to install the toolchains for 32-bit
alongside 64-bit. That's how it is setup in the AMI I provided.

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


Re: [Zope-dev] Summary (Was: Developer meeting today 15:30 UTC, Agenda attached)

2010-05-26 Thread Sidnei da Silva
On Wed, May 26, 2010 at 10:46 AM, Christian Theune c...@gocept.com wrote:
 Ok. That's cool. As you read we're currently looking into Rackspace as an
 alternative to Amazon. Do you have an idea whether there is a way to
 leverage your work on the AMI for that, too?

You'd basically have to reinstall everything. :) The only extra thing
I have is a bat file that sets the right environment variables.

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


[Zope-dev] [PATCH] zope.testing/zope.testrunner doesn't tearDown layers when running in parallel

2010-05-12 Thread Sidnei da Silva
I have a patch for the issue in the subject, which seems like mostly
an oversight than being by design.

Bug at:
  https://bugs.edge.launchpad.net/zope.testrunner/+bug/579019

There are two branches linked to the bug, one against zope.testrunner
and another against zope.testing. Would be nice to get some reviews.

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


Re: [Zope-dev] bug tracker gardening for bugday

2010-04-21 Thread Sidnei da Silva
On Wed, Apr 21, 2010 at 2:14 PM, Tres Seaver tsea...@palladion.com wrote:
 I have also tagged a bunch of other bugs (mostly those with patches)
 with the tag -- it would be good to adopt a culture where bugs with
 patches (or branches) never languish.

There's a view for that!:

  https://bugs.edge.launchpad.net/zopetoolkit/+patches

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


Re: [Zope-dev] Launchpad gardening

2010-04-16 Thread Sidnei da Silva
On Thu, Apr 15, 2010 at 9:40 PM, Tres Seaver tsea...@palladion.com wrote:
 Turns out not to be too tough, given the git and mercurial examples to
 stare at:

  lp:~tseaver/mr.developer/bzr_sources

 I have only tested it lightly so far, but it does seem at least to get
 the initial checkouts done using bzr (even against svn+ssh:// URLs!).

I tried to get this branch, but it depends on
lp:~tseaver/mr.developer/trunk, which hasn't been pushed to.

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


Re: [Zope-dev] Launchpad gardening

2010-04-15 Thread Sidnei da Silva
On Thu, Apr 15, 2010 at 12:17 PM, Tres Seaver tsea...@palladion.com wrote:
snip
 Finally, I push my branch up to Launchpad::

  $ bzr push lp:~tseaver/zope.interface/lp_12345

Once the branch is submitted to Launchpad, it is also possible to
create a Merge Proposal, which is a step up from a patch. Reviewers
can see a live diff on the Merge Proposal that gets updated every time
you do a new 'push'. Merge Proposals also have their own state.

There's a dashboard for keeping track of pending and approved Merge
Proposals, eg:

  https://launchpad.net/zopetoolkit/+activereviews

(the same exists for users: https://launchpad.net/~sidnei/+activereviews)

If you have bzrtools installed, you can use the 'bzr lp-submit'
command to create a Merge Proposal from the command line, IIRC.

It might seem like extra work at first, but once you get used to using
Merge Proposals to track work that's pending a merge it pays off very
quickly.

snip

 A branch made using 'bzr checkout' is bound to the SVN repository:
 commits are automatically pushed back to the master. When working in
 bzr, I really like the ability to batch up local commits, so I often
 create a local branch of the bound one, hack on it with multiple
 commits, and then push back to the bound branch.

That's how I work too, even with branches stored in bzr, by having a
'trunk' branch that is bound it saves you a few steps when merging
work back into the main tree. For people that prefer to be really
explicit, you can use 'bzr branch svn+ssh://...' instead of 'bzr
checkout' to create an unbound branch by default. You can also use
'bzr bind' and 'bzr unbind' to switch between bound and unbound.

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


Re: [Zope-dev] Launchpad gardening

2010-04-15 Thread Sidnei da Silva
 There's a dashboard for keeping track of pending and approved Merge
 Proposals, eg:

  https://launchpad.net/zopetoolkit/+activereviews

Not very useful since it's empty. Look at the pending proposals from
zc.buildout for a better example:

  https://edge.launchpad.net/zc.buildout/+activereviews

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


Re: [Zope-dev] Launchpad gardening

2010-04-15 Thread Sidnei da Silva
On Thu, Apr 15, 2010 at 12:41 PM, Leonardo Rochael Almeida
leoroch...@gmail.com wrote:
 Thanks Tres and Sidnei,

 My questions were intended to go to the list anyway.

 Can we take a branch from the launchpad mirror and bind it back
 directly at svn+ssh://svn.zope.org/ to commit?

 For instance, say I'm reviewing a bugfix proposed by someone that
 doesn't currently have access to svn.zope.org but added a
 merge-proposal to lp, can I branch it, bind it to
 svn+ssh://svn.zope.org and then commit?

 Wouldn't it be nice if it was possible?

Not sure if it would. What you really want to do is to merge the bzr
branch you got from Launchpad into the 'trunk' you got from
svn.zope.org, which behaves exactly as Tres described on his previous
email. Pushing the branch directly without merging first would
overwrite the contents of the target branch with the contents of the
pushed branch.

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


Re: [Zope-dev] Launchpad gardening

2010-04-15 Thread Sidnei da Silva
On Thu, Apr 15, 2010 at 2:27 PM, Tres Seaver tsea...@palladion.com wrote:
  - using externals to stitch together omnibus buildouts, e.g.
   CMF.buildout.  We could probably use something like
   'infrae.subversion' instead, maybe with a hook that allowed
   local customization of the command used to fetch the sub-checkout.

I'd recommend mr.developer then, if you haven't looked at it yet.

  http://pypi.python.org/pypi/mr.developer

I believe it *might* be using infrae.subversion under the covers,
though I'm not 100% confident. The nice thing it adds on top of that
is switching between a release version and a checkout in a single
command, IIRC.

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


Re: [Zope-dev] [PATCH] subunit output for zope.testing

2010-03-12 Thread Sidnei da Silva
On Fri, Mar 12, 2010 at 11:09 AM, Marius Gedminas mar...@gedmin.as wrote:
  On Thu, Mar 11, 2010 at 08:52:11PM +, Jonathan Lange wrote:
  === modified file 'src/zope/testing/testrunner/testrunner-leaks.txt'
  --- src/zope/testing/testrunner/testrunner-leaks.txt  2008-05-05 18:50:48 
  +
  +++ src/zope/testing/testrunner/testrunner-leaks.txt  2010-02-20 22:23:32 
  +
  @@ -16,7 +16,7 @@
        from zope.testing import testrunner
 
        sys.argv = 'test --layer Layer11$ --layer Layer12$ -N4 
  -r'.split()
  -     _ = testrunner.run(defaults)
  +     _ = testrunner.run_internal(defaults)
 
  I'm curious about this change.

 Sidnei explained it correctly. This particular file is only tested if
 you're running a Python with --with-pydebug set, so it's easy to miss
 when you make a change.

 Ah!  That explains why it wasn't fixed on trunk.

 (This bit should probably be committed separately.  And zope.testing
 could use a bit more continuous integration with various Python
 versions/build flags...)

I committed this change as a separate revision, and merged the rest of
the patch after that. I guess I should make a 3.9.0 release now. Any
objections?

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


Re: [Zope-dev] [PATCH] subunit output for zope.testing

2010-03-11 Thread Sidnei da Silva
Hi Jonathan,

On Thu, Mar 11, 2010 at 5:52 PM, Jonathan Lange j...@mumak.net wrote:
 Hello,

 For a long time, I've wanted to have a subunit output formatter for
 zope.testing. Subunit is a language-generic streaming protocol for
 test results. Once a test runner can display subunit output, it
 becomes much easier to write tools to process output programmatically.
 We want to use it in the Launchpad project for analyzing test results
 and for distributing our test runs across multiple machines. Other
 projects use it to get Hudson integration, or to glue their
 multi-language test suite into one result. More information on subunit
 can be found at http://launchpad.net/subunit.

 I've written a patch that adds subunit support to zope.testing by
 adding a new formatter object. The patch comes complete with tests and
 a willingness to jump through whatever legal hoops might be required
 to get it to land. The patch is attached, and can also be found as a
 merge proposal on Launchpad at
 https://code.edge.launchpad.net/~jml/zope.testing/subunit-output-formatter/+merge/19825

 I look forward to your replies.

The patch looks great to me, specially the testing coverage and the
fact it is completely optional to use subunit. Big +1 from me.

@Marius: re: run() vs run_internal(), the former would cause a
sys.exit() at some point, so run_internal() was added. I didn't spot
this change, but it looks fine to me.

I volunteer for commiting this patch and making a new major release,
if no one else volunteers.

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


Re: [Zope-dev] Moving Zope 2 downloads to LP

2009-09-21 Thread Sidnei da Silva
On Mon, Sep 21, 2009 at 5:41 PM, Chris Withers ch...@simplistix.co.uk wrote:
 Andreas Jung wrote:
 https://edge.launchpad.net/zope2

 My only concern is that the above url is veeeyy slloww.

If this URL timed out, it would be a problem.

 https://edge.launchpad.net/zope2/+download even timed out for me fully :-(

This URL shouldn't really be used, unless you're really curious and
want to see all releases all the way back to 2.0.0. Rather, the URL
for a series (https://launchpad.net/zope2/2.11) or for a specific
release (https://launchpad.net/zope2/+milestone/2.11.4-final) should
be used.

 What is edge? Will we always have these speed problems?

Edge runs the in-development, aka what is it going to look like in one
month from now, aka the next version of Launchpad and you shouldn't
generally use it, unless you're part of the Launchpad Beta Testers
team, in which case you get automatically redirected to it, or if you
want to try out in-development features, or someone cut-and-pasted the
URL and forgot to remove 'edge' from it. *wink*.

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


Re: [Zope-dev] Proposal: rip twisted integration out of Zope2

2009-09-18 Thread Sidnei da Silva
On Fri, Sep 18, 2009 at 1:23 PM, Andreas Jung li...@zopyx.com wrote:
 IIRC, the twisted integration code was added because Jim wanted us to
 get out of the server business.  At this point, I think that folks
 wanting an alternative to ZServer should focus on using WSGI to
 integrate with the server of their choice;  we should make that as easy
 / smooth as possible, and ditch the (undermaintained / icky / old)
 twisted integration.

 I totally agree with your observation and consider the Twisted integration
 as mission-failed. Nothing objections from my side. If you don't see
 objections by others, just go ahead.

IIRC, the twisted integration actually runs a WSGI server. But then
again, my memory fooled me more than once this week alone.

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


Re: [Zope-dev] ZTK test failures - zope.testing

2009-09-15 Thread Sidnei da Silva
Hi Hanno,

On Tue, Sep 15, 2009 at 6:42 PM, Hanno Schlichting ha...@hannosch.eu wrote:
 We are down to zero-build problems for the ZTK and just one test
 failure. This is in zope.testing in testrunner-layers-buff.txt.

That smells like something Gary has touched recently.

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


Re: [Zope-dev] Subversion externals versus mirroring

2009-09-09 Thread Sidnei da Silva
On Wed, Sep 9, 2009 at 10:35 AM, Jens Vagelpohlj...@dataflake.org wrote:
 SVN 1.4 clients will work with SVN 1.5 repositories in general. However,
 that's not the real issue here. The issue is the new-style externals
 definitions that allow you to use relative paths. Those relative paths
 will not work for SVN 1.4 clients.

Is that based on an assumption or someone tried and verified that it
doesnt work?

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


Re: [Zope-dev] chameleon.core removes the meta http-equiv=content-type tag

2009-09-09 Thread Sidnei da Silva
On Wed, Sep 9, 2009 at 9:13 AM, Malthe Borchmbo...@gmail.com wrote:
 Fabio Tranchitella wrote:
 I hope this is the right mailing list for such a question. Why does
 chameleon.core removes the meta tag http-equiv=content-type from the
 output?

 I have no idea why; I've asked Sidnei to clarify that particular
 changeset in Chameleon (although I suspect it was just carried over
 as-is from ``zope.pagetemplate``).

As far as I remember, it was just carried over as-is. Some (local)
tests that expected it to be gone were failing with chameleon.

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


Re: [Zope-dev] UnicodeDecodeError problems with Zope 2.12.0b4

2009-08-30 Thread Sidnei da Silva
Hi Charlie,

 I only know about it because I keep on it hitting it in Windows installs
 as there isn't a binary of 2.11 with the fix.

You mean the latest binary doesn't have the fix? Or you haven't seen
that a binary was released recently?

  http://www.zope.org/Products/Zope/2.11.4/

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


Re: [Zope-dev] Looking for volunteer: windows installer builder for zc.sourcerelease-based releases

2009-08-17 Thread Sidnei da Silva
On Fri, Aug 14, 2009 at 3:48 PM, Jim Fultonj...@zope.com wrote:
 I know there are people on this list who have experience building
 windows installers.

 It would be really great if someone who had some expertise building
 windows installers would work with me on a tool to build windows
 installers from source releases built with zc.sourcerelease.  I don't
 have the windows installer foo to do this by myself and am not willing
 to spend the time to get the foo.

 Such a tool would be very very handy.  For example, it could be used
 to build a windows installer for Zope 2.12 and for ZODB.

I'm interested in this, but relatively swamped at the moment attending a sprint.

I will add it to my TODO to ping you about it.

-- Sidnei
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] zope.testing 3.8 fails in mysterious ways

2009-07-30 Thread Sidnei da Silva
On Thu, Jul 30, 2009 at 9:33 PM, Martin Aspelioptilude+li...@gmail.com wrote:
 Unfortunately, I've got other packages that depend on a newer
 zope.testing (specifically, collective.testcaselayer). But I thought
 zope.testing aimed to be able to run any valid tests, so it sounds
 like a bug in zope.testing regardless, at least since every other test
 I've run in the same instance work fine.

The traceback you pasted shows an UnboundLocalError. What about
looking at the source and figuring out why that local variable is not
defined?

-- Sidnei
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Hg mirror available

2009-06-19 Thread Sidnei da Silva
Hi Wolfgang,

On Fri, Jun 19, 2009 at 2:43 AM, Wolfgang Schnerringw...@gocept.com wrote:
 Hi there,

 * Sidnei da Silva sidnei.da.si...@gmail.com [2009-06-18 14:28]:
  I'm asking because I noticed that basically all SVN-DVCS conversion
  tools (hg convert, git-svn, bzr svn-import, svn2bzr, svn-fast-export.py,
  svn-all-fast-export.cpp) do not convert the history properly, more
  precisely, history that happened on branches is lost:

 Here's some context about this from one of the Bazaar developers, John
 Arbash Meinel. Hopefully that will solve some of your questions?

 Thanks for relaying!

 I'm not really sure what he means by edit and then merge without a
 commit inbetween. So I'm assuming there is one.

 Sorry for being overly brief in my description; please find below a
 sample shell script to set up a Subversion repository with a project
 containing a trunk and a branch. To reproduce the problem I'm
 concerned about, do this:

 $ create-repos.sh repos
 $ svn log repos/project/trunk/feature.txt
 
 r9 | wosc | 2009-06-18 17:11:46 +0200 (Thu, 18 Jun 2009) | 1 line

 merged feature1
 
 r8 | wosc | 2009-06-18 17:11:43 +0200 (Thu, 18 Jun 2009) | 1 line

 implemented feature1
 

 As you can see, Subversion reports the history of the file that
 happenened on the branch (in r8).

Can you show us your 'svn --version'? I suspect what you're seeing is
a result of svn 1.5 merge tracking.

 After converting the repository, however...

 $ bzr init-repo repos-bzr
 $ cd repos-bzr
 $ bzr svn-import file://$PWD/../repos
 $ bzr log repos/project/trunk/feature.txt
 
 revno: 3
 svn revno: 9 (on /project/trunk)
 committer: wosc
 timestamp: Thu 2009-06-18 14:11:46 +
 message:
  merged feature1

 ... this history is lost. Not only does it not appear in the log
 output, also when looking at bzr visualize it seems like that branch
 never existed at all in bzr. (I'm new to bzr, am I missing something
 here?)

Like John said, it *should* be possible to bring that information over
if the svn repository is in 1.5 format and contains informations about
merge, but at the moment that (apparently) hasn't been implemented.

-- 
Sidnei da Silva
Canonical Ltd.
 Landscape · Changing the way you manage your systems
http://landscape.canonical.com
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Hg mirror available

2009-06-18 Thread Sidnei da Silva
Hi Wolfgang,

On Thu, Jun 18, 2009 at 7:31 AM, Wolfgang Schnerringw...@gocept.com wrote:
 * Sebastien Douche sdou...@gmail.com [2009-06-18 01:34]:
 This is a first attempt to build an Mercurial mirror :
 http://hg.zope.mirrors.securactive.org/

 How did you convert the repository?

 I'm asking because I noticed that basically all SVN-DVCS conversion
 tools (hg convert, git-svn, bzr svn-import, svn2bzr, svn-fast-export.py,
 svn-all-fast-export.cpp) do not convert the history properly, more
 precisely, history that happened on branches is lost:

 1. import /trunk/foo.txt
 2. branch /trunk to /branches/mybranch
 3. edit /mybranch/foo.txt
 4. merge /mybranch to /trunk

 If you now ask svn for the history of /trunk/foo.txt (say with 'svn
 log'), you see both steps 3 and 4. After conversion to a DVCS with one
 of the above mentioned tools, you only see step 4, while step 3 never
 happened in the DVCS repository. I think that's unacceptable, most
 importantly because all commit messages that happened on branches are
 lost that way.

 Does somebody here know something about this phenomenon, by any chance?
 Am I missing something?

Here's some context about this from one of the Bazaar developers, John
Arbash Meinel. Hopefully that will solve some of your questions?


In pretty much all dvcs merging a content exactly back to trunk does not
generate a change message when doing bzr log foo.txt.

I'm not really sure what he means by edit and then merge without a
commit inbetween. So I'm assuming there is one.

Now, what really matters is whether or not *Subversion* recorded 4
correctly, such that it can actually see that it was a merge from 3.

My understanding is that before svn 1.5 that isn't possible. So you are
left with trying to infer that sort of thing from the history. Which
would be possible, but probably expensive.

I'm pretty sure SVN represents (4) as not a *merge* but as an indentical
commit.

I don't have a great answer there. Though the fact that Wolfgang says
svn shows both... I suppose because svn log shows everything across
all branches?


-- 
Sidnei da Silva
Canonical Ltd.
 Landscape · Changing the way you manage your systems
http://landscape.canonical.com
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Mailinglist for Zope 2 bugs!?

2009-05-17 Thread Sidnei da Silva
On Sun, May 17, 2009 at 3:15 AM, Jens Vagelpohl j...@dataflake.org wrote:
 Same here. There is no reason for yet another mailing list. I see it
 as needlessly duplicating what Launchpad already does.

So should we backtrack and undo the change to the zope-dev team which
made it send messages to the publicly-open zope2-tracker mailing list?

-- 
Sidnei da Silva
Canonical Ltd.
 Landscape · Changing the way you manage your systems
http://landscape.canonical.com
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Mailinglist for Zope 2 bugs!?

2009-05-16 Thread Sidnei da Silva
Now for another question: how do people feel about moving Zope 3 and
CMF bugs to a similar setup. That is, bug mail goes to a separate
mailing list instead of directly to everyone that's a member of the
teams in Launchpad.

On Thu, May 14, 2009 at 1:13 PM, Andreas Jung li...@zopyx.com wrote:

 All Zope 2 tracker notifications go now all to a new
 mailinglist:

 http://mail.zope.org/mailman/listinfo/zope2-tracker

 Notification mails will no longer be send to the individual
 members of the Zope 2 team @ Launchpad.

 People interested in bugtracker notifications must subscribe
 to the list above

 Thanks to Sidnei and Jens for helping.

 Andreas

 On 13.05.09 16:51, Andreas Jung wrote:
 On 12.05.09 16:49, Sidnei da Silva wrote:


 That's not needed. Since the zope2-dev team is automatically
 subscribed to issues, we only need to set it's contact address. If we
 set that address to zope-...@lists.zope.org, then issues will
 automatically be delivered to it.




 Based on yesterdays discussion, I propose to setup a new mailman
 list 'zope2-trac...@zope.org' (or propose a better name) that will be
 added as primary contact address of the Zope 2 team @ Launchpad.

 So anyone can subscribe to Zope 2 ticket changes without having
 to be a member of the Zope 2 team.


 Objections?

 Andreas



 

 ___
 Zope-Dev maillist  -  zope-...@zope.org
 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 )



 --
 ZOPYX Ltd.  Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany
 Web: www.zopyx.com - Email: i...@zopyx.com - Phone +49 - 7071 - 793376
 Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535
 Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK
 
 E-Publishing, Python, Zope  Plone development, Consulting



 ___
 Zope-Dev maillist  -  zope-...@zope.org
 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 )





-- 
Sidnei da Silva
Canonical Ltd.
 Landscape · Changing the way you manage your systems
http://landscape.canonical.com
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Mailinglist for Zope 2 bug!?

2009-05-13 Thread Sidnei da Silva
On Wed, May 13, 2009 at 11:46 AM, Andreas Jung andr...@andreas-jung.com wrote:
 So anyone can subscribe to Zope 2 ticket changes without having
 to be a member of the Zope 2 team.

Works for me.

-- 
Sidnei da Silva
Canonical Ltd.
 Landscape · Changing the way you manage your systems
http://landscape.canonical.com
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] [Zope-Checkins] SVN: Zope/trunk/ merged haufe-legacy-integration branch

2009-05-12 Thread Sidnei da Silva
On Tue, May 12, 2009 at 10:25 AM, Chris Withers ch...@simplistix.co.uk wrote:
 The problem is that the visibility of issues in Launchpad is very poor.
 You can't even get notifications of bugs unless you're part of the
 development team. Using it for features means that no-one in the wider
 community is likely to even know what's going on. That's bad as it means
 that no-one gets the opportunity to make suggestions or comments. This
 could be improved by getting issue emails sent to this list too, is that
 possible?

Yes, that is possible. But I fear this list might not be the most
appropriate place. Maybe we should revive the 'zope-collector' mailing
list (or am I dreaming that such a list ever existed?)

-- 
Sidnei da Silva
Canonical Ltd.
 Landscape · Changing the way you manage your systems
http://landscape.canonical.com
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] [Zope-Checkins] SVN: Zope/trunk/ merged haufe-legacy-integration branch

2009-05-12 Thread Sidnei da Silva
On Tue, May 12, 2009 at 11:37 AM, Andreas Jung andr...@andreas-jung.com wrote:
 I *think* there was such a list. LP provides mailinglist support for
 for each group

 https://launchpad.net/~zope2-dev

That's an option, creating a mailing list for the team. However it's
not required. See below.

 but I see no option for using such a list for tracker notifications.

 I suggest to add a pseudo member to the Zope 2 dev team and configure its
 mail address to some new mailman list on lists.zope.org

That's not needed. Since the zope2-dev team is automatically
subscribed to issues, we only need to set it's contact address. If we
set that address to zope-...@lists.zope.org, then issues will
automatically be delivered to it.

-- 
Sidnei da Silva
Canonical Ltd.
 Landscape · Changing the way you manage your systems
http://landscape.canonical.com
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] [Zope-Checkins] SVN: Zope/trunk/ merged haufe-legacy-integration branch

2009-05-12 Thread Sidnei da Silva
On Tue, May 12, 2009 at 12:06 PM, Andreas Jung li...@zopyx.com wrote:
 Will do - after having the URL for the Join link.

https://launchpad.net/~zope2-dev/+join

-- 
Sidnei da Silva
Canonical Ltd.
 Landscape · Changing the way you manage your systems
http://landscape.canonical.com
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] [Zope-Checkins] SVN: Zope/trunk/ merged haufe-legacy-integration branch

2009-05-12 Thread Sidnei da Silva
On Tue, May 12, 2009 at 11:58 AM, Chris Withers ch...@simplistix.co.uk wrote:
 It took me ages to figure out how to do this, and I still couldn't tell
 you how to do it now. Launchpad has an *extremely* poor UI here, what
 would be so hard about having a request to join this team link
 somewhere prominently on the team page?

It's visible enough to me right there were it is?

I can understand your complaint though. That page was changed recently
to show more information. You can see from the screenshot on this page
that there used to be a Big Green Button in the page for joining the
team:

https://help.launchpad.net/Teams/Joining

-- 
Sidnei da Silva
Canonical Ltd.
 Landscape · Changing the way you manage your systems
http://landscape.canonical.com
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] [Zope-Checkins] SVN: Zope/trunk/ merged haufe-legacy-integration branch

2009-05-12 Thread Sidnei da Silva
On Tue, May 12, 2009 at 12:08 PM, Chris Withers ch...@simplistix.co.uk wrote:
 Sidnei da Silva wrote:

 On Tue, May 12, 2009 at 12:06 PM, Andreas Jung li...@zopyx.com wrote:

 Will do - after having the URL for the Join link.

 https://launchpad.net/~zope2-dev/+join

 And where, exactly, are you supposed to find that?!

Obviously it's not visible anymore once you *are* a member of a team.
For an example of what it looks like when you're not a member of a
team, see this screenshot:

  http://www.ubuntu-pics.de/bild/14102/screenshot_027_8l3CD1.png

To me the link is perfectly clear there, with a green '+' icon and all.

-- 
Sidnei da Silva
Canonical Ltd.
 Landscape · Changing the way you manage your systems
http://landscape.canonical.com
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] [Zope-Checkins] SVN: Zope/trunk/ merged haufe-legacy-integration branch

2009-05-12 Thread Sidnei da Silva
On Tue, May 12, 2009 at 12:12 PM, Chris Withers ch...@simplistix.co.uk wrote:
 Huh? I can't tell for zope2-dev as I'm a member, but I see no big green
 button here:

 https://edge.launchpad.net/~launchpad-dev

Chris, please slow down and read the *whole* message and also my other
replies. I can't keep up with your speed, and you you're just causing
a lot of extra communication overhead by not reading what I'm writing
and quickly replying with short messages. This is not IRC/IM.

Thanks!

-- 
Sidnei da Silva
Canonical Ltd.
 Landscape · Changing the way you manage your systems
http://landscape.canonical.com
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] [Zope-Checkins] SVN: Zope/trunk/ merged haufe-legacy-integration branch

2009-05-12 Thread Sidnei da Silva
On Tue, May 12, 2009 at 12:25 PM, Chris Withers ch...@simplistix.co.uk wrote:
 I'm reading everything you're writing. What do you think I missed?

You said:

 Huh? I can't tell for zope2-dev as I'm a member, but I see no big green
 button here:

And the original message said:


That page was changed recently
to show more information. You can see from the screenshot on this page
that there used to be a Big Green Button in the page for joining the
team:

https://help.launchpad.net/Teams/Joining


That means you didn't read the whole message, and no matter how much
effort I spend in explaining this to you, if you don't read the whole
message then it's worthless.

 Are zope2-dev or zope3-dev similarly restricted teams?
 If so, how do people find out how to join a restricted team?

See Andreas' reply.

-- 
Sidnei da Silva
Canonical Ltd.
 Landscape · Changing the way you manage your systems
http://landscape.canonical.com
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] [Zope-Checkins] SVN: Zope/trunk/ merged haufe-legacy-integration branch

2009-05-12 Thread Sidnei da Silva
On Tue, May 12, 2009 at 12:38 PM, Chris Withers ch...@simplistix.co.uk wrote:
 Sidnei da Silva wrote:

 And the original message said:

 
 That page was changed recently
 to show more information. You can see from the screenshot on this page
 that there used to be a Big Green Button in the page for joining the
 team:

 https://help.launchpad.net/Teams/Joining
 

 Yes, I read this, but since, as you say, launchpad has changed, this
 information is no longer relevant so I didn't reply to it.

/me shrugs.

I was pointing out that there *used* to be a Big Green Button, and it
doesn't exist anymore. You said I don't see a Big Green Button. Of
course the information is relevant. I was telling you *NOT* to look
for a Big Green Button because it doesn't exist anymore, and, still,
you looked for one.

 Are zope2-dev or zope3-dev similarly restricted teams?
 If so, how do people find out how to join a restricted team?

 See Andreas' reply.

 I have and was waiting for you to reply, I was hoping you could explain
 where you'd find a join link for a moderated team...

The screenshot I've sent is for a moderated team, gnome-terminator.
The link is visible there and would be in the same location for
someone joining zope-dev.

-- 
Sidnei da Silva
Canonical Ltd.
 Landscape · Changing the way you manage your systems
http://landscape.canonical.com
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Using views for exceptions in Zope 2.12?

2009-05-09 Thread Sidnei da Silva
On Sat, May 9, 2009 at 12:52 PM, Chris Withers ch...@simplistix.co.uk wrote:
 Hmm, so I would I register different views for a KeyError versus an
 AttributeError?

I believe you need to make KeyError implement an interface to be able
to register a view for it. What use would be a view for KeyError
anyway. *wink*

-- 
Sidnei da Silva
Canonical Ltd.
 Landscape · Changing the way you manage your systems
http://landscape.canonical.com
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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-Checkins] SVN: Zope/trunk/ - RESPONSE.handle_errors was wrongly set (to debug, should have been

2009-05-08 Thread Sidnei da Silva
Log message for revision 99805:
  - RESPONSE.handle_errors was wrongly set (to debug, should have been
``not debug``). Also, the check for exception constructor arguments
didn't account for exceptions that didn't override the ``__init__``
(which are most of them). The combination of those two problems
caused the ``standard_error_message`` not to be called. Fixes
https://bugs.edge.launchpad.net/zope2/+bug/372632 .
  
  

Changed:
  U   Zope/trunk/doc/CHANGES.rst
  U   Zope/trunk/src/OFS/SimpleItem.py
  U   Zope/trunk/src/OFS/tests/testSimpleItem.py
  U   Zope/trunk/src/ZPublisher/Publish.py
  U   Zope/trunk/src/ZPublisher/Test.py

-=-
Modified: Zope/trunk/doc/CHANGES.rst
===
--- Zope/trunk/doc/CHANGES.rst  2009-05-07 19:07:21 UTC (rev 99804)
+++ Zope/trunk/doc/CHANGES.rst  2009-05-07 23:18:39 UTC (rev 99805)
@@ -36,6 +36,13 @@
 Bugs Fixed
 ++
 
+- RESPONSE.handle_errors was wrongly set (to debug, should have been
+  ``not debug``). Also, the check for exception constructor arguments
+  didn't account for exceptions that didn't override the ``__init__``
+  (which are most of them). The combination of those two problems
+  caused the ``standard_error_message`` not to be called. Fixes
+  https://bugs.edge.launchpad.net/zope2/+bug/372632 .
+
 - DocumentTemplate.DT_Raise:  use new 'zExceptions.convertExceptionType'
   API to allow raising non-builtin exceptions.
   Fixes https://bugs.launchpad.net/zope2/+bug/372629 , which prevented
@@ -50,7 +57,7 @@
 Bugs Fixed
 ++
 
-- fixed versions.cfg in order to support zope.z2release for 
+- fixed versions.cfg in order to support zope.z2release for
   creating a proper index structure
 
 2.12.0a3 (2009-04-19)

Modified: Zope/trunk/src/OFS/SimpleItem.py
===
--- Zope/trunk/src/OFS/SimpleItem.py2009-05-07 19:07:21 UTC (rev 99804)
+++ Zope/trunk/src/OFS/SimpleItem.py2009-05-07 23:18:39 UTC (rev 99805)
@@ -237,15 +237,24 @@
 if not REQUEST:
 REQUEST = aq_acquire(self, 'REQUEST')
 
-handle_errors = getattr(getattr(REQUEST, 'RESPONSE', None), 
+handle_errors = getattr(getattr(REQUEST, 'RESPONSE', None),
 'handle_errors', False)
 # Can we re-raise the exception with a rendered-to-HTML
 # exception value? To be able to do so, the exception
 # constructor needs to be able to take more than two
 # arguments (some Zope 3 exceptions can't).
-ctor = getattr(getattr(error_type, '__init__', None), 'im_func', 
None)
-can_raise = (ctor is not None and inspect.isfunction(ctor) 
- and len(inspect.getargspec(error_type.__init__)[0])  
2)
+ctor = getattr(error_type, '__init__', None)
+if inspect.ismethoddescriptor(ctor):
+# If it's a method descriptor, it means we've got a
+# base ``__init__`` method that was not overriden,
+# likely from the base ``Exception`` class.
+can_raise = True
+else:
+if inspect.ismethod(ctor):
+ctor = getattr(ctor, 'im_func', None)
+can_raise = (
+ctor is not None and inspect.isfunction(ctor)
+and len(inspect.getargspec(error_type.__init__)[0])  2)
 
 if not (can_raise and handle_errors):
 # If we have been asked not to handle errors and we

Modified: Zope/trunk/src/OFS/tests/testSimpleItem.py
===
--- Zope/trunk/src/OFS/tests/testSimpleItem.py  2009-05-07 19:07:21 UTC (rev 
99804)
+++ Zope/trunk/src/OFS/tests/testSimpleItem.py  2009-05-07 23:18:39 UTC (rev 
99805)
@@ -32,7 +32,36 @@
 
 verifyClass(ISimpleItem, SimpleItem)
 
+def test_standard_error_message_is_called(self):
+from zExceptions import BadRequest
+from OFS.SimpleItem import SimpleItem
 
+# handle_errors should default to True. It is a flag used for
+# functional doctests. See ZPublisher/Test.py and
+# ZPublisher/Publish.py.
+class REQUEST(object):
+class RESPONSE(object):
+handle_errors = True
+
+class StandardErrorMessage(object):
+def __init__(self):
+self.kw = {}
+
+def __call__(self, **kw):
+self.kw.clear()
+self.kw.update(kw)
+
+item = SimpleItem()
+item.standard_error_message = sem = StandardErrorMessage()
+
+try:
+raise BadRequest(1)
+except:
+item.raise_standardErrorMessage(client=item,
+REQUEST=REQUEST())
+
+self.assertEquals(sem.kw.get('error_type'), 'BadRequest')
+
 def test_suite():
 return 

Re: [Zope-dev] Publishing our company internal Zope extensions and fixes

2009-05-08 Thread Sidnei da Silva
On Fri, May 8, 2009 at 6:39 AM, Andreas Jung li...@zopyx.com wrote:
 Hi there,

 we are currently combing through our company internal Zope (2.11) version
 and trying to identify the stuff that is of interest for the public and the
 Zope 2 core (including some ZODB extensions/changes). I will create a ticket
 on Launchpad (containing a detailed description + patch)
 for the interesting items (we have roughly 50 of them) over the next
 days. All items are prefixed with [DM].
 Everyone is invited to look at the stuff and
 comment on it. I also reserve the right merging some of the changes into
 the current
 trunk until the next Zope 2.12 beta2 release (intentionally breaking the
 rule
 that no new features should be added within the beta phase).

I've found the [DM] prefix to be very annoying. You could have used
tags instead.

Regardless of that, thanks for putting those improvements out there.
I've looked at the list and at least a couple of them are very
interesting to me.

-- 
Sidnei da Silva
Canonical Ltd.
 Landscape · Changing the way you manage your systems
http://landscape.canonical.com
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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-Checkins] SVN: Zope/trunk/src/OFS/SimpleItem.py - In Python 2.4, it's a ``builtin method``, not a ``wrapper slot``. Yuck.

2009-05-07 Thread Sidnei da Silva
Log message for revision 99806:
  - In Python 2.4, it's a ``builtin method``, not a ``wrapper slot``. Yuck.
  
  

Changed:
  U   Zope/trunk/src/OFS/SimpleItem.py

-=-
Modified: Zope/trunk/src/OFS/SimpleItem.py
===
--- Zope/trunk/src/OFS/SimpleItem.py2009-05-07 23:18:39 UTC (rev 99805)
+++ Zope/trunk/src/OFS/SimpleItem.py2009-05-07 23:56:53 UTC (rev 99806)
@@ -243,6 +243,7 @@
 # exception value? To be able to do so, the exception
 # constructor needs to be able to take more than two
 # arguments (some Zope 3 exceptions can't).
+can_raise = False
 ctor = getattr(error_type, '__init__', None)
 if inspect.ismethoddescriptor(ctor):
 # If it's a method descriptor, it means we've got a
@@ -252,9 +253,14 @@
 else:
 if inspect.ismethod(ctor):
 ctor = getattr(ctor, 'im_func', None)
-can_raise = (
-ctor is not None and inspect.isfunction(ctor)
-and len(inspect.getargspec(error_type.__init__)[0])  2)
+if inspect.isbuiltin(ctor):
+# In Python 2.4, the ``__init__`` method of the
+# base ``Exception`` class is a ``builtin
+# method``.
+can_raise = True
+elif ctor is not None and inspect.isfunction(ctor):
+can_raise = (
+len(inspect.getargspec(error_type.__init__)[0])  2)
 
 if not (can_raise and handle_errors):
 # If we have been asked not to handle errors and we

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


Re: [Zope-dev] Please use launchpad bugtracking/blueprints more

2009-03-25 Thread Sidnei da Silva
Hi Martijn,

On Wed, Mar 25, 2009 at 11:54 AM, Martijn Faassen
faas...@startifact.com wrote:
 One question is what launchpad project we should use.

 The current launchpad is for Zope 3. The steering group isn't about
 Zope 3. It's about a whole bunch of libraries. Creating a separate
 launchpad project for each library in the framework seems like a bit of
 overkill at this stage, though it would please those people who come at
 us at the perspective from libraries the most.

It smells like 'Zope Framework' (zope-framework) should be a Project
Group then, and there should be a 'Zope Steering Group Project'
(zope-steering-group-project) as part of it, and sibling of Zope 3 and
any other libraries that are part of Zope Framework. For an example of
what this looks like, look at:

   https://launchpad.net/chameleon-template-engine

I can help setting up this structure, if needed.

-- 
Sidnei da Silva
Canonical Ltd.
 Landscape · Changing the way you manage your systems
http://landscape.canonical.com
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Please use launchpad bugtracking/blueprints more

2009-03-25 Thread Sidnei da Silva
On Wed, Mar 25, 2009 at 1:49 PM, Baiju M mba...@zeomega.net wrote:
 If possible, I think it is better to rename current 'zope3' as 
 'zope-framework',
 then create another 'zope3' project.  So that we will get all bugs
 and blueprints as part of 'zope-framework'.

If 'zope-framework' is a project group containing 'zope3', you would
already get that. See:

  https://bugs.launchpad.net/chameleon-template-engine
  https://bugs.launchpad.net/lazr

-- 
Sidnei da Silva
Canonical Ltd.
 Landscape · Changing the way you manage your systems
http://landscape.canonical.com
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] setup.py extra dependencies

2009-03-05 Thread Sidnei da Silva
On Thu, Mar 5, 2009 at 5:20 PM, Wichert Akkerman wich...@wiggy.net wrote:
 I would like to see a move away from zope testing frameworks to a more
 standard testing infrastructure: setup.py test, possibly combined with
 using nose.

 Wichert.

Be aware of nose issue #102:

  http://code.google.com/p/python-nose/issues/detail?id=102

-- 
Sidnei da Silva
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Differing case for Buildout on Windows

2009-02-05 Thread Sidnei da Silva
I've been constantly bitten by a very annoying bug: depending on how
you call buildout on Windows, a full rebuild might be triggered, if
only the case differs. For example, all the following calls cause
buildout to think settings have changed and that things need to be
rebuilt. Note only the drive letter changes:

  c:\Python24\python.exe bin\buildout-script.py -c
c:\src\some-project\buildout.cfg
  c:\Python24\python.exe bin\buildout-script.py -c
C:\src\some-project\buildout.cfg
  C:\Python24\python.exe bin\buildout-script.py -c
c:\src\some-project\buildout.cfg
  C:\Python24\python.exe bin\buildout-script.py -c
C:\src\some-project\buildout.cfg

Now, I'm wondering what is the best way to fix it. I originally
thought of fixing the data as it comes into buildout, but that would
cause existing buildouts to all possibly trigger a rebuild. I'm now
thinking of fixing the place where buildout detects that the path has
been changed as to normalize the path.

Thoughts?

-- 
Sidnei da Silva
Canonical Ltd.
 Landscape · Changing the way you manage your systems
http://landscape.canonical.com
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] CSRF/XSS: zope.formlib

2009-01-25 Thread Sidnei da Silva
Hello all,

I've been looking at the way CSRF protection is done in Plone
(plone.protect, using a @protect decorator), and also at the XSS
protection added to Zope (@postonly decorator) and was wondering if
something more generic could possibly be done for zope.formlib-based
forms, instead of requiring the use of a decorator.

A quick look though the code, makes seem like an Action could be added
to the Actions object such that the validator would do one (or both)
of those checks, and something similar to the render_submit_button()
which is registered as a @namedtemplate.implementation() would then be
used to render the hidden form field holding the CSRF token for that
specific action.

Does that sound like a reasonable implementation, or is it abusing the
framework?

-- 
Sidnei da Silva
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] [Fwd: Zope Tests: 4 OK, 2 Failed]

2008-11-29 Thread Sidnei da Silva
It is certainly in my plans to look at this. With December right
ahead, I'm sure I will make time for this before the end of this year.

On Sat, Nov 29, 2008 at 1:41 PM, Tres Seaver [EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Any chance you can get these worked out?  I looked at the Products.Five
 tests today, with the following observations:

  - Not as many tests fail if I run '-s Products.Five' as when I run the
   whole set:  in particular, the first two in 'aqlegacy_ftest.txt'
  ('HTTPError', 'falcon.pt' not called) don't occur.

  - The next 'aqlegacy_ftest.txt' failure is because the content provider
   is not being acquisition wrapped.  The remaining failure is likely
   due to the same cause (it is on the following line).

  - All the failing tests in Products.Five come from code which relies
   on zope.testbrowser, via the Products.Five.testbrowser shim.

  - The first failing zope.testbrowser test (README.txt line 1162) seems
   to be due to a change somewhere which contradicts the comment just
   below the example:  Here, the body is left in place because it isn't
   form data.

  - The testing requirements for zope.testbrowser itself are really
   snarled up:  it pulls in basically all of Zope3.



 -  Original Message 
 Subject: Zope Tests: 4 OK, 2 Failed
 Date: Sat, 29 Nov 2008 13:00:03 +0100
 From: Zope Tests Summarizer [EMAIL PROTECTED]
 To: Zope-dev zope-dev@zope.org
 Newsgroups: gmane.comp.web.zope.devel

 Summary of messages to the zope-tests list.
 Period Fri Nov 28 12:00:00 2008 UTC to Sat Nov 29 12:00:00 2008 UTC.
 There were 6 messages: 6 from Zope Tests.


 Test failures
 - -

 Subject: FAILED (failures=3) : Zope-trunk Python-2.4.5 : Linux
 From: Zope Tests
 Date: Fri Nov 28 20:38:21 EST 2008
 URL: http://mail.zope.org/pipermail/zope-tests/2008-November/010572.html

 Subject: FAILED (failures=3) : Zope-trunk Python-2.5.2 : Linux
 From: Zope Tests
 Date: Fri Nov 28 20:39:51 EST 2008
 URL: http://mail.zope.org/pipermail/zope-tests/2008-November/010573.html


 Tests passed OK
 - ---

 Subject: OK : Zope-2.8 Python-2.3.7 : Linux
 From: Zope Tests
 Date: Fri Nov 28 20:32:16 EST 2008
 URL: http://mail.zope.org/pipermail/zope-tests/2008-November/010568.html

 Subject: OK : Zope-2.9 Python-2.4.5 : Linux
 From: Zope Tests
 Date: Fri Nov 28 20:33:51 EST 2008
 URL: http://mail.zope.org/pipermail/zope-tests/2008-November/010569.html

 Subject: OK : Zope-2.10 Python-2.4.5 : Linux
 From: Zope Tests
 Date: Fri Nov 28 20:35:21 EST 2008
 URL: http://mail.zope.org/pipermail/zope-tests/2008-November/010570.html

 Subject: OK : Zope-2.11 Python-2.4.5 : Linux
 From: Zope Tests
 Date: Fri Nov 28 20:36:51 EST 2008
 URL: http://mail.zope.org/pipermail/zope-tests/2008-November/010571.html

 ___
 Zope-Dev maillist  -  Zope-Dev@zope.org
 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 )


 - --
 ===
 Tres Seaver  +1 540-429-0999  [EMAIL PROTECTED]
 Palladion Software   Excellence by Designhttp://palladion.com
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.6 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iD8DBQFJMWKt+gerLs4ltQ4RAh0MAJ4gBJZOdsRw+Q8ZqhOU+VlajxuC6wCgw0BP
 oCiVHZ0ig6wiItTk9clcBJU=
 =KihL
 -END PGP SIGNATURE-




-- 
Sidnei da Silva
Enfold Systems
http://enfoldsystems.com
Fax +1 832 201 8856
Office +1 713 942 2377 Ext 214
Skype zopedc
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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-Checkins] SVN: Zope/trunk/utilities/mkzopeinstance.py - Revert to sha1. Andreas said he added SHA256 to AuthEncoding but I can't find it.

2008-11-14 Thread Sidnei da Silva
Log message for revision 92941:
   - Revert to sha1. Andreas said he added SHA256 to AuthEncoding but I can't 
find it.

Changed:
  U   Zope/trunk/utilities/mkzopeinstance.py

-=-
Modified: Zope/trunk/utilities/mkzopeinstance.py
===
--- Zope/trunk/utilities/mkzopeinstance.py  2008-11-14 19:12:22 UTC (rev 
92940)
+++ Zope/trunk/utilities/mkzopeinstance.py  2008-11-14 20:26:21 UTC (rev 
92941)
@@ -168,12 +168,12 @@
 def write_inituser(fn, user, password):
 import binascii
 try:
-from hashlib import sha256 as sha
+from hashlib import sha1 as sha
 except:
 from sha import new as sha
 fp = open(fn, w)
 pw = binascii.b2a_base64(sha(password).digest())[:-1]
-fp.write('%s:{SHA256}%s\n' % (user, pw))
+fp.write('%s:{SHA}%s\n' % (user, pw))
 fp.close()
 os.chmod(fn, 0644)
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


Re: [Zope-dev] Subversion merge tracking

2008-11-13 Thread Sidnei da Silva
On Thu, Nov 13, 2008 at 1:09 PM, Jens Vagelpohl [EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1


 On Nov 13, 2008, at 14:42 , Benji York wrote:

 I'd like for us to disallow pre-1.5 Subversion clients from making
 commits starting one year from now (or sooner if there is consensus).

 +1

I vote for sooner, if that makes things easier. I'm already using 1.5
and I'm on Windows, so I guess the Linux users out there shouldn't
have a problem getting an up-to-date package right? :)

-- 
Sidnei da Silva
Enfold Systems
http://enfoldsystems.com
Fax +1 832 201 8856
Office +1 713 942 2377 Ext 214
Skype zopedc
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Subversion merge tracking

2008-11-13 Thread Sidnei da Silva
On Thu, Nov 13, 2008 at 2:28 PM, Tres Seaver [EMAIL PROTECTED] wrote:
 +0, I guess:  I would be more comfortable if we could measure the
 incidence of pre-1.5 client usage over time, and maybe even identify the
 committers who are using them, so that we can sent out a targeted
 warning message before breaking their checkouts.

Checkouts are not a problem, only checkins.

-- 
Sidnei da Silva
Enfold Systems
http://enfoldsystems.com
Fax +1 832 201 8856
Office +1 713 942 2377 Ext 214
Skype zopedc
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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-Checkins] [Checkins] SVN: Zope/branches/2.11/lib/python/Zope2/App/ Backported DoomedTransaction handling from trunk r92792 to 2.11 branch

2008-11-05 Thread Sidnei da Silva
Hi Matthew,

I think you merged a little bit too much here. You picked the previous
revision of startup.py by accident.

On Wed, Nov 5, 2008 at 11:08 AM, Matthew Wilkes
[EMAIL PROTECTED] wrote:
 Log message for revision 92793:
  Backported DoomedTransaction handling from trunk r92792 to 2.11 branch

 Changed:
  U   Zope/branches/2.11/lib/python/Zope2/App/startup.py
  A   Zope/branches/2.11/lib/python/Zope2/App/tests/testDoomedTransaction.py

 -=-
 Modified: Zope/branches/2.11/lib/python/Zope2/App/startup.py
 ===
 --- Zope/branches/2.11/lib/python/Zope2/App/startup.py  2008-11-05 12:41:21 
 UTC (rev 92792)
 +++ Zope/branches/2.11/lib/python/Zope2/App/startup.py  2008-11-05 13:08:33 
 UTC (rev 92793)
 @@ -249,7 +249,15 @@
 REQUEST['AUTHENTICATED_USER'] = AccessControl.User.nobody

 try:
 -f(client, REQUEST, t, v, traceback, 
 error_log_url=error_log_url)
 +result = f(client, REQUEST, t, v,
 +   traceback,
 +   error_log_url=error_log_url)
 +if result is not None:
 +t, v, traceback = result
 +response = REQUEST.RESPONSE
 +response.setStatus(t)
 +response.setBody(v)
 +return response
 except TypeError:
 # Pre 2.6 call signature
 f(client, REQUEST, t, v, traceback)
 @@ -267,7 +275,10 @@
 transaction.begin()

 def commit(self):
 -transaction.commit()
 +if hasattr(transaction, 'isDoomed') and transaction.isDoomed():
 +transaction.abort()
 +else:
 +transaction.commit()

 def abort(self):
 transaction.abort()

 Copied: 
 Zope/branches/2.11/lib/python/Zope2/App/tests/testDoomedTransaction.py (from 
 rev 92792, Zope/trunk/lib/python/Zope2/App/tests/testDoomedTransaction.py)
 ===
 --- Zope/branches/2.11/lib/python/Zope2/App/tests/testDoomedTransaction.py
   (rev 0)
 +++ Zope/branches/2.11/lib/python/Zope2/App/tests/testDoomedTransaction.py
   2008-11-05 13:08:33 UTC (rev 92793)
 @@ -0,0 +1,43 @@
 +##
 +#
 +# Copyright (c) 2007 Zope Corporation and Contributors.
 +# All Rights Reserved.
 +#
 +# This software is subject to the provisions of the Zope Public License,
 +# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
 +# THIS SOFTWARE IS PROVIDED AS IS AND ANY AND ALL EXPRESS OR IMPLIED
 +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 +# FOR A PARTICULAR PURPOSE.
 +#
 +##
 +
 +import sys
 +import unittest
 +import logging
 +import transaction
 +
 +class DoomedTransactionInManagerTest(unittest.TestCase):
 +
 +def testDoomedFails(self):
 +transaction.begin()
 +trans = transaction.get()
 +trans.doom()
 +from transaction.interfaces import DoomedTransaction
 +self.assertRaises(DoomedTransaction, trans.commit)
 +
 +def testDoomedSilentInTM(self):
 +from Zope2.App.startup import TransactionsManager
 +tm = TransactionsManager()
 +transaction.begin()
 +trans = transaction.get()
 +trans.doom()
 +tm.commit()
 +
 +def test_suite():
 +suite = unittest.TestSuite()
 +suite.addTest(unittest.makeSuite(DoomedTransactionInManagerTest))
 +return suite
 +
 +if __name__ == '__main__':
 +unittest.main(defaultTest='test_suite')

 ___
 Checkins mailing list
 [EMAIL PROTECTED]
 http://mail.zope.org/mailman/listinfo/checkins




-- 
Sidnei da Silva
Enfold Systems
http://enfoldsystems.com
Fax +1 832 201 8856
Office +1 713 942 2377 Ext 214
Skype zopedc
___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/lib/python/ - Rather nasty fix to work around Zope 3 exceptions that have more than one positional argument on the constructor. Also, pass 'handle_errors' argument used

2008-11-03 Thread Sidnei da Silva
Log message for revision 92767:
   - Rather nasty fix to work around Zope 3 exceptions that have more than one 
positional argument on the constructor. Also, pass 'handle_errors' argument 
used for functional http testing around and use that on 
raise_standardErrorMessage to decide if we need to care about rendering a full 
HTML traceback.

Changed:
  U   Zope/trunk/lib/python/OFS/SimpleItem.py
  U   Zope/trunk/lib/python/ZPublisher/Publish.py
  U   Zope/trunk/lib/python/ZPublisher/Test.py
  U   Zope/trunk/lib/python/Zope2/App/startup.py

-=-
Modified: Zope/trunk/lib/python/OFS/SimpleItem.py
===
--- Zope/trunk/lib/python/OFS/SimpleItem.py 2008-11-03 19:31:35 UTC (rev 
92766)
+++ Zope/trunk/lib/python/OFS/SimpleItem.py 2008-11-04 00:30:26 UTC (rev 
92767)
@@ -20,6 +20,7 @@
 $Id$
 
 
+import inspect
 import warnings
 import marshal, re, sys, time
 
@@ -196,7 +197,7 @@
 if hasattr(self, '_v_eek'):
 # Stop if there is recursion.
 raise error_type, error_value, tb
-self._v_eek=1
+self._v_eek = 1
 
 if error_name.lower() in ('redirect',):
 raise error_type, error_value, tb
@@ -215,15 +216,31 @@
 
 if client is None:
 client = self
+
 if not REQUEST:
 REQUEST = aq_acquire(self, 'REQUEST')
 
+handle_errors = getattr(getattr(REQUEST, 'RESPONSE', None), 
+'handle_errors', False)
+# Can we re-raise the exception with a rendered-to-HTML
+# exception value? To be able to do so, the exception
+# constructor needs to be able to take more than two
+# arguments (some Zope 3 exceptions can't).
+ctor = getattr(getattr(error_type, '__init__', None), 'im_func', 
None)
+can_raise = (ctor is not None and inspect.isfunction(ctor) 
+ and len(inspect.getargspec(error_type.__init__)[0])  
2)
+
+if not (can_raise and handle_errors):
+# If we have been asked not to handle errors and we
+# can't re-raise a transformed exception don't even
+# bother with transforming the exception into
+# HTML. Just re-raise the original exception right
+# away.
+raise error_type, error_value, tb
+
 try:
-if hasattr(client, 'standard_error_message'):
-s=getattr(client, 'standard_error_message')
-else:
-client = aq_parent(client)
-s=getattr(client, 'standard_error_message')
+s = aq_acquire(client, 'standard_error_message')
+
 # For backward compatibility, we pass 'error_name' as
 # 'error_type' here as historically this has always
 # been a string.
@@ -234,7 +251,7 @@
   'error_message': error_message,
   'error_log_url': error_log_url}
 
-if getattr(aq_base(s),'isDocTemp',0):
+if getattr(aq_base(s), 'isDocTemp', 0):
 v = s(client, REQUEST, **kwargs)
 elif callable(s):
 v = s(**kwargs)
@@ -256,10 +273,16 @@
  event log for full details: %s))%(
 html_quote(sys.exc_info()[1]),
 ))
+
+if handle_errors:
+# If we've been asked to handle errors, just
+# return the rendered exception and let the
+# ZPublisher Exception Hook deal with it.
+return error_type, v, tb
 raise error_type, v, tb
 finally:
 if hasattr(self, '_v_eek'): del self._v_eek
-tb=None
+tb = None
 
 def manage(self, URL1):
 

Modified: Zope/trunk/lib/python/ZPublisher/Publish.py
===
--- Zope/trunk/lib/python/ZPublisher/Publish.py 2008-11-03 19:31:35 UTC (rev 
92766)
+++ Zope/trunk/lib/python/ZPublisher/Publish.py 2008-11-04 00:30:26 UTC (rev 
92767)
@@ -191,6 +191,8 @@
 else:
 stdout=response.stdout
 
+response.handle_errors = debug
+
 if request is None:
 request=Request(stdin, environ, response)
 

Modified: Zope/trunk/lib/python/ZPublisher/Test.py
===
--- Zope/trunk/lib/python/ZPublisher/Test.py2008-11-03 19:31:35 UTC (rev 
92766)
+++ Zope/trunk/lib/python/ZPublisher/Test.py2008-11-04 00:30:26 UTC (rev 
92767)
@@ -187,6 +187,9 @@
 response=Response(stdout=stdout, stderr=stderr)
 else:
 stdout=response.stdout
+
+response.handle_errors = debug
+
 if request is 

[Zope-Checkins] SVN: Zope/trunk/lib/python/ZPublisher/HTTPResponse.py - Fixed another check for new-style exceptions. Patch by David Glick from One/Northwest.

2008-11-03 Thread Sidnei da Silva
Log message for revision 92768:
   - Fixed another check for new-style exceptions. Patch by David Glick from 
One/Northwest.

Changed:
  U   Zope/trunk/lib/python/ZPublisher/HTTPResponse.py

-=-
Modified: Zope/trunk/lib/python/ZPublisher/HTTPResponse.py
===
--- Zope/trunk/lib/python/ZPublisher/HTTPResponse.py2008-11-04 00:30:26 UTC 
(rev 92767)
+++ Zope/trunk/lib/python/ZPublisher/HTTPResponse.py2008-11-04 02:07:11 UTC 
(rev 92768)
@@ -725,7 +725,7 @@
 t, v, tb = sys.exc_info()
 
 if t == 'Unauthorized' or t == Unauthorized or (
-isinstance(t, types.ClassType) and issubclass(t, Unauthorized)):
+isinstance(t, (type, types.ClassType)) and issubclass(t, 
Unauthorized)):
 t = 'Unauthorized'
 self._unauthorized()
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


Re: [Zope-dev] problem with using webDAV between MS Word and Zope

2008-10-29 Thread Sidnei da Silva
Please make sure you read the information contained here:

http://awkly.org/2007/06/23/google-soc-status-report-1/


On Wed, Oct 29, 2008 at 2:15 AM, Wayne Glover
[EMAIL PROTECTED] wrote:
 hi all,

 i am using plone 3+ with zope ope-2.10.5-final

 I am trying to use webDAV between Word and Zope.  This works fine for OO
 (yes i know - don't use Word!  Not an option)

 I have searched far and wide and have found the 'solution' at
 (https://bugs.launchpad.net/zope2/+bug/143725) however, i can't get it to
 work for me with this installation

 _

 The changes suggested by the bug fix at the link are as follows:

 *** /usr/local/zope-2.8.4/lib/python/webdav/Resource.py 2006-06-13
 16:35:29.0 -0500
 --- /usr/local/zope-2.8.4/lib/python/webdav/Resource.py.orig2006-06-13
 16:20:17.0 -0500
 ***
 *** 197,203 
  self.dav__init(REQUEST, RESPONSE)
  RESPONSE.setHeader('Allow', ', '.join(self.__http_methods__))
  RESPONSE.setHeader('Content-Length', 0)
 -   RESPONSE.setHeader('MS-Author-Via', 'DAV')
  RESPONSE.setHeader('DAV', '1,2', 1)
  RESPONSE.setStatus(200)
  return RESPONSE
 --- 197,202 
 ***
 *** 594,606 
  def manage_DAVget(self):
  Gets the document source
  # The default implementation calls manage_FTPget
 !   # some things have manage_FTPget's that take REQUEST and RESPONSE
 !   # -- mengel 2006-06-13
 !   try:
 !   res = self.manage_FTPget()
 ! except:
 !   self.manage_FTPget({},{})
 ! return res

  def listDAVObjects(self):
  return []
 --- 593,599 
  def manage_DAVget(self):
  Gets the document source
  # The default implementation calls manage_FTPget
 ! return self.manage_FTPget()

  def listDAVObjects(self):
  return []
 ___

 Note that what it is doing is forcing a response of 'MS-Author-Via', 'DAV')

 what this is supposed to do is force Word to accept webDAV vs. it's only
 silly thing.  good in theory, but i couldn't get it to work

 After revising the file on the zope server, i then tried Word webDAV.  I
 monitored the network traffic to look for the OPTIONS response telling Word
 to use webDAV.  see attached txt file which has tcp stream while i tried to
 save .doc file.Note that, in the above change, the RESPONSE.setHeader
 ('MS-Author-Via', 'DAV') is supposed to be returned by Zope to force Word to
 work with webDAV, but this does not happen.

 This has been driving me crazy and any help would be greatly appreciated.

 Note:  i have attached the zope 'resource.py' as i have modified it based on
 the above link.  plz let me know if you can see what is wrong.


 Thanks,

 Wayne Glover
 TechnicalMedia, Inc.
 ___
 Zope-Dev maillist  -  Zope-Dev@zope.org
 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 )





-- 
Sidnei da Silva
Enfold Systems
http://enfoldsystems.com
Fax +1 832 201 8856
Office +1 713 942 2377 Ext 214
Skype zopedc
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Proposal: Backporting some Python 2.5/2.6 fixes

2008-10-27 Thread Sidnei da Silva
Hi all,

I would like to propose backporting some of the fixes needed for
Python 2.5 and 2.6 all the way down to Zope 2.10. The fixes that would
be backported would only be those that deal with syntax changes (eg:
'with' and 'as' keyword being used as variables, relative imports) and
some C-level changes, to Acquisition and zope.app.container if I
recall. I would *not* backport changes to RestrictedPython because
those are actually features (support for newer versions of Python) as
opposed to the other changes, which are just 'bugfixes' IMHO.

Would anyone be against this?

-- 
Sidnei da Silva
Enfold Systems
http://enfoldsystems.com
Fax +1 832 201 8856
Office +1 713 942 2377 Ext 214
Skype zopedc
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Proposal: Backporting some Python 2.5/2.6 fixes

2008-10-27 Thread Sidnei da Silva
On Mon, Oct 27, 2008 at 3:42 PM, Andreas Jung [EMAIL PROTECTED] wrote:
 Why do we need these backports on the current maintenance branches?

They are small cleanups that could potentially allow someone to run
Python 2.5 or 2.6 if they really really really wanted to, but note
should be made that it would be completely and utterly unsupported.

-- 
Sidnei da Silva
Enfold Systems
http://enfoldsystems.com
Fax +1 832 201 8856
Office +1 713 942 2377 Ext 214
Skype zopedc
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Proposal: Backporting some Python 2.5/2.6 fixes

2008-10-27 Thread Sidnei da Silva
On Mon, Oct 27, 2008 at 4:06 PM, Andreas Jung [EMAIL PROTECTED] wrote:
 Please create branches first and then lets review the changes.

Great.

 What is the
 state of the compatability of Z3 modules with Python 2.5/2.6 as used in Zope
 2.10/2.11?

Hard to tell at this point.

-- 
Sidnei da Silva
Enfold Systems
http://enfoldsystems.com
Fax +1 832 201 8856
Office +1 713 942 2377 Ext 214
Skype zopedc
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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-Checkins] SVN: Zope/trunk/lib/python/zope/app/ - Adjust externals to released versions

2008-10-26 Thread Sidnei da Silva
Log message for revision 92593:
   - Adjust externals to released versions

Changed:
  _U  Zope/trunk/lib/python/zope/app/

-=-

Property changes on: Zope/trunk/lib/python/zope/app
___
Name: svn:externals
   - annotation   
svn://svn.zope.org/repos/main/zope.app.annotation/tags/3.4.0/src/zope/app/annotation
apidoc   
svn://svn.zope.org/repos/main/zope.app.apidoc/tags/3.4.3/src/zope/app/apidoc
applicationcontrol   
svn://svn.zope.org/repos/main/zope.app.applicationcontrol/tags/3.4.1/src/zope/app/applicationcontrol
appsetup 
svn://svn.zope.org/repos/main/zope.app.appsetup/tags/3.4.1/src/zope/app/appsetup
authentication   
svn://svn.zope.org/repos/main/zope.app.authentication/tags/3.4.1/src/zope/app/authentication
basicskin
svn://svn.zope.org/repos/main/zope.app.basicskin/tags/3.4.0/src/zope/app/basicskin
broken   
svn://svn.zope.org/repos/main/zope.app.broken/tags/3.4.0/src/zope/app/broken
cache
svn://svn.zope.org/repos/main/zope.app.cache/tags/3.4.0/src/zope/app/cache
component
svn://svn.zope.org/repos/main/zope.app.component/tags/3.5.0/src/zope/app/component
container
svn://svn.zope.org/repos/main/zope.app.container/tags/3.6.2/src/zope/app/container
content  
svn://svn.zope.org/repos/main/zope.app.content/tags/3.4.0/src/zope/app/content
debug
svn://svn.zope.org/repos/main/zope.app.debug/tags/3.4.0/src/zope/app/debug
dependable   
svn://svn.zope.org/repos/main/zope.app.dependable/tags/3.4.0/src/zope/app/dependable
error
svn://svn.zope.org/repos/main/zope.app.error/tags/3.5.1/src/zope/app/error
exception
svn://svn.zope.org/repos/main/zope.app.exception/tags/3.4.1/src/zope/app/exception
file 
svn://svn.zope.org/repos/main/zope.app.file/tags/3.4.2/src/zope/app/file
folder   
svn://svn.zope.org/repos/main/zope.app.folder/tags/3.4.0/src/zope/app/folder
form 
svn://svn.zope.org/repos/main/zope.app.form/trunk/src/zope/app/form
generations  
svn://svn.zope.org/repos/main/zope.app.generations/tags/3.4.1/src/zope/app/generations
http 
svn://svn.zope.org/repos/main/zope.app.http/tags/3.4.1/src/zope/app/http
i18n 
svn://svn.zope.org/repos/main/zope.app.i18n/tags/3.4.4/src/zope/app/i18n
interface
svn://svn.zope.org/repos/main/zope.app.interface/tags/3.4.0/src/zope/app/interface
intid
svn://svn.zope.org/repos/main/zope.app.intid/tags/3.4.1/src/zope/app/intid
keyreference 
svn://svn.zope.org/repos/main/zope.app.keyreference/tags/3.4.1/src/zope/app/keyreference
layers   
svn://svn.zope.org/repos/main/zope.app.layers/tags/3.4.0/src/zope/app/layers
locales  
svn://svn.zope.org/repos/main/zope.app.locales/tags/3.4.1/src/zope/app/locales
onlinehelp   
svn://svn.zope.org/repos/main/zope.app.onlinehelp/tags/3.4.1/src/zope/app/onlinehelp
pagetemplate 
svn://svn.zope.org/repos/main/zope.app.pagetemplate/tags/3.4.0/src/zope/app/pagetemplate
pluggableauth
svn://svn.zope.org/repos/main/zope.app.pluggableauth/tags/3.4.0/src/zope/app/pluggableauth
preference   
svn://svn.zope.org/repos/main/zope.app.preference/tags/3.4.1/src/zope/app/preference
preview  
svn://svn.zope.org/repos/main/zope.app.preview/tags/3.4.0/src/zope/app/preview
principalannotation  
svn://svn.zope.org/repos/main/zope.app.principalannotation/tags/3.4.0/src/zope/app/principalannotation
publication  
svn://svn.zope.org/repos/main/zope.app.publication/tags/3.4.3/src/zope/app/publication
publisher
svn://svn.zope.org/repos/main/zope.app.publisher/trunk/src/zope/app/publisher
renderer 
svn://svn.zope.org/repos/main/zope.app.renderer/tags/3.4.0/src/zope/app/renderer
rotterdam
svn://svn.zope.org/repos/main/zope.app.rotterdam/tags/3.4.1/src/zope/app/rotterdam
schema   
svn://svn.zope.org/repos/main/zope.app.schema/tags/3.4.0/src/zope/app/schema
security 
svn://svn.zope.org/repos/main/zope.app.security/tags/3.5.2/src/zope/app/security
securitypolicy   
svn://svn.zope.org/repos/main/zope.app.securitypolicy/tags/3.4.6/src/zope/app/securitypolicy
session  
svn://svn.zope.org/repos/main/zope.app.session/tags/3.5.1/src/zope/app/session
skins
svn://svn.zope.org/repos/main/zope.app.skins/tags/3.4.0/src/zope/app/skins
sqlscript
svn://svn.zope.org/repos/main/zope.app.sqlscript/tags/3.4.1/src/zope/app/sqlscript
testing  
svn://svn.zope.org/repos/main/zope.app.testing/tags/3.4.1/src/zope/app/testing
traversing   
svn://svn.zope.org/repos/main/zope.app.traversing/tags/3.4.0/src/zope/app/traversing
tree 
svn://svn.zope.org/repos/main/zope.app.tree/tags/3.4.0/src/zope/app/tree
undo 

[Zope-Checkins] SVN: Zope/trunk/lib/python/zope/app/ - Got publisher and publication backwards

2008-10-26 Thread Sidnei da Silva
Log message for revision 92594:
   - Got publisher and publication backwards

Changed:
  _U  Zope/trunk/lib/python/zope/app/

-=-

Property changes on: Zope/trunk/lib/python/zope/app
___
Name: svn:externals
   - annotation   
svn://svn.zope.org/repos/main/zope.app.annotation/tags/3.4.0/src/zope/app/annotation
apidoc   
svn://svn.zope.org/repos/main/zope.app.apidoc/tags/3.4.3/src/zope/app/apidoc
applicationcontrol   
svn://svn.zope.org/repos/main/zope.app.applicationcontrol/tags/3.4.1/src/zope/app/applicationcontrol
appsetup 
svn://svn.zope.org/repos/main/zope.app.appsetup/tags/3.4.1/src/zope/app/appsetup
authentication   
svn://svn.zope.org/repos/main/zope.app.authentication/tags/3.4.1/src/zope/app/authentication
basicskin
svn://svn.zope.org/repos/main/zope.app.basicskin/tags/3.4.0/src/zope/app/basicskin
broken   
svn://svn.zope.org/repos/main/zope.app.broken/tags/3.4.0/src/zope/app/broken
cache
svn://svn.zope.org/repos/main/zope.app.cache/tags/3.4.0/src/zope/app/cache
component
svn://svn.zope.org/repos/main/zope.app.component/tags/3.5.0/src/zope/app/component
container
svn://svn.zope.org/repos/main/zope.app.container/tags/3.6.2/src/zope/app/container
content  
svn://svn.zope.org/repos/main/zope.app.content/tags/3.4.0/src/zope/app/content
debug
svn://svn.zope.org/repos/main/zope.app.debug/tags/3.4.0/src/zope/app/debug
dependable   
svn://svn.zope.org/repos/main/zope.app.dependable/tags/3.4.0/src/zope/app/dependable
error
svn://svn.zope.org/repos/main/zope.app.error/tags/3.5.1/src/zope/app/error
exception
svn://svn.zope.org/repos/main/zope.app.exception/tags/3.4.1/src/zope/app/exception
file 
svn://svn.zope.org/repos/main/zope.app.file/tags/3.4.2/src/zope/app/file
folder   
svn://svn.zope.org/repos/main/zope.app.folder/tags/3.4.0/src/zope/app/folder
form 
svn://svn.zope.org/repos/main/zope.app.form/tags/3.6.3/src/zope/app/form
generations  
svn://svn.zope.org/repos/main/zope.app.generations/tags/3.4.1/src/zope/app/generations
http 
svn://svn.zope.org/repos/main/zope.app.http/tags/3.4.1/src/zope/app/http
i18n 
svn://svn.zope.org/repos/main/zope.app.i18n/tags/3.4.4/src/zope/app/i18n
interface
svn://svn.zope.org/repos/main/zope.app.interface/tags/3.4.0/src/zope/app/interface
intid
svn://svn.zope.org/repos/main/zope.app.intid/tags/3.4.1/src/zope/app/intid
keyreference 
svn://svn.zope.org/repos/main/zope.app.keyreference/tags/3.4.1/src/zope/app/keyreference
layers   
svn://svn.zope.org/repos/main/zope.app.layers/tags/3.4.0/src/zope/app/layers
locales  
svn://svn.zope.org/repos/main/zope.app.locales/tags/3.4.1/src/zope/app/locales
onlinehelp   
svn://svn.zope.org/repos/main/zope.app.onlinehelp/tags/3.4.1/src/zope/app/onlinehelp
pagetemplate 
svn://svn.zope.org/repos/main/zope.app.pagetemplate/tags/3.4.0/src/zope/app/pagetemplate
pluggableauth
svn://svn.zope.org/repos/main/zope.app.pluggableauth/tags/3.4.0/src/zope/app/pluggableauth
preference   
svn://svn.zope.org/repos/main/zope.app.preference/tags/3.4.1/src/zope/app/preference
preview  
svn://svn.zope.org/repos/main/zope.app.preview/tags/3.4.0/src/zope/app/preview
principalannotation  
svn://svn.zope.org/repos/main/zope.app.principalannotation/tags/3.4.0/src/zope/app/principalannotation
publication  
svn://svn.zope.org/repos/main/zope.app.publication/tags/3.5.1/src/zope/app/publication
publisher
svn://svn.zope.org/repos/main/zope.app.publisher/trunk/src/zope/app/publisher
renderer 
svn://svn.zope.org/repos/main/zope.app.renderer/tags/3.4.0/src/zope/app/renderer
rotterdam
svn://svn.zope.org/repos/main/zope.app.rotterdam/tags/3.4.1/src/zope/app/rotterdam
schema   
svn://svn.zope.org/repos/main/zope.app.schema/tags/3.4.0/src/zope/app/schema
security 
svn://svn.zope.org/repos/main/zope.app.security/tags/3.5.2/src/zope/app/security
securitypolicy   
svn://svn.zope.org/repos/main/zope.app.securitypolicy/tags/3.4.6/src/zope/app/securitypolicy
session  
svn://svn.zope.org/repos/main/zope.app.session/tags/3.5.1/src/zope/app/session
skins
svn://svn.zope.org/repos/main/zope.app.skins/tags/3.4.0/src/zope/app/skins
sqlscript
svn://svn.zope.org/repos/main/zope.app.sqlscript/tags/3.4.1/src/zope/app/sqlscript
testing  
svn://svn.zope.org/repos/main/zope.app.testing/tags/3.5.6/src/zope/app/testing
traversing   
svn://svn.zope.org/repos/main/zope.app.traversing/tags/3.4.0/src/zope/app/traversing
tree 
svn://svn.zope.org/repos/main/zope.app.tree/tags/3.4.0/src/zope/app/tree
undo 

[Zope-Checkins] SVN: Zope/trunk/lib/python/Products/PythonScripts/patches.py - Since it's fixed after 2.4.5, no reason to apply the patch otherwise

2008-10-26 Thread Sidnei da Silva
Log message for revision 92595:
   - Since it's fixed after 2.4.5, no reason to apply the patch otherwise

Changed:
  U   Zope/trunk/lib/python/Products/PythonScripts/patches.py

-=-
Modified: Zope/trunk/lib/python/Products/PythonScripts/patches.py
===
--- Zope/trunk/lib/python/Products/PythonScripts/patches.py 2008-10-26 
14:31:48 UTC (rev 92594)
+++ Zope/trunk/lib/python/Products/PythonScripts/patches.py 2008-10-26 
15:02:32 UTC (rev 92595)
@@ -13,6 +13,8 @@
 # Written by Marc-Andre Lemburg ([EMAIL PROTECTED]).
 # (c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
 
+import sys
+
 def search_function(encoding):
 
 # Cache lookup
@@ -93,7 +95,7 @@
 # Return the registry entry
 return entry
 
+if sys.version_info = (2, 4, 5):
+import encodings
+encodings.search_function.func_code = search_function.func_code
 
-import encodings
-encodings.search_function.func_code = search_function.func_code
-

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/lib/python/zope/ - Revert to an older zope.testing. New one is way too new

2008-10-26 Thread Sidnei da Silva
Log message for revision 92597:
   - Revert to an older zope.testing. New one is way too new

Changed:
  _U  Zope/trunk/lib/python/zope/

-=-

Property changes on: Zope/trunk/lib/python/zope
___
Name: svn:externals
   - annotation   
svn://svn.zope.org/repos/main/zope.annotation/tags/3.4.0/src/zope/annotation
cachedescriptors 
svn://svn.zope.org/repos/main/zope.cachedescriptors/tags/3.4.0/src/zope/cachedescriptors
component
svn://svn.zope.org/repos/main/zope.component/tags/3.4.0/src/zope/component
configuration
svn://svn.zope.org/repos/main/zope.configuration/tags/3.4.0/src/zope/configuration
contentprovider  
svn://svn.zope.org/repos/main/zope.contentprovider/tags/3.4.0/src/zope/contentprovider
contenttype  
svn://svn.zope.org/repos/main/zope.contenttype/tags/3.4.0/src/zope/contenttype
copypastemove
svn://svn.zope.org/repos/main/zope.copypastemove/tags/3.4.0/src/zope/copypastemove
datetime 
svn://svn.zope.org/repos/main/zope.datetime/tags/3.4.0/src/zope/datetime
decorator
svn://svn.zope.org/repos/main/zope.decorator/tags/3.4.0/src/zope/decorator
deferredimport   
svn://svn.zope.org/repos/main/zope.deferredimport/tags/3.4.0/src/zope/deferredimport
deprecation  
svn://svn.zope.org/repos/main/zope.deprecation/tags/3.4.0/src/zope/deprecation
documenttemplate 
svn://svn.zope.org/repos/main/zope.documenttemplate/tags/3.4.2/src/zope/documenttemplate
dottedname   
svn://svn.zope.org/repos/main/zope.dottedname/tags/3.4.2/src/zope/dottedname
dublincore   
svn://svn.zope.org/repos/main/zope.dublincore/tags/3.4.0/src/zope/dublincore
error
svn://svn.zope.org/repos/main/zope.error/tags/3.5.1/src/zope/error
event
svn://svn.zope.org/repos/main/zope.event/tags/3.4.0/src/zope/event
exceptions   
svn://svn.zope.org/repos/main/zope.exceptions/tags/3.4.0/src/zope/exceptions
filerepresentation   
svn://svn.zope.org/repos/main/zope.filerepresentation/tags/3.4.0/src/zope/filerepresentation
formlib  
svn://svn.zope.org/repos/main/zope.formlib/tags/3.4.0/src/zope/formlib
hookable 
svn://svn.zope.org/repos/main/zope.hookable/tags/3.4.0/src/zope/hookable
i18nmessageid
svn://svn.zope.org/repos/main/zope.i18nmessageid/tags/3.4.3/src/zope/i18nmessageid
i18n 
svn://svn.zope.org/repos/main/zope.i18n/tags/3.4.0/src/zope/i18n
index
svn://svn.zope.org/repos/main/zope.index/tags/3.4.1/src/zope/index
interface
svn://svn.zope.org/repos/main/zope.interface/tags/3.4.1/src/zope/interface
lifecycleevent   
svn://svn.zope.org/repos/main/zope.lifecycleevent/tags/3.4.0/src/zope/lifecycleevent
location 
svn://svn.zope.org/repos/main/zope.location/tags/3.4.0/src/zope/location
minmax   
svn://svn.zope.org/repos/main/zope.minmax/tags/1.1.0/src/zope/minmax
modulealias  
svn://svn.zope.org/repos/main/zope.modulealias/tags/3.4.0/src/zope/modulealias
pagetemplate 
svn://svn.zope.org/repos/main/zope.pagetemplate/tags/3.4.0/src/zope/pagetemplate
proxy
svn://svn.zope.org/repos/main/zope.proxy/tags/3.4.0/src/zope/proxy
publisher
svn://svn.zope.org/repos/main/zope.publisher/tags/3.4.3/src/zope/publisher
rdb  
svn://svn.zope.org/repos/main/zope.rdb/tags/3.4.0/src/zope/rdb
schema   
svn://svn.zope.org/repos/main/zope.schema/tags/3.4.0/src/zope/schema
security 
svn://svn.zope.org/repos/main/zope.security/tags/3.4.0/src/zope/security
sequencesort 
svn://svn.zope.org/repos/main/zope.sequencesort/tags/3.4.0/src/zope/sequencesort
sendmail 
svn://svn.zope.org/repos/main/zope.sendmail/tags/3.5.0/src/zope/sendmail
server   
svn://svn.zope.org/repos/main/zope.server/tags/3.4.1/src/zope/server
session  
svn://svn.zope.org/repos/main/zope.session/tags/3.4.1/src/zope/session
size 
svn://svn.zope.org/repos/main/zope.size/tags/3.4.0/src/zope/size
securitypolicy   
svn://svn.zope.org/repos/main/zope.securitypolicy/tags/3.4.0/src/zope/securitypolicy
structuredtext   
svn://svn.zope.org/repos/main/zope.structuredtext/tags/3.4.0/src/zope/structuredtext
tales
svn://svn.zope.org/repos/main/zope.tales/tags/3.4.0/src/zope/tales
tal  
svn://svn.zope.org/repos/main/zope.tal/tags/3.4.1/src/zope/tal
testbrowser  
svn://svn.zope.org/repos/main/zope.testbrowser/tags/3.4.2-zope2/src/zope/testbrowser
testing  
svn://svn.zope.org/repos/main/zope.testing/tags/3.5.3/src/zope/testing
thread   
svn://svn.zope.org/repos/main/zope.thread/tags/3.4/src/zope/thread
traversing   
svn://svn.zope.org/repos/main/zope.traversing/tags/3.4.0/src/zope/traversing
viewlet  
svn://svn.zope.org/repos/main/zope.viewlet/tags/3.4.2/src/zope/viewlet
wfmc 

[Zope-Checkins] SVN: Zope/trunk/lib/python/zope/app/ - Newer zope.app.appsetup

2008-10-26 Thread Sidnei da Silva
Log message for revision 92598:
   - Newer zope.app.appsetup

Changed:
  _U  Zope/trunk/lib/python/zope/app/

-=-

Property changes on: Zope/trunk/lib/python/zope/app
___
Name: svn:externals
   - annotation   
svn://svn.zope.org/repos/main/zope.app.annotation/tags/3.4.0/src/zope/app/annotation
apidoc   
svn://svn.zope.org/repos/main/zope.app.apidoc/tags/3.4.3/src/zope/app/apidoc
applicationcontrol   
svn://svn.zope.org/repos/main/zope.app.applicationcontrol/tags/3.4.1/src/zope/app/applicationcontrol
appsetup 
svn://svn.zope.org/repos/main/zope.app.appsetup/tags/3.4.1/src/zope/app/appsetup
authentication   
svn://svn.zope.org/repos/main/zope.app.authentication/tags/3.4.1/src/zope/app/authentication
basicskin
svn://svn.zope.org/repos/main/zope.app.basicskin/tags/3.4.0/src/zope/app/basicskin
broken   
svn://svn.zope.org/repos/main/zope.app.broken/tags/3.4.0/src/zope/app/broken
cache
svn://svn.zope.org/repos/main/zope.app.cache/tags/3.4.0/src/zope/app/cache
component
svn://svn.zope.org/repos/main/zope.app.component/tags/3.5.0/src/zope/app/component
container
svn://svn.zope.org/repos/main/zope.app.container/tags/3.6.2/src/zope/app/container
content  
svn://svn.zope.org/repos/main/zope.app.content/tags/3.4.0/src/zope/app/content
debug
svn://svn.zope.org/repos/main/zope.app.debug/tags/3.4.0/src/zope/app/debug
dependable   
svn://svn.zope.org/repos/main/zope.app.dependable/tags/3.4.0/src/zope/app/dependable
error
svn://svn.zope.org/repos/main/zope.app.error/tags/3.5.1/src/zope/app/error
exception
svn://svn.zope.org/repos/main/zope.app.exception/tags/3.4.1/src/zope/app/exception
file 
svn://svn.zope.org/repos/main/zope.app.file/tags/3.4.2/src/zope/app/file
folder   
svn://svn.zope.org/repos/main/zope.app.folder/tags/3.4.0/src/zope/app/folder
form 
svn://svn.zope.org/repos/main/zope.app.form/tags/3.6.3/src/zope/app/form
generations  
svn://svn.zope.org/repos/main/zope.app.generations/tags/3.4.1/src/zope/app/generations
http 
svn://svn.zope.org/repos/main/zope.app.http/tags/3.4.1/src/zope/app/http
i18n 
svn://svn.zope.org/repos/main/zope.app.i18n/tags/3.4.4/src/zope/app/i18n
interface
svn://svn.zope.org/repos/main/zope.app.interface/tags/3.4.0/src/zope/app/interface
intid
svn://svn.zope.org/repos/main/zope.app.intid/tags/3.4.1/src/zope/app/intid
keyreference 
svn://svn.zope.org/repos/main/zope.app.keyreference/tags/3.4.1/src/zope/app/keyreference
layers   
svn://svn.zope.org/repos/main/zope.app.layers/tags/3.4.0/src/zope/app/layers
locales  
svn://svn.zope.org/repos/main/zope.app.locales/tags/3.4.1/src/zope/app/locales
onlinehelp   
svn://svn.zope.org/repos/main/zope.app.onlinehelp/tags/3.4.1/src/zope/app/onlinehelp
pagetemplate 
svn://svn.zope.org/repos/main/zope.app.pagetemplate/tags/3.4.0/src/zope/app/pagetemplate
pluggableauth
svn://svn.zope.org/repos/main/zope.app.pluggableauth/tags/3.4.0/src/zope/app/pluggableauth
preference   
svn://svn.zope.org/repos/main/zope.app.preference/tags/3.4.1/src/zope/app/preference
preview  
svn://svn.zope.org/repos/main/zope.app.preview/tags/3.4.0/src/zope/app/preview
principalannotation  
svn://svn.zope.org/repos/main/zope.app.principalannotation/tags/3.4.0/src/zope/app/principalannotation
publication  
svn://svn.zope.org/repos/main/zope.app.publication/tags/3.5.0/src/zope/app/publication
publisher
svn://svn.zope.org/repos/main/zope.app.publisher/tags/3.5.1/src/zope/app/publisher
renderer 
svn://svn.zope.org/repos/main/zope.app.renderer/tags/3.4.0/src/zope/app/renderer
rotterdam
svn://svn.zope.org/repos/main/zope.app.rotterdam/tags/3.4.1/src/zope/app/rotterdam
schema   
svn://svn.zope.org/repos/main/zope.app.schema/tags/3.4.0/src/zope/app/schema
security 
svn://svn.zope.org/repos/main/zope.app.security/tags/3.5.2/src/zope/app/security
securitypolicy   
svn://svn.zope.org/repos/main/zope.app.securitypolicy/tags/3.4.6/src/zope/app/securitypolicy
session  
svn://svn.zope.org/repos/main/zope.app.session/tags/3.5.1/src/zope/app/session
skins
svn://svn.zope.org/repos/main/zope.app.skins/tags/3.4.0/src/zope/app/skins
sqlscript
svn://svn.zope.org/repos/main/zope.app.sqlscript/tags/3.4.1/src/zope/app/sqlscript
testing  
svn://svn.zope.org/repos/main/zope.app.testing/tags/3.5.6/src/zope/app/testing
traversing   
svn://svn.zope.org/repos/main/zope.app.traversing/tags/3.4.0/src/zope/app/traversing
tree 
svn://svn.zope.org/repos/main/zope.app.tree/tags/3.4.0/src/zope/app/tree
undo 

[Zope-Checkins] SVN: Zope/trunk/lib/python/ZServer/HTTPServer.py - Make it work with Python 2.4 too

2008-10-26 Thread Sidnei da Silva
Log message for revision 92607:
   - Make it work with Python 2.4 too

Changed:
  U   Zope/trunk/lib/python/ZServer/HTTPServer.py

-=-
Modified: Zope/trunk/lib/python/ZServer/HTTPServer.py
===
--- Zope/trunk/lib/python/ZServer/HTTPServer.py 2008-10-26 18:45:54 UTC (rev 
92606)
+++ Zope/trunk/lib/python/ZServer/HTTPServer.py 2008-10-26 20:41:03 UTC (rev 
92607)
@@ -45,9 +45,11 @@
 from ZPublisher.HTTPRequest import HTTPRequest
 from App.config import getConfiguration
 
+import asyncore
+import asynchat
+
 from medusa.http_server import http_server, get_header
 from medusa.http_server import fifo, http_channel, VERSION_STRING
-import asyncore
 from medusa import counter, producers
 from medusa.test import  max_sockets
 from medusa.default_handler import unquote
@@ -335,7 +337,7 @@
 
 def __init__(self, server, conn, addr):
 http_channel.__init__(self, server, conn, addr)
-if isinstance(self.producer_fifo, fifo):
+if isinstance(self.producer_fifo, (fifo, asynchat.fifo)):
 self.producer_fifo_push = self.producer_fifo.push
 self.producer_fifo_first = self.producer_fifo.first
 self.producer_fifo_pop = self.producer_fifo.pop
@@ -348,7 +350,7 @@
 del self.producer_fifo[0]
 self.producer_fifo_pop = pop
 requestCloseOnExec(conn)
-self.queue=[]
+self.queue = []
 self.working=0
 self.max_header_len = getConfiguration().http_header_max_length
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/ - Launchpad #280334: Fixed problem with 'timeout'

2008-10-25 Thread Sidnei da Silva
Log message for revision 92571:
  - Launchpad #280334: Fixed problem with 'timeout'
argument/attribute missing in testbrowser tests.
  
  

Changed:
  U   Zope/branches/gsoc-python-2.5/doc/CHANGES.txt
  U   Zope/branches/gsoc-python-2.5/lib/python/Products/Five/testbrowser.py

-=-
Modified: Zope/branches/gsoc-python-2.5/doc/CHANGES.txt
===
--- Zope/branches/gsoc-python-2.5/doc/CHANGES.txt   2008-10-26 00:38:25 UTC 
(rev 92570)
+++ Zope/branches/gsoc-python-2.5/doc/CHANGES.txt   2008-10-26 05:14:47 UTC 
(rev 92571)
@@ -198,6 +198,9 @@
 
 Bugs Fixed
 
+  - Launchpad #280334: Fixed problem with 'timeout'
+argument/attribute missing in testbrowser tests.
+
   - Fixed against-the-rules zope.conf option 'fast_listen' to read
 'fast-listen' (dash, not underscore).
 

Modified: Zope/branches/gsoc-python-2.5/lib/python/Products/Five/testbrowser.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/Products/Five/testbrowser.py   
2008-10-26 00:38:25 UTC (rev 92570)
+++ Zope/branches/gsoc-python-2.5/lib/python/Products/Five/testbrowser.py   
2008-10-26 05:14:47 UTC (rev 92571)
@@ -18,6 +18,8 @@
 $Id$
 
 
+import sys
+import socket
 import urllib2
 
 import mechanize
@@ -29,7 +31,7 @@
 
 class PublisherConnection(testing.PublisherConnection):
 
-def __init__(self, host):
+def __init__(self, host, timeout=None):
 from Testing.ZopeTestCase.zopedoctest.functional import http
 self.caller = http
 self.host = host
@@ -76,6 +78,10 @@
 def http_open(self, req):
 Open an HTTP connection having a ``urllib2`` request.
 # Here we connect to the publisher.
+if sys.version_info  (2, 6) and not hasattr(req, 'timeout'):
+# Workaround mechanize incompatibility with Python
+# 2.6. See: LP #280334
+req.timeout = socket._GLOBAL_DEFAULT_TIMEOUT
 return self.do_open(PublisherConnection, req)
 
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/lib/python/ - Switch to newer RestrictedPython

2008-10-25 Thread Sidnei da Silva
Log message for revision 92574:
   - Switch to newer RestrictedPython

Changed:
  _U  Zope/trunk/lib/python/

-=-

Property changes on: Zope/trunk/lib/python
___
Name: svn:externals
   - BTrees   
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/BTrees
ClientForm   svn://svn.zope.org/repos/main/Zope3/trunk/src/ClientForm
RestrictedPython 
svn://svn.zope.org/repos/main/RestrictedPython/tags/3.4.2/src/RestrictedPython
ThreadedAsync
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/ThreadedAsync
ZConfig  svn://svn.zope.org/repos/main/ZConfig/tags/2.5.1/ZConfig
ZEO  svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/ZEO
ZODB svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/ZODB
ZopeUndo svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/ZopeUndo
docutils svn://svn.zope.org/repos/main/docutils/tags/0.4.0
mechanizesvn://svn.zope.org/repos/main/Zope3/trunk/src/mechanize
persistent   
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/persistent
pytz svn://svn.zope.org/repos/main/Zope3/trunk/src/pytz
transaction  
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/transaction
zdaemon  
svn://svn.zope.org/repos/main/zdaemon/tags/2.0.2/src/zdaemon
zodbcode 
svn://svn.zope.org/repos/main/zodbcode/tags/3.4.0/src/zodbcode



   + BTrees   
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/BTrees
ClientForm   svn://svn.zope.org/repos/main/Zope3/trunk/src/ClientForm
RestrictedPython 
svn://svn.zope.org/repos/main/RestrictedPython/tags/3.4.3/src/RestrictedPython
ThreadedAsync
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/ThreadedAsync
ZConfig  svn://svn.zope.org/repos/main/ZConfig/tags/2.5.1/ZConfig
ZEO  svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/ZEO
ZODB svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/ZODB
ZopeUndo svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/ZopeUndo
docutils svn://svn.zope.org/repos/main/docutils/tags/0.4.0
mechanizesvn://svn.zope.org/repos/main/Zope3/trunk/src/mechanize
persistent   
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/persistent
pytz svn://svn.zope.org/repos/main/Zope3/trunk/src/pytz
transaction  
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1/src/transaction
zdaemon  
svn://svn.zope.org/repos/main/zdaemon/tags/2.0.2/src/zdaemon
zodbcode 
svn://svn.zope.org/repos/main/zodbcode/tags/3.4.0/src/zodbcode


___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/trunk/lib/python/zope/ - Bump version of zope.documenttemplate to 3.4.2

2008-10-25 Thread Sidnei da Silva
Log message for revision 92575:
   - Bump version of zope.documenttemplate to 3.4.2

Changed:
  _U  Zope/trunk/lib/python/zope/

-=-

Property changes on: Zope/trunk/lib/python/zope
___
Name: svn:externals
   - annotation   
svn://svn.zope.org/repos/main/zope.annotation/tags/3.4.0/src/zope/annotation
cachedescriptors 
svn://svn.zope.org/repos/main/zope.cachedescriptors/tags/3.4.0/src/zope/cachedescriptors
component
svn://svn.zope.org/repos/main/zope.component/tags/3.4.0/src/zope/component
configuration
svn://svn.zope.org/repos/main/zope.configuration/tags/3.4.0/src/zope/configuration
contentprovider  
svn://svn.zope.org/repos/main/zope.contentprovider/tags/3.4.0/src/zope/contentprovider
contenttype  
svn://svn.zope.org/repos/main/zope.contenttype/tags/3.4.0/src/zope/contenttype
copypastemove
svn://svn.zope.org/repos/main/zope.copypastemove/tags/3.4.0/src/zope/copypastemove
datetime 
svn://svn.zope.org/repos/main/zope.datetime/tags/3.4.0/src/zope/datetime
decorator
svn://svn.zope.org/repos/main/zope.decorator/tags/3.4.0/src/zope/decorator
deferredimport   
svn://svn.zope.org/repos/main/zope.deferredimport/tags/3.4.0/src/zope/deferredimport
deprecation  
svn://svn.zope.org/repos/main/zope.deprecation/tags/3.4.0/src/zope/deprecation
documenttemplate 
svn://svn.zope.org/repos/main/zope.documenttemplate/tags/3.4.0/src/zope/documenttemplate
dottedname   
svn://svn.zope.org/repos/main/zope.dottedname/tags/3.4.2/src/zope/dottedname
dublincore   
svn://svn.zope.org/repos/main/zope.dublincore/tags/3.4.0/src/zope/dublincore
error
svn://svn.zope.org/repos/main/zope.error/tags/3.5.1/src/zope/error
event
svn://svn.zope.org/repos/main/zope.event/tags/3.4.0/src/zope/event
exceptions   
svn://svn.zope.org/repos/main/zope.exceptions/tags/3.4.0/src/zope/exceptions
filerepresentation   
svn://svn.zope.org/repos/main/zope.filerepresentation/tags/3.4.0/src/zope/filerepresentation
formlib  
svn://svn.zope.org/repos/main/zope.formlib/tags/3.4.0/src/zope/formlib
hookable 
svn://svn.zope.org/repos/main/zope.hookable/tags/3.4.0/src/zope/hookable
i18nmessageid
svn://svn.zope.org/repos/main/zope.i18nmessageid/tags/3.4.3/src/zope/i18nmessageid
i18n 
svn://svn.zope.org/repos/main/zope.i18n/tags/3.4.0/src/zope/i18n
index
svn://svn.zope.org/repos/main/zope.index/tags/3.4.1/src/zope/index
interface
svn://svn.zope.org/repos/main/zope.interface/tags/3.4.1/src/zope/interface
lifecycleevent   
svn://svn.zope.org/repos/main/zope.lifecycleevent/tags/3.4.0/src/zope/lifecycleevent
location 
svn://svn.zope.org/repos/main/zope.location/tags/3.4.0/src/zope/location
minmax   
svn://svn.zope.org/repos/main/zope.minmax/tags/1.1.0/src/zope/minmax
modulealias  
svn://svn.zope.org/repos/main/zope.modulealias/tags/3.4.0/src/zope/modulealias
pagetemplate 
svn://svn.zope.org/repos/main/zope.pagetemplate/tags/3.4.0/src/zope/pagetemplate
proxy
svn://svn.zope.org/repos/main/zope.proxy/tags/3.4.0/src/zope/proxy
publisher
svn://svn.zope.org/repos/main/zope.publisher/tags/3.4.3/src/zope/publisher
rdb  
svn://svn.zope.org/repos/main/zope.rdb/tags/3.4.0/src/zope/rdb
schema   
svn://svn.zope.org/repos/main/zope.schema/tags/3.4.0/src/zope/schema
security 
svn://svn.zope.org/repos/main/zope.security/tags/3.4.0/src/zope/security
sequencesort 
svn://svn.zope.org/repos/main/zope.sequencesort/tags/3.4.0/src/zope/sequencesort
sendmail 
svn://svn.zope.org/repos/main/zope.sendmail/tags/3.5.0/src/zope/sendmail
server   
svn://svn.zope.org/repos/main/zope.server/tags/3.4.1/src/zope/server
session  
svn://svn.zope.org/repos/main/zope.session/tags/3.4.1/src/zope/session
size 
svn://svn.zope.org/repos/main/zope.size/tags/3.4.0/src/zope/size
securitypolicy   
svn://svn.zope.org/repos/main/zope.securitypolicy/tags/3.4.0/src/zope/securitypolicy
structuredtext   
svn://svn.zope.org/repos/main/zope.structuredtext/tags/3.4.0/src/zope/structuredtext
tales
svn://svn.zope.org/repos/main/zope.tales/tags/3.4.0/src/zope/tales
tal  
svn://svn.zope.org/repos/main/zope.tal/tags/3.4.1/src/zope/tal
testbrowser  
svn://svn.zope.org/repos/main/zope.testbrowser/tags/3.4.2-zope2/src/zope/testbrowser
testing  
svn://svn.zope.org/repos/main/zope.testing/tags/3.5.3/src/zope/testing
thread   
svn://svn.zope.org/repos/main/zope.thread/tags/3.4/src/zope/thread
traversing   
svn://svn.zope.org/repos/main/zope.traversing/tags/3.4.0/src/zope/traversing
viewlet  
svn://svn.zope.org/repos/main/zope.viewlet/tags/3.4.2/src/zope/viewlet
wfmc 

[Zope-Checkins] SVN: Zope/trunk/lib/python/zope/app/ - Bump versions of zope.app.component and zope.app.container

2008-10-25 Thread Sidnei da Silva
Log message for revision 92576:
   - Bump versions of zope.app.component and zope.app.container

Changed:
  _U  Zope/trunk/lib/python/zope/app/

-=-

Property changes on: Zope/trunk/lib/python/zope/app
___
Name: svn:externals
   - annotation   
svn://svn.zope.org/repos/main/zope.app.annotation/tags/3.4.0/src/zope/app/annotation
apidoc   
svn://svn.zope.org/repos/main/zope.app.apidoc/tags/3.4.3/src/zope/app/apidoc
applicationcontrol   
svn://svn.zope.org/repos/main/zope.app.applicationcontrol/tags/3.4.1/src/zope/app/applicationcontrol
appsetup 
svn://svn.zope.org/repos/main/zope.app.appsetup/tags/3.4.1/src/zope/app/appsetup
authentication   
svn://svn.zope.org/repos/main/zope.app.authentication/tags/3.4.1/src/zope/app/authentication
basicskin
svn://svn.zope.org/repos/main/zope.app.basicskin/tags/3.4.0/src/zope/app/basicskin
broken   
svn://svn.zope.org/repos/main/zope.app.broken/tags/3.4.0/src/zope/app/broken
cache
svn://svn.zope.org/repos/main/zope.app.cache/tags/3.4.0/src/zope/app/cache
component
svn://svn.zope.org/repos/main/zope.app.component/tags/3.4.1/src/zope/app/component
container
svn://svn.zope.org/repos/main/zope.app.container/tags/3.5.3/src/zope/app/container
content  
svn://svn.zope.org/repos/main/zope.app.content/tags/3.4.0/src/zope/app/content
debug
svn://svn.zope.org/repos/main/zope.app.debug/tags/3.4.0/src/zope/app/debug
dependable   
svn://svn.zope.org/repos/main/zope.app.dependable/tags/3.4.0/src/zope/app/dependable
error
svn://svn.zope.org/repos/main/zope.app.error/tags/3.5.1/src/zope/app/error
exception
svn://svn.zope.org/repos/main/zope.app.exception/tags/3.4.1/src/zope/app/exception
file 
svn://svn.zope.org/repos/main/zope.app.file/tags/3.4.2/src/zope/app/file
folder   
svn://svn.zope.org/repos/main/zope.app.folder/tags/3.4.0/src/zope/app/folder
form 
svn://svn.zope.org/repos/main/zope.app.form/tags/3.4.1/src/zope/app/form
generations  
svn://svn.zope.org/repos/main/zope.app.generations/tags/3.4.1/src/zope/app/generations
http 
svn://svn.zope.org/repos/main/zope.app.http/tags/3.4.1/src/zope/app/http
i18n 
svn://svn.zope.org/repos/main/zope.app.i18n/tags/3.4.4/src/zope/app/i18n
interface
svn://svn.zope.org/repos/main/zope.app.interface/tags/3.4.0/src/zope/app/interface
intid
svn://svn.zope.org/repos/main/zope.app.intid/tags/3.4.1/src/zope/app/intid
keyreference 
svn://svn.zope.org/repos/main/zope.app.keyreference/tags/3.4.1/src/zope/app/keyreference
layers   
svn://svn.zope.org/repos/main/zope.app.layers/tags/3.4.0/src/zope/app/layers
locales  
svn://svn.zope.org/repos/main/zope.app.locales/tags/3.4.1/src/zope/app/locales
onlinehelp   
svn://svn.zope.org/repos/main/zope.app.onlinehelp/tags/3.4.1/src/zope/app/onlinehelp
pagetemplate 
svn://svn.zope.org/repos/main/zope.app.pagetemplate/tags/3.4.0/src/zope/app/pagetemplate
pluggableauth
svn://svn.zope.org/repos/main/zope.app.pluggableauth/tags/3.4.0/src/zope/app/pluggableauth
preference   
svn://svn.zope.org/repos/main/zope.app.preference/tags/3.4.1/src/zope/app/preference
preview  
svn://svn.zope.org/repos/main/zope.app.preview/tags/3.4.0/src/zope/app/preview
principalannotation  
svn://svn.zope.org/repos/main/zope.app.principalannotation/tags/3.4.0/src/zope/app/principalannotation
publication  
svn://svn.zope.org/repos/main/zope.app.publication/tags/3.4.3/src/zope/app/publication
publisher
svn://svn.zope.org/repos/main/zope.app.publisher/tags/3.4.1/src/zope/app/publisher
renderer 
svn://svn.zope.org/repos/main/zope.app.renderer/tags/3.4.0/src/zope/app/renderer
rotterdam
svn://svn.zope.org/repos/main/zope.app.rotterdam/tags/3.4.1/src/zope/app/rotterdam
schema   
svn://svn.zope.org/repos/main/zope.app.schema/tags/3.4.0/src/zope/app/schema
security 
svn://svn.zope.org/repos/main/zope.app.security/tags/3.4.0/src/zope/app/security
securitypolicy   
svn://svn.zope.org/repos/main/zope.app.securitypolicy/tags/3.4.6/src/zope/app/securitypolicy
session  
svn://svn.zope.org/repos/main/zope.app.session/tags/3.5.1/src/zope/app/session
skins
svn://svn.zope.org/repos/main/zope.app.skins/tags/3.4.0/src/zope/app/skins
sqlscript
svn://svn.zope.org/repos/main/zope.app.sqlscript/tags/3.4.1/src/zope/app/sqlscript
testing  
svn://svn.zope.org/repos/main/zope.app.testing/tags/3.4.1/src/zope/app/testing
traversing   
svn://svn.zope.org/repos/main/zope.app.traversing/tags/3.4.0/src/zope/app/traversing
tree 
svn://svn.zope.org/repos/main/zope.app.tree/tags/3.4.0/src/zope/app/tree
undo 

[Zope-Checkins] SVN: Zope/trunk/lib/python/AccessControl/ - Launchpad #282677: fixed implementation of guarded_map and

2008-10-21 Thread Sidnei da Silva
Log message for revision 92436:
  - Launchpad #282677: fixed implementation of guarded_map and
provided tests and implementation for guarded_zip (RestrictedPython).
  
  

Changed:
  U   Zope/trunk/lib/python/AccessControl/ZopeGuards.py
  U   Zope/trunk/lib/python/AccessControl/tests/testZopeGuards.py

-=-
Modified: Zope/trunk/lib/python/AccessControl/ZopeGuards.py
===
--- Zope/trunk/lib/python/AccessControl/ZopeGuards.py   2008-10-21 17:07:58 UTC 
(rev 92435)
+++ Zope/trunk/lib/python/AccessControl/ZopeGuards.py   2008-10-21 17:30:18 UTC 
(rev 92436)
@@ -255,10 +255,18 @@
 safe_seqs = []
 for seqno in range(len(seqs)):
 seq = guarded_getitem(seqs, seqno)
-safe_seqs.append(seq)
+safe_seqs.append(guarded_iter(seq))
 return map(f, *safe_seqs)
 safe_builtins['map'] = guarded_map
 
+def guarded_zip(*seqs):
+safe_seqs = []
+for seqno in range(len(seqs)):
+seq = guarded_getitem(seqs, seqno)
+safe_seqs.append(guarded_iter(seq))
+return zip(*safe_seqs)
+safe_builtins['zip'] = guarded_zip
+
 def guarded_import(mname, globals=None, locals=None, fromlist=None):
 if fromlist is None:
 fromlist = ()

Modified: Zope/trunk/lib/python/AccessControl/tests/testZopeGuards.py
===
--- Zope/trunk/lib/python/AccessControl/tests/testZopeGuards.py 2008-10-21 
17:07:58 UTC (rev 92435)
+++ Zope/trunk/lib/python/AccessControl/tests/testZopeGuards.py 2008-10-21 
17:30:18 UTC (rev 92436)
@@ -19,6 +19,7 @@
 
 
 import os, sys
+import operator
 import unittest
 from zope.testing import doctest
 import ZODB
@@ -28,7 +29,7 @@
 from AccessControl.ZopeGuards \
 import guarded_getattr, get_dict_get, get_dict_pop, get_list_pop, \
 get_iter, guarded_min, guarded_max, safe_builtins, guarded_enumerate, \
-guarded_sum, guarded_apply
+guarded_sum, guarded_apply, guarded_map, guarded_zip
 
 try:
 __file__
@@ -236,6 +237,22 @@
 
 class TestBuiltinFunctionGuards(GuardTestCase):
 
+def test_zip_fails(self):
+sm = SecurityManager(1) # rejects
+old = self.setSecurityManager(sm)
+self.assertRaises(Unauthorized, guarded_zip, [1,2,3], [3,2,1])
+self.assertRaises(Unauthorized, guarded_zip, [1,2,3], [1])
+self.setSecurityManager(old)
+
+def test_map_fails(self):
+sm = SecurityManager(1) # rejects
+old = self.setSecurityManager(sm)
+self.assertRaises(Unauthorized, guarded_map, str, 
+  [1,2,3])
+self.assertRaises(Unauthorized, guarded_map, lambda x,y: x+y, 
+  [1,2,3], [3,2,1])
+self.setSecurityManager(old)
+
 def test_min_fails(self):
 sm = SecurityManager(1) # rejects
 old = self.setSecurityManager(sm)
@@ -263,6 +280,21 @@
 self.assertRaises(Unauthorized, guarded_sum, [1,2,3])
 self.setSecurityManager(old)
 
+def test_zip_succeeds(self):
+sm = SecurityManager() # accepts
+old = self.setSecurityManager(sm)
+self.assertEqual(guarded_zip([1,2,3], [3,2,1]), [(1,3),(2,2),(3,1)])
+self.assertEqual(guarded_zip([1,2,3], [1]), [(1,1)])
+self.setSecurityManager(old)
+
+def test_map_succeeds(self):
+sm = SecurityManager() # accepts
+old = self.setSecurityManager(sm)
+self.assertEqual(guarded_map(str, [1,2,3]), ['1','2','3'])
+self.assertEqual(guarded_map(lambda x,y: x+y, [1,2,3], [3,2,1]), 
+ [4,4,4])
+self.setSecurityManager(old)
+
 def test_min_succeeds(self):
 sm = SecurityManager() # accepts
 old = self.setSecurityManager(sm)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.9/lib/python/AccessControl/ - Launchpad #282677: fixed implementation of guarded_map and

2008-10-21 Thread Sidnei da Silva
Log message for revision 92437:
  - Launchpad #282677: fixed implementation of guarded_map and
provided tests and implementation for guarded_zip (RestrictedPython).
  
  

Changed:
  U   Zope/branches/2.9/lib/python/AccessControl/ZopeGuards.py
  U   Zope/branches/2.9/lib/python/AccessControl/tests/testZopeGuards.py

-=-
Modified: Zope/branches/2.9/lib/python/AccessControl/ZopeGuards.py
===
--- Zope/branches/2.9/lib/python/AccessControl/ZopeGuards.py2008-10-21 
17:30:18 UTC (rev 92436)
+++ Zope/branches/2.9/lib/python/AccessControl/ZopeGuards.py2008-10-21 
17:35:43 UTC (rev 92437)
@@ -255,10 +255,18 @@
 safe_seqs = []
 for seqno in range(len(seqs)):
 seq = guarded_getitem(seqs, seqno)
-safe_seqs.append(seq)
+safe_seqs.append(guarded_iter(seq))
 return map(f, *safe_seqs)
 safe_builtins['map'] = guarded_map
 
+def guarded_zip(*seqs):
+safe_seqs = []
+for seqno in range(len(seqs)):
+seq = guarded_getitem(seqs, seqno)
+safe_seqs.append(guarded_iter(seq))
+return zip(*safe_seqs)
+safe_builtins['zip'] = guarded_zip
+
 def guarded_import(mname, globals=None, locals=None, fromlist=None):
 if fromlist is None:
 fromlist = ()

Modified: Zope/branches/2.9/lib/python/AccessControl/tests/testZopeGuards.py
===
--- Zope/branches/2.9/lib/python/AccessControl/tests/testZopeGuards.py  
2008-10-21 17:30:18 UTC (rev 92436)
+++ Zope/branches/2.9/lib/python/AccessControl/tests/testZopeGuards.py  
2008-10-21 17:35:43 UTC (rev 92437)
@@ -19,6 +19,7 @@
 
 
 import os, sys
+import operator
 import unittest
 from zope.testing import doctest
 import ZODB
@@ -28,7 +29,7 @@
 from AccessControl.ZopeGuards \
 import guarded_getattr, get_dict_get, get_dict_pop, get_list_pop, \
 get_iter, guarded_min, guarded_max, safe_builtins, guarded_enumerate, \
-guarded_sum, guarded_apply
+guarded_sum, guarded_apply, guarded_map, guarded_zip
 
 try:
 __file__
@@ -236,6 +237,22 @@
 
 class TestBuiltinFunctionGuards(GuardTestCase):
 
+def test_zip_fails(self):
+sm = SecurityManager(1) # rejects
+old = self.setSecurityManager(sm)
+self.assertRaises(Unauthorized, guarded_zip, [1,2,3], [3,2,1])
+self.assertRaises(Unauthorized, guarded_zip, [1,2,3], [1])
+self.setSecurityManager(old)
+
+def test_map_fails(self):
+sm = SecurityManager(1) # rejects
+old = self.setSecurityManager(sm)
+self.assertRaises(Unauthorized, guarded_map, str, 
+  [1,2,3])
+self.assertRaises(Unauthorized, guarded_map, lambda x,y: x+y, 
+  [1,2,3], [3,2,1])
+self.setSecurityManager(old)
+
 def test_min_fails(self):
 sm = SecurityManager(1) # rejects
 old = self.setSecurityManager(sm)
@@ -263,6 +280,21 @@
 self.assertRaises(Unauthorized, guarded_sum, [1,2,3])
 self.setSecurityManager(old)
 
+def test_zip_succeeds(self):
+sm = SecurityManager() # accepts
+old = self.setSecurityManager(sm)
+self.assertEqual(guarded_zip([1,2,3], [3,2,1]), [(1,3),(2,2),(3,1)])
+self.assertEqual(guarded_zip([1,2,3], [1]), [(1,1)])
+self.setSecurityManager(old)
+
+def test_map_succeeds(self):
+sm = SecurityManager() # accepts
+old = self.setSecurityManager(sm)
+self.assertEqual(guarded_map(str, [1,2,3]), ['1','2','3'])
+self.assertEqual(guarded_map(lambda x,y: x+y, [1,2,3], [3,2,1]), 
+ [4,4,4])
+self.setSecurityManager(old)
+
 def test_min_succeeds(self):
 sm = SecurityManager() # accepts
 old = self.setSecurityManager(sm)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.9/doc/CHANGES.txt - Record last checkin

2008-10-21 Thread Sidnei da Silva
Log message for revision 92438:
   - Record last checkin

Changed:
  U   Zope/branches/2.9/doc/CHANGES.txt

-=-
Modified: Zope/branches/2.9/doc/CHANGES.txt
===
--- Zope/branches/2.9/doc/CHANGES.txt   2008-10-21 17:35:43 UTC (rev 92437)
+++ Zope/branches/2.9/doc/CHANGES.txt   2008-10-21 17:37:30 UTC (rev 92438)
@@ -8,6 +8,10 @@
 
Bugs fixed
 
+  - Launchpad #282677: fixed implementation of guarded_map and
+provided tests and implementation for guarded_zip
+(RestrictedPython).
+
   - 'AccessControl.ZopeGuards.guarded_import' mapped some Unauthorized
 exceptions onto ImportErrors:  don't do that!  Also, removed
 mutable defaults from argument list, improved tests.

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.11/ - Launchpad #282677: fixed implementation of guarded_map and provided

2008-10-21 Thread Sidnei da Silva
Log message for revision 92440:
  - Launchpad #282677: fixed implementation of guarded_map and provided
tests and implementation for guarded_zip (RestrictedPython).
  
  

Changed:
  U   Zope/branches/2.11/doc/CHANGES.txt
  U   Zope/branches/2.11/lib/python/AccessControl/ZopeGuards.py
  U   Zope/branches/2.11/lib/python/AccessControl/tests/testZopeGuards.py

-=-
Modified: Zope/branches/2.11/doc/CHANGES.txt
===
--- Zope/branches/2.11/doc/CHANGES.txt  2008-10-21 17:38:54 UTC (rev 92439)
+++ Zope/branches/2.11/doc/CHANGES.txt  2008-10-21 17:40:10 UTC (rev 92440)
@@ -8,6 +8,9 @@
 
 Bugs Fixed
 
+  - Launchpad #282677: fixed implementation of guarded_map and
+provided tests and implementation for guarded_zip (RestrictedPython).
+
   - updated to ZODB 3.8.1
 
   - Lauchpad #143736,#271395: fixed AttributeError' on _ltid in TempStorage

Modified: Zope/branches/2.11/lib/python/AccessControl/ZopeGuards.py
===
--- Zope/branches/2.11/lib/python/AccessControl/ZopeGuards.py   2008-10-21 
17:38:54 UTC (rev 92439)
+++ Zope/branches/2.11/lib/python/AccessControl/ZopeGuards.py   2008-10-21 
17:40:10 UTC (rev 92440)
@@ -255,10 +255,18 @@
 safe_seqs = []
 for seqno in range(len(seqs)):
 seq = guarded_getitem(seqs, seqno)
-safe_seqs.append(seq)
+safe_seqs.append(guarded_iter(seq))
 return map(f, *safe_seqs)
 safe_builtins['map'] = guarded_map
 
+def guarded_zip(*seqs):
+safe_seqs = []
+for seqno in range(len(seqs)):
+seq = guarded_getitem(seqs, seqno)
+safe_seqs.append(guarded_iter(seq))
+return zip(*safe_seqs)
+safe_builtins['zip'] = guarded_zip
+
 def guarded_import(mname, globals=None, locals=None, fromlist=None):
 if fromlist is None:
 fromlist = ()

Modified: Zope/branches/2.11/lib/python/AccessControl/tests/testZopeGuards.py
===
--- Zope/branches/2.11/lib/python/AccessControl/tests/testZopeGuards.py 
2008-10-21 17:38:54 UTC (rev 92439)
+++ Zope/branches/2.11/lib/python/AccessControl/tests/testZopeGuards.py 
2008-10-21 17:40:10 UTC (rev 92440)
@@ -19,6 +19,7 @@
 
 
 import os, sys
+import operator
 import unittest
 from zope.testing import doctest
 import ZODB
@@ -28,7 +29,7 @@
 from AccessControl.ZopeGuards \
 import guarded_getattr, get_dict_get, get_dict_pop, get_list_pop, \
 get_iter, guarded_min, guarded_max, safe_builtins, guarded_enumerate, \
-guarded_sum, guarded_apply
+guarded_sum, guarded_apply, guarded_map, guarded_zip
 
 try:
 __file__
@@ -236,6 +237,22 @@
 
 class TestBuiltinFunctionGuards(GuardTestCase):
 
+def test_zip_fails(self):
+sm = SecurityManager(1) # rejects
+old = self.setSecurityManager(sm)
+self.assertRaises(Unauthorized, guarded_zip, [1,2,3], [3,2,1])
+self.assertRaises(Unauthorized, guarded_zip, [1,2,3], [1])
+self.setSecurityManager(old)
+
+def test_map_fails(self):
+sm = SecurityManager(1) # rejects
+old = self.setSecurityManager(sm)
+self.assertRaises(Unauthorized, guarded_map, str, 
+  [1,2,3])
+self.assertRaises(Unauthorized, guarded_map, lambda x,y: x+y, 
+  [1,2,3], [3,2,1])
+self.setSecurityManager(old)
+
 def test_min_fails(self):
 sm = SecurityManager(1) # rejects
 old = self.setSecurityManager(sm)
@@ -263,6 +280,21 @@
 self.assertRaises(Unauthorized, guarded_sum, [1,2,3])
 self.setSecurityManager(old)
 
+def test_zip_succeeds(self):
+sm = SecurityManager() # accepts
+old = self.setSecurityManager(sm)
+self.assertEqual(guarded_zip([1,2,3], [3,2,1]), [(1,3),(2,2),(3,1)])
+self.assertEqual(guarded_zip([1,2,3], [1]), [(1,1)])
+self.setSecurityManager(old)
+
+def test_map_succeeds(self):
+sm = SecurityManager() # accepts
+old = self.setSecurityManager(sm)
+self.assertEqual(guarded_map(str, [1,2,3]), ['1','2','3'])
+self.assertEqual(guarded_map(lambda x,y: x+y, [1,2,3], [3,2,1]), 
+ [4,4,4])
+self.setSecurityManager(old)
+
 def test_min_succeeds(self):
 sm = SecurityManager() # accepts
 old = self.setSecurityManager(sm)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/2.10/ - Launchpad #282677: fixed implementation of guarded_map and provided

2008-10-21 Thread Sidnei da Silva
Log message for revision 92439:
  - Launchpad #282677: fixed implementation of guarded_map and provided
tests and implementation for guarded_zip (RestrictedPython).
  
  

Changed:
  U   Zope/branches/2.10/doc/CHANGES.txt
  U   Zope/branches/2.10/lib/python/AccessControl/ZopeGuards.py
  U   Zope/branches/2.10/lib/python/AccessControl/tests/testZopeGuards.py

-=-
Modified: Zope/branches/2.10/doc/CHANGES.txt
===
--- Zope/branches/2.10/doc/CHANGES.txt  2008-10-21 17:37:30 UTC (rev 92438)
+++ Zope/branches/2.10/doc/CHANGES.txt  2008-10-21 17:38:54 UTC (rev 92439)
@@ -8,6 +8,10 @@
 
 Bugs fixed
 
+  - Launchpad #282677: fixed implementation of guarded_map and
+provided tests and implementation for guarded_zip
+(RestrictedPython).
+
   - Lauchpad #143736,#271395: fixed AttributeError' on _ltid in TempStorage
 
   - 'AccessControl.ZopeGuards.guarded_import' mapped some Unauthorized

Modified: Zope/branches/2.10/lib/python/AccessControl/ZopeGuards.py
===
--- Zope/branches/2.10/lib/python/AccessControl/ZopeGuards.py   2008-10-21 
17:37:30 UTC (rev 92438)
+++ Zope/branches/2.10/lib/python/AccessControl/ZopeGuards.py   2008-10-21 
17:38:54 UTC (rev 92439)
@@ -255,10 +255,18 @@
 safe_seqs = []
 for seqno in range(len(seqs)):
 seq = guarded_getitem(seqs, seqno)
-safe_seqs.append(seq)
+safe_seqs.append(guarded_iter(seq))
 return map(f, *safe_seqs)
 safe_builtins['map'] = guarded_map
 
+def guarded_zip(*seqs):
+safe_seqs = []
+for seqno in range(len(seqs)):
+seq = guarded_getitem(seqs, seqno)
+safe_seqs.append(guarded_iter(seq))
+return zip(*safe_seqs)
+safe_builtins['zip'] = guarded_zip
+
 def guarded_import(mname, globals=None, locals=None, fromlist=None):
 if fromlist is None:
 fromlist = ()

Modified: Zope/branches/2.10/lib/python/AccessControl/tests/testZopeGuards.py
===
--- Zope/branches/2.10/lib/python/AccessControl/tests/testZopeGuards.py 
2008-10-21 17:37:30 UTC (rev 92438)
+++ Zope/branches/2.10/lib/python/AccessControl/tests/testZopeGuards.py 
2008-10-21 17:38:54 UTC (rev 92439)
@@ -19,6 +19,7 @@
 
 
 import os, sys
+import operator
 import unittest
 from zope.testing import doctest
 import ZODB
@@ -28,7 +29,7 @@
 from AccessControl.ZopeGuards \
 import guarded_getattr, get_dict_get, get_dict_pop, get_list_pop, \
 get_iter, guarded_min, guarded_max, safe_builtins, guarded_enumerate, \
-guarded_sum, guarded_apply
+guarded_sum, guarded_apply, guarded_map, guarded_zip
 
 try:
 __file__
@@ -236,6 +237,22 @@
 
 class TestBuiltinFunctionGuards(GuardTestCase):
 
+def test_zip_fails(self):
+sm = SecurityManager(1) # rejects
+old = self.setSecurityManager(sm)
+self.assertRaises(Unauthorized, guarded_zip, [1,2,3], [3,2,1])
+self.assertRaises(Unauthorized, guarded_zip, [1,2,3], [1])
+self.setSecurityManager(old)
+
+def test_map_fails(self):
+sm = SecurityManager(1) # rejects
+old = self.setSecurityManager(sm)
+self.assertRaises(Unauthorized, guarded_map, str, 
+  [1,2,3])
+self.assertRaises(Unauthorized, guarded_map, lambda x,y: x+y, 
+  [1,2,3], [3,2,1])
+self.setSecurityManager(old)
+
 def test_min_fails(self):
 sm = SecurityManager(1) # rejects
 old = self.setSecurityManager(sm)
@@ -263,6 +280,21 @@
 self.assertRaises(Unauthorized, guarded_sum, [1,2,3])
 self.setSecurityManager(old)
 
+def test_zip_succeeds(self):
+sm = SecurityManager() # accepts
+old = self.setSecurityManager(sm)
+self.assertEqual(guarded_zip([1,2,3], [3,2,1]), [(1,3),(2,2),(3,1)])
+self.assertEqual(guarded_zip([1,2,3], [1]), [(1,1)])
+self.setSecurityManager(old)
+
+def test_map_succeeds(self):
+sm = SecurityManager() # accepts
+old = self.setSecurityManager(sm)
+self.assertEqual(guarded_map(str, [1,2,3]), ['1','2','3'])
+self.assertEqual(guarded_map(lambda x,y: x+y, [1,2,3], [3,2,1]), 
+ [4,4,4])
+self.setSecurityManager(old)
+
 def test_min_succeeds(self):
 sm = SecurityManager() # accepts
 old = self.setSecurityManager(sm)

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


Re: [Zope-dev] Zope 2.12 - supported Python versions

2008-10-15 Thread Sidnei da Silva
On Wed, Oct 15, 2008 at 11:28 AM, Hanno Schlichting
[EMAIL PROTECTED] wrote:
 Stephan Richter wrote:
 On Wednesday 15 October 2008, Sidnei da Silva wrote:
 I don't want to rain on your parade, but I already did a first pass at
 reviewing the changes in Python 2.5 and Python 2.6. There are no
 significant changes that I could spot so far. Apparently the major
 changes are:

 I also did a review for Python 2.5 a while ago...

 So does this mean RestrictedPython just had a bad emotional status in
 the community, but it is actually well proven and reviewed now?

 I always was under the impression that Jim feared the code and the
 required security audit was perceived as a major painful undertaking.

That was my perception too. But after looking at the code it is really
not bad at all.

-- 
Sidnei da Silva
Enfold Systemshttp://enfoldsystems.com
Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Zope 2.12 - supported Python versions

2008-10-15 Thread Sidnei da Silva
Folks,

I don't want to rain on your parade, but I already did a first pass at
reviewing the changes in Python 2.5 and Python 2.6. There are no
significant changes that I could spot so far. Apparently the major
changes are:

- Ternary 'if'
- Context Managers ('with' keyword)

Both of those are just syntactic sugar for already existing idioms and
they are pretty much covered by already existing transformation of the
ast tree.

Also, the only new bytecode seems to be 'WITH_CLEANUP' which is part
of the handling of the 'with' keyword.

In general, RestrictedPython seems to be well-structured and the tests
are easy to extend and understand for someone that played with ast
(like the folks playing with z3c.pt).

-- 
Sidnei da Silva
Enfold Systemshttp://enfoldsystems.com
Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Zope 2.12 - supported Python versions

2008-10-14 Thread Sidnei da Silva
On Tue, Oct 14, 2008 at 2:16 PM, Andreas Jung [EMAIL PROTECTED] wrote:
 Thanks for starting the discussion. Going for Python 2.6 also requires that
 we get the ZCA running on top of Python 2.6 until some time next year.

FWIW, that's what I've been working on. There's enough of the the ZCA
working on Python 2.6 to run Zope 2. Would anything else be needed? I
would say we are pretty much done as far as Zope 2 is concerned.

-- 
Sidnei da Silva
Enfold Systemshttp://enfoldsystems.com
Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Relative Imports: PEP-328

2008-10-14 Thread Sidnei da Silva
FWIW, I've done that now.

On Wed, Oct 8, 2008 at 9:43 AM, Philipp von Weitershausen
[EMAIL PROTECTED] wrote:

 El 8 Oct 2008, a las 14:23 , Sidnei da Silva escribió:

 On Wed, Oct 8, 2008 at 8:53 AM, Philipp von Weitershausen
 [EMAIL PROTECTED] wrote:

 Sidnei da Silva wrote:

 I'm trying to fix some import errors, which seem to be related to
 PEP-328.

 I'm fixing those errors this way, though I don't know if that's the
 recommended way of fixing it. Thoughts?

 
 try:
  from DT_Util import parse_params, name_param
 except ImportError:
  # See PEP-328
  from .DT_Util import parse_params, name_param
 

 This will generate a SyntaxError in Python 2.4. So unless we *require*
 Python = 2.5, this won't work.

 Yuck. I hadn't thought of that. Any other suggestions? Like, using
 zope.documenttemplate? :)

 zope.documenttemplate is a crippled version of DocumentTemplate. It doesn't
 have all features (e.g. it lacks the C extension module) and hasn't been
 kept up-to-date with respect to bugfixes. So it seems like a good idea to
 put this clone out of its misery and retire it.

 I ultimately suggest going to absolute imports everywhere (at least as long
 as we have to maintain Python 2.4 compatibility). I realize that
 DocumentTemplate/DocumentTemplate.py creates a problem. So here's what I
 suggest:

  1. Rename DocumentTemplate/DocumentTemplate.py to, say,
 DocumentTemplate/DocTemplate.py (feel free to come up with
 a better name)

  2. Introduce absolute imports to DocumentTemplate.DocTemplate
 everywhere

  3. Ensure backwards compatibility by adding the following lines
 to DocumentTemplate/__init__.py::

import DocumentTemplate.DocTemplate
import sys
sys.modules['DocumentTemplate.DocumentTemplate'] =
 DocumentTemplate.DocTemplate

 I *think* this should work.





-- 
Sidnei da Silva
Enfold Systemshttp://enfoldsystems.com
Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/zope/app/ - Update some externals to trunk versions

2008-10-13 Thread Sidnei da Silva
Log message for revision 92148:
   - Update some externals to trunk versions

Changed:
  _U  Zope/branches/gsoc-python-2.5/lib/python/zope/app/

-=-

Property changes on: Zope/branches/gsoc-python-2.5/lib/python/zope/app
___
Name: svn:externals
   - annotation   
svn://svn.zope.org/repos/main/zope.app.annotation/tags/3.4.0/src/zope/app/annotation
apidoc   
svn://svn.zope.org/repos/main/zope.app.apidoc/tags/3.4.3/src/zope/app/apidoc
applicationcontrol   
svn://svn.zope.org/repos/main/zope.app.applicationcontrol/tags/3.4.1/src/zope/app/applicationcontrol
appsetup 
svn://svn.zope.org/repos/main/zope.app.appsetup/tags/3.4.1/src/zope/app/appsetup
authentication   
svn://svn.zope.org/repos/main/zope.app.authentication/tags/3.4.1/src/zope/app/authentication
basicskin
svn://svn.zope.org/repos/main/zope.app.basicskin/tags/3.4.0/src/zope/app/basicskin
broken   
svn://svn.zope.org/repos/main/zope.app.broken/tags/3.4.0/src/zope/app/broken
cache
svn://svn.zope.org/repos/main/zope.app.cache/tags/3.4.0/src/zope/app/cache
component
svn://svn.zope.org/repos/main/zope.app.component/branches/sidnei-back35-quick-hack/src/zope/app/component
container
svn://svn.zope.org/repos/main/zope.app.container/tags/3.5.3/src/zope/app/container
content  
svn://svn.zope.org/repos/main/zope.app.content/tags/3.4.0/src/zope/app/content
debug
svn://svn.zope.org/repos/main/zope.app.debug/tags/3.4.0/src/zope/app/debug
dependable   
svn://svn.zope.org/repos/main/zope.app.dependable/tags/3.4.0/src/zope/app/dependable
error
svn://svn.zope.org/repos/main/zope.app.error/tags/3.5.1/src/zope/app/error
exception
svn://svn.zope.org/repos/main/zope.app.exception/tags/3.4.1/src/zope/app/exception
file 
svn://svn.zope.org/repos/main/zope.app.file/tags/3.4.2/src/zope/app/file
folder   
svn://svn.zope.org/repos/main/zope.app.folder/tags/3.4.0/src/zope/app/folder
form 
svn://svn.zope.org/repos/main/zope.app.form/tags/3.4.1/src/zope/app/form
generations  
svn://svn.zope.org/repos/main/zope.app.generations/tags/3.4.1/src/zope/app/generations
http 
svn://svn.zope.org/repos/main/zope.app.http/tags/3.4.1/src/zope/app/http
i18n 
svn://svn.zope.org/repos/main/zope.app.i18n/tags/3.4.4/src/zope/app/i18n
interface
svn://svn.zope.org/repos/main/zope.app.interface/tags/3.4.0/src/zope/app/interface
intid
svn://svn.zope.org/repos/main/zope.app.intid/tags/3.4.1/src/zope/app/intid
keyreference 
svn://svn.zope.org/repos/main/zope.app.keyreference/tags/3.4.1/src/zope/app/keyreference
layers   
svn://svn.zope.org/repos/main/zope.app.layers/tags/3.4.0/src/zope/app/layers
locales  
svn://svn.zope.org/repos/main/zope.app.locales/tags/3.4.1/src/zope/app/locales
onlinehelp   
svn://svn.zope.org/repos/main/zope.app.onlinehelp/tags/3.4.1/src/zope/app/onlinehelp
pagetemplate 
svn://svn.zope.org/repos/main/zope.app.pagetemplate/tags/3.4.0/src/zope/app/pagetemplate
pluggableauth
svn://svn.zope.org/repos/main/zope.app.pluggableauth/tags/3.4.0/src/zope/app/pluggableauth
preference   
svn://svn.zope.org/repos/main/zope.app.preference/tags/3.4.1/src/zope/app/preference
preview  
svn://svn.zope.org/repos/main/zope.app.preview/tags/3.4.0/src/zope/app/preview
principalannotation  
svn://svn.zope.org/repos/main/zope.app.principalannotation/tags/3.4.0/src/zope/app/principalannotation
publication  
svn://svn.zope.org/repos/main/zope.app.publication/tags/3.4.3/src/zope/app/publication
publisher
svn://svn.zope.org/repos/main/zope.app.publisher/tags/3.4.1/src/zope/app/publisher
renderer 
svn://svn.zope.org/repos/main/zope.app.renderer/tags/3.4.0/src/zope/app/renderer
rotterdam
svn://svn.zope.org/repos/main/zope.app.rotterdam/tags/3.4.1/src/zope/app/rotterdam
schema   
svn://svn.zope.org/repos/main/zope.app.schema/tags/3.4.0/src/zope/app/schema
security 
svn://svn.zope.org/repos/main/zope.app.security/tags/3.4.0/src/zope/app/security
securitypolicy   
svn://svn.zope.org/repos/main/zope.app.securitypolicy/tags/3.4.6/src/zope/app/securitypolicy
session  
svn://svn.zope.org/repos/main/zope.app.session/tags/3.5.1/src/zope/app/session
skins
svn://svn.zope.org/repos/main/zope.app.skins/tags/3.4.0/src/zope/app/skins
sqlscript
svn://svn.zope.org/repos/main/zope.app.sqlscript/tags/3.4.1/src/zope/app/sqlscript
testing  
svn://svn.zope.org/repos/main/zope.app.testing/tags/3.4.1/src/zope/app/testing
traversing   
svn://svn.zope.org/repos/main/zope.app.traversing/tags/3.4.0/src/zope/app/traversing
tree 

[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/ - ZODB 3.8.1b9

2008-10-13 Thread Sidnei da Silva
Log message for revision 92172:
   - ZODB 3.8.1b9

Changed:
  _U  Zope/branches/gsoc-python-2.5/lib/python/

-=-

Property changes on: Zope/branches/gsoc-python-2.5/lib/python
___
Name: svn:externals
   - BTrees   
svn://svn.zope.org/repos/main/ZODB/tags/3.8.0/src/BTrees
ClientForm   svn://svn.zope.org/repos/main/Zope3/trunk/src/ClientForm
RestrictedPython 
svn://svn.zope.org/repos/main/RestrictedPython/trunk/src/RestrictedPython
ThreadedAsync
svn://svn.zope.org/repos/main/ZODB/tags/3.8.0/src/ThreadedAsync
ZConfig  svn://svn.zope.org/repos/main/ZConfig/tags/2.5.1/ZConfig
ZEO  svn://svn.zope.org/repos/main/ZODB/tags/3.8.0/src/ZEO
ZODB svn://svn.zope.org/repos/main/ZODB/tags/3.8.0/src/ZODB
ZopeUndo svn://svn.zope.org/repos/main/ZODB/tags/3.8.0/src/ZopeUndo
docutils svn://svn.zope.org/repos/main/docutils/tags/0.4.0
mechanizesvn://svn.zope.org/repos/main/Zope3/trunk/src/mechanize
persistent   
svn://svn.zope.org/repos/main/ZODB/tags/3.8.0/src/persistent
pytz svn://svn.zope.org/repos/main/Zope3/trunk/src/pytz
transaction  
svn://svn.zope.org/repos/main/ZODB/tags/3.8.0/src/transaction
zdaemon  
svn://svn.zope.org/repos/main/zdaemon/tags/2.0.2/src/zdaemon
zodbcode 
svn://svn.zope.org/repos/main/zodbcode/tags/3.4.0/src/zodbcode



   + BTrees   
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1b9/src/BTrees
ClientForm   svn://svn.zope.org/repos/main/Zope3/trunk/src/ClientForm
RestrictedPython 
svn://svn.zope.org/repos/main/RestrictedPython/trunk/src/RestrictedPython
ThreadedAsync
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1b9/src/ThreadedAsync
ZConfig  svn://svn.zope.org/repos/main/ZConfig/tags/2.5.1/ZConfig
ZEO  svn://svn.zope.org/repos/main/ZODB/tags/3.8.1b9/src/ZEO
ZODB svn://svn.zope.org/repos/main/ZODB/tags/3.8.1b9/src/ZODB
ZopeUndo 
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1b9/src/ZopeUndo
docutils svn://svn.zope.org/repos/main/docutils/tags/0.4.0
mechanizesvn://svn.zope.org/repos/main/Zope3/trunk/src/mechanize
persistent   
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1b9/src/persistent
pytz svn://svn.zope.org/repos/main/Zope3/trunk/src/pytz
transaction  
svn://svn.zope.org/repos/main/ZODB/tags/3.8.1b9/src/transaction
zdaemon  
svn://svn.zope.org/repos/main/zdaemon/tags/2.0.2/src/zdaemon
zodbcode 
svn://svn.zope.org/repos/main/zodbcode/tags/3.4.0/src/zodbcode




___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/ - Convert another string exception to normal exception

2008-10-13 Thread Sidnei da Silva
Log message for revision 92176:
   - Convert another string exception to normal exception

Changed:
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Util.py
  U   Zope/branches/gsoc-python-2.5/lib/python/Shared/DC/ZRDB/sqlvar.py

-=-
Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Util.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Util.py
2008-10-13 21:07:59 UTC (rev 92175)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Util.py
2008-10-13 21:31:16 UTC (rev 92176)
@@ -42,7 +42,9 @@
 
 str=__builtins__['str'] # Wa, w needed for pickling wa
 
-ParseError='Document Template Parse Error'
+class ParseError(Exception):
+Document Template Parse Error
+
 from zExceptions import Unauthorized as ValidationError
 
 def int_param(params,md,name,default=0, st=type('')):
@@ -248,37 +250,37 @@
 
 if v[:1]=='' and v[-1:]=='' and len(v)  1: # expr shorthand
 if used(attr):
-raise ParseError, ('%s and expr given' % attr, tag)
+raise ParseError('%s and expr given' % attr, tag)
 if expr:
 if used('expr'):
-raise ParseError, ('two exprs given', tag)
+raise ParseError('two exprs given', tag)
 v=v[1:-1]
 try: expr=Eval(v)
 except SyntaxError, v:
-raise ParseError, (
+raise ParseError(
 'strongExpression (Python) Syntax error/strong:'
 '\npre\n%s\n/pre\n' % v[0],
 tag)
 return v, expr
-else: raise ParseError, (
+else: raise ParseError(
 'The ... shorthand for expr was used in a tag '
 'that doesn\'t support expr attributes.',
 tag)
 
 else: # name shorthand
 if used(attr):
-raise ParseError, ('Two %s values were given' % attr, tag)
+raise ParseError('Two %s values were given' % attr, tag)
 if expr:
 if used('expr'):
 # raise 'Waa', 'waaa'
-raise ParseError, ('%s and expr given' % attr, tag)
+raise ParseError('%s and expr given' % attr, tag)
 return params[''],None
 return params['']
 
 elif used(attr):
 if expr:
 if used('expr'):
-raise ParseError, ('%s and expr given' % attr, tag)
+raise ParseError('%s and expr given' % attr, tag)
 return params[attr],None
 return params[attr]
 elif expr and used('expr'):
@@ -286,7 +288,7 @@
 expr=Eval(name)
 return name, expr
 
-raise ParseError, ('No %s given' % attr, tag)
+raise ParseError('No %s given' % attr, tag)
 
 Expr_doc=
 
@@ -399,11 +401,11 @@
 l=len(mo_unp.group(1))
 if result:
 if parms.has_key(name):
-if parms[name] is None: raise ParseError, (
+if parms[name] is None: raise ParseError(
 'Attribute %s requires a value' % name, tag)
 
 result[name]=parms[name]
-else: raise ParseError, (
+else: raise ParseError(
 'Invalid attribute name, %s' % name, tag)
 else:
 result['']=name
@@ -411,22 +413,22 @@
 elif mo_unq:
 name=mo_unq.group(2)
 l=len(mo_unq.group(1))
-if result: raise ParseError, (
+if result: raise ParseError(
 'Invalid attribute name, %s' % name, tag)
 else: result['']=name
 return parse_params(text[l:],result,**parms)
 else:
 if not text or not text.strip(): return result
-raise ParseError, ('invalid parameter: %s' % text, tag)
+raise ParseError('invalid parameter: %s' % text, tag)
 
 if not parms.has_key(name):
-raise ParseError, (
+raise ParseError(
 'Invalid attribute name, %s' % name, tag)
 
 if result.has_key(name):
 p=parms[name]
 if type(p) is not ListType or p:
-raise ParseError, (
+raise ParseError(
 'Duplicate values for attribute %s' % name, tag)
 
 result[name]=value

Modified: Zope/branches/gsoc-python-2.5/lib/python/Shared/DC/ZRDB/sqlvar.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/Shared/DC/ZRDB/sqlvar.py   
2008-10-13 21:07:59 UTC (rev 92175)
+++ Zope/branches/gsoc-python-2.5/lib/python/Shared/DC/ZRDB/sqlvar.py   
2008-10-13 21:31:16 UTC (rev 92176)
@@ -78,10 +78,10 @@
 
 self.args=args
 if not args.has_key('type'):
-raise ParseError, ('the type attribute is required', 'dtvar')
+raise 

[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/ - Cleanup DocumentTemplate module for relative imports

2008-10-13 Thread Sidnei da Silva
Log message for revision 92178:
   - Cleanup DocumentTemplate module for relative imports

Changed:
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_HTML.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_If.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_In.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_InSV.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Let.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Raise.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Return.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_String.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Try.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_UI.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Util.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Var.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_With.py
  D   
Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DocumentTemplate.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/VSEval.py
  A   
Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/_DocumentTemplate.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/__init__.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/html_quote.py
  U   
Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/pDocumentTemplate.py
  U   Zope/branches/gsoc-python-2.5/lib/python/Shared/DC/ZRDB/sqlvar.py

-=-
Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_HTML.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_HTML.py
2008-10-13 21:46:29 UTC (rev 92177)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_HTML.py
2008-10-13 21:50:06 UTC (rev 92178)
@@ -14,9 +14,9 @@
 
 $Id$
 
-from DT_String import String, FileMixin
-import DT_String, re
-from DT_Util import ParseError, str
+import re
+from DocumentTemplate.DT_String import String, FileMixin
+from DocumentTemplate.DT_Util import ParseError, str
 
 class dtml_re_class:
  This needs to be replaced before 2.4.  It's a hackaround. 
@@ -129,7 +129,7 @@
 def start(self, *args):
 return self._start
 
-class HTML(DT_String.String):
+class HTML(String):
 HTML Document Templates
 
 HTML Document templates use HTML server-side-include syntax,

Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_If.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_If.py  
2008-10-13 21:46:29 UTC (rev 92177)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_If.py  
2008-10-13 21:50:06 UTC (rev 92178)
@@ -78,7 +78,7 @@
 __rcs_id__='$Id$'
 __version__='$Revision: 1.19 $'[11:-2]
 
-from DT_Util import ParseError, parse_params, name_param, str
+from DocumentTemplate.DT_Util import ParseError, parse_params, name_param, str
 
 class If:
 blockContinuations='else','elif'

Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_In.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_In.py  
2008-10-13 21:46:29 UTC (rev 92177)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_In.py  
2008-10-13 21:50:06 UTC (rev 92178)
@@ -333,14 +333,18 @@
 __version__='$Revision: 1.62 $'[11:-2]
 
 import sys
-from DT_Util import ParseError, parse_params, name_param, str, join_unicode
-from DT_Util import render_blocks, InstanceDict, ValidationError, Eval
-from DT_Util import simple_name, add_with_prefix
 import re
-from DT_InSV import sequence_variables, opt
-TupleType=type(())
-StringTypes = (type(''), type(u''))
 
+from DocumentTemplate.DT_Util import ParseError, parse_params, name_param
+from DocumentTemplate.DT_Util import str, join_unicode
+from DocumentTemplate.DT_Util import render_blocks, InstanceDict
+from DocumentTemplate.DT_Util import ValidationError, Eval
+from DocumentTemplate.DT_Util import simple_name, add_with_prefix
+from DocumentTemplate.DT_InSV import sequence_variables, opt
+
+TupleType = tuple
+StringTypes = (str, unicode)
+
 class InFactory:
 blockContinuations=('else',)
 name='in'

Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_InSV.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_InSV.py
2008-10-13 21:46:29 UTC (rev 92177)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_InSV.py
2008-10-13 21:50:06 UTC (rev 92178)
@@ -18,12 +18,13 @@
 
 from math import sqrt
 import re
-TupleType=type(())
+
 try:
 import Missing
 mv=Missing.Value
 except: 

[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/zope/app/ - Update to newer zope.app.security

2008-10-13 Thread Sidnei da Silva
Log message for revision 92183:
   - Update to newer zope.app.security

Changed:
  _U  Zope/branches/gsoc-python-2.5/lib/python/zope/app/

-=-

Property changes on: Zope/branches/gsoc-python-2.5/lib/python/zope/app
___
Name: svn:externals
   - annotation   
svn://svn.zope.org/repos/main/zope.app.annotation/tags/3.4.0/src/zope/app/annotation
apidoc   
svn://svn.zope.org/repos/main/zope.app.apidoc/tags/3.4.3/src/zope/app/apidoc
applicationcontrol   
svn://svn.zope.org/repos/main/zope.app.applicationcontrol/tags/3.4.1/src/zope/app/applicationcontrol
appsetup 
svn://svn.zope.org/repos/main/zope.app.appsetup/tags/3.4.1/src/zope/app/appsetup
authentication   
svn://svn.zope.org/repos/main/zope.app.authentication/tags/3.4.1/src/zope/app/authentication
basicskin
svn://svn.zope.org/repos/main/zope.app.basicskin/tags/3.4.0/src/zope/app/basicskin
broken   
svn://svn.zope.org/repos/main/zope.app.broken/tags/3.4.0/src/zope/app/broken
cache
svn://svn.zope.org/repos/main/zope.app.cache/tags/3.4.0/src/zope/app/cache
component
svn://svn.zope.org/repos/main/zope.app.component/trunk/src/zope/app/component
container
svn://svn.zope.org/repos/main/zope.app.container/trunk/src/zope/app/container
content  
svn://svn.zope.org/repos/main/zope.app.content/tags/3.4.0/src/zope/app/content
debug
svn://svn.zope.org/repos/main/zope.app.debug/tags/3.4.0/src/zope/app/debug
dependable   
svn://svn.zope.org/repos/main/zope.app.dependable/tags/3.4.0/src/zope/app/dependable
error
svn://svn.zope.org/repos/main/zope.app.error/tags/3.5.1/src/zope/app/error
exception
svn://svn.zope.org/repos/main/zope.app.exception/tags/3.4.1/src/zope/app/exception
file 
svn://svn.zope.org/repos/main/zope.app.file/tags/3.4.2/src/zope/app/file
folder   
svn://svn.zope.org/repos/main/zope.app.folder/tags/3.4.0/src/zope/app/folder
form 
svn://svn.zope.org/repos/main/zope.app.form/trunk/src/zope/app/form
generations  
svn://svn.zope.org/repos/main/zope.app.generations/tags/3.4.1/src/zope/app/generations
http 
svn://svn.zope.org/repos/main/zope.app.http/tags/3.4.1/src/zope/app/http
i18n 
svn://svn.zope.org/repos/main/zope.app.i18n/tags/3.4.4/src/zope/app/i18n
interface
svn://svn.zope.org/repos/main/zope.app.interface/tags/3.4.0/src/zope/app/interface
intid
svn://svn.zope.org/repos/main/zope.app.intid/tags/3.4.1/src/zope/app/intid
keyreference 
svn://svn.zope.org/repos/main/zope.app.keyreference/tags/3.4.1/src/zope/app/keyreference
layers   
svn://svn.zope.org/repos/main/zope.app.layers/tags/3.4.0/src/zope/app/layers
locales  
svn://svn.zope.org/repos/main/zope.app.locales/tags/3.4.1/src/zope/app/locales
onlinehelp   
svn://svn.zope.org/repos/main/zope.app.onlinehelp/tags/3.4.1/src/zope/app/onlinehelp
pagetemplate 
svn://svn.zope.org/repos/main/zope.app.pagetemplate/tags/3.4.0/src/zope/app/pagetemplate
pluggableauth
svn://svn.zope.org/repos/main/zope.app.pluggableauth/tags/3.4.0/src/zope/app/pluggableauth
preference   
svn://svn.zope.org/repos/main/zope.app.preference/tags/3.4.1/src/zope/app/preference
preview  
svn://svn.zope.org/repos/main/zope.app.preview/tags/3.4.0/src/zope/app/preview
principalannotation  
svn://svn.zope.org/repos/main/zope.app.principalannotation/tags/3.4.0/src/zope/app/principalannotation
publication  
svn://svn.zope.org/repos/main/zope.app.publication/tags/3.4.3/src/zope/app/publication
publisher
svn://svn.zope.org/repos/main/zope.app.publisher/trunk/src/zope/app/publisher
renderer 
svn://svn.zope.org/repos/main/zope.app.renderer/tags/3.4.0/src/zope/app/renderer
rotterdam
svn://svn.zope.org/repos/main/zope.app.rotterdam/tags/3.4.1/src/zope/app/rotterdam
schema   
svn://svn.zope.org/repos/main/zope.app.schema/tags/3.4.0/src/zope/app/schema
security 
svn://svn.zope.org/repos/main/zope.app.security/tags/3.4.0/src/zope/app/security
securitypolicy   
svn://svn.zope.org/repos/main/zope.app.securitypolicy/tags/3.4.6/src/zope/app/securitypolicy
session  
svn://svn.zope.org/repos/main/zope.app.session/tags/3.5.1/src/zope/app/session
skins
svn://svn.zope.org/repos/main/zope.app.skins/tags/3.4.0/src/zope/app/skins
sqlscript
svn://svn.zope.org/repos/main/zope.app.sqlscript/tags/3.4.1/src/zope/app/sqlscript
testing  
svn://svn.zope.org/repos/main/zope.app.testing/tags/3.4.1/src/zope/app/testing
traversing   
svn://svn.zope.org/repos/main/zope.app.traversing/tags/3.4.0/src/zope/app/traversing
tree 
svn://svn.zope.org/repos/main/zope.app.tree/tags/3.4.0/src/zope/app/tree
undo 

[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/OFS/ - Avoid raising string exceptions. If one is found, upgrade it to InternalError and keep the original exception name as part of exc_v

2008-10-10 Thread Sidnei da Silva
Log message for revision 91977:
   - Avoid raising string exceptions. If one is found, upgrade it to 
InternalError and keep the original exception name as part of exc_value

Changed:
  U   Zope/branches/gsoc-python-2.5/lib/python/OFS/CopySupport.py
  U   Zope/branches/gsoc-python-2.5/lib/python/OFS/SimpleItem.py
  U   Zope/branches/gsoc-python-2.5/lib/python/OFS/tests/testCopySupport.py

-=-
Modified: Zope/branches/gsoc-python-2.5/lib/python/OFS/CopySupport.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/OFS/CopySupport.py 2008-10-10 
10:24:04 UTC (rev 91976)
+++ Zope/branches/gsoc-python-2.5/lib/python/OFS/CopySupport.py 2008-10-10 
14:36:38 UTC (rev 91977)
@@ -48,7 +48,7 @@
 from OFS.interfaces import ICopySource
 
 
-CopyError='Copy Error'
+class CopyError(Exception): pass
 
 copy_re = re.compile('^copy([0-9]*)_of_(.*)')
 

Modified: Zope/branches/gsoc-python-2.5/lib/python/OFS/SimpleItem.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/OFS/SimpleItem.py  2008-10-10 
10:24:04 UTC (rev 91976)
+++ Zope/branches/gsoc-python-2.5/lib/python/OFS/SimpleItem.py  2008-10-10 
14:36:38 UTC (rev 91977)
@@ -36,7 +36,7 @@
 from DocumentTemplate.ustr import ustr
 from ExtensionClass import Base
 from webdav.Resource import Resource
-from zExceptions import Redirect
+from zExceptions import Redirect, InternalError
 from zExceptions.ExceptionFormatter import format_exception
 from zope.interface import implements
 
@@ -181,16 +181,29 @@
 elif type(tb) is type('') and not error_tb:
 error_tb = tb
 
-# turn error_type into a string
-if hasattr(error_type, '__name__'):
-error_type=error_type.__name__
+# warn if error_type is a string
+error_name = 'Unknown'
+if isinstance(error_type, basestring):
+# String Exceptions are deprecated on Python 2.5 and
+# plain won't work at all on Python 2.6. So upgrade it
+# to an InternalError exception but keep the original
+# exception in the value.
+error_name = error_type
+error_type = InternalError
+error_value = (error_name, error_value)
+warnings.warn('String exceptions are deprecated starting '
+  'with Python 2.5 and will be removed in a '
+  'future release', DeprecationWarning)
+else:
+if hasattr(error_type, '__name__'):
+error_name = error_type.__name__
 
 if hasattr(self, '_v_eek'):
 # Stop if there is recursion.
 raise error_type, error_value, tb
 self._v_eek=1
 
-if str(error_type).lower() in ('redirect',):
+if error_name.lower() in ('redirect',):
 raise error_type, error_value, tb
 
 if not error_message:
@@ -216,7 +229,10 @@
 else:
 client = aq_parent(client)
 s=getattr(client, 'standard_error_message')
-kwargs = {'error_type': error_type,
+# For backward compatibility, we pass 'error_name' as
+# 'error_type' here as historically this has always
+# been a string.
+kwargs = {'error_type': error_name,
   'error_value': error_value,
   'error_tb': error_tb,
   'error_traceback': error_tb,

Modified: Zope/branches/gsoc-python-2.5/lib/python/OFS/tests/testCopySupport.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/OFS/tests/testCopySupport.py   
2008-10-10 10:24:04 UTC (rev 91976)
+++ Zope/branches/gsoc-python-2.5/lib/python/OFS/tests/testCopySupport.py   
2008-10-10 14:36:38 UTC (rev 91977)
@@ -347,7 +347,7 @@
 if ce_regex is not None:
 
 pattern = re.compile( ce_regex, re.DOTALL )
-if pattern.search( e ) is None:
+if pattern.search( e.args[0] ) is None:
 self.fail( Paste failed; didn't match pattern:\n%s % e )
 
 else:

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/ZServer/ - Temporary workaround for new asyncore in Python 2.6. Need to clean this up

2008-10-10 Thread Sidnei da Silva
Log message for revision 91981:
   - Temporary workaround for new asyncore in Python 2.6. Need to clean this up

Changed:
  U   Zope/branches/gsoc-python-2.5/lib/python/ZServer/HTTPServer.py
  U   Zope/branches/gsoc-python-2.5/lib/python/ZServer/medusa/http_server.py

-=-
Modified: Zope/branches/gsoc-python-2.5/lib/python/ZServer/HTTPServer.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/ZServer/HTTPServer.py  
2008-10-10 15:05:39 UTC (rev 91980)
+++ Zope/branches/gsoc-python-2.5/lib/python/ZServer/HTTPServer.py  
2008-10-10 15:05:44 UTC (rev 91981)
@@ -45,7 +45,8 @@
 from ZPublisher.HTTPRequest import HTTPRequest
 from App.config import getConfiguration
 
-from medusa.http_server import http_server,get_header, http_channel, 
VERSION_STRING
+from medusa.http_server import http_server, get_header
+from medusa.http_server import fifo, http_channel, VERSION_STRING
 import asyncore
 from medusa import counter, producers
 from medusa.test import  max_sockets
@@ -334,6 +335,10 @@
 
 def __init__(self, server, conn, addr):
 http_channel.__init__(self, server, conn, addr)
+if isinstance(self.producer_fifo, fifo):
+self.producer_fifo_push = self.producer_fifo.push
+else:
+self.producer_fifo_push = self.producer_fifo.append
 requestCloseOnExec(conn)
 self.queue=[]
 self.working=0
@@ -345,7 +350,7 @@
 # producers by default
 if self.closed:
 return
-self.producer_fifo.push(producer)
+self.producer_fifo_push(producer)
 if send: self.initiate_send()
 
 push_with_producer=push

Modified: Zope/branches/gsoc-python-2.5/lib/python/ZServer/medusa/http_server.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/ZServer/medusa/http_server.py  
2008-10-10 15:05:39 UTC (rev 91980)
+++ Zope/branches/gsoc-python-2.5/lib/python/ZServer/medusa/http_server.py  
2008-10-10 15:05:44 UTC (rev 91981)
@@ -528,25 +528,25 @@
 # no handlers, so complain
 r.error (404)
 
-def writable (self):
-# this is just the normal async_chat 'writable', here for 
comparison
-return self.ac_out_buffer or len(self.producer_fifo)
+#def writable (self):
+## this is just the normal async_chat 'writable', here for 
comparison
+#return self.ac_out_buffer or len(self.producer_fifo)
 
-def writable_for_proxy (self):
-# this version of writable supports the idea of a 'stalled' 
producer
-# [i.e., it's not ready to produce any output yet] This is needed 
by
-# the proxy, which will be waiting for the magic combination of
-# 1) hostname resolved
-# 2) connection made
-# 3) data available.
-if self.ac_out_buffer:
-return 1
-elif len(self.producer_fifo):
-p = self.producer_fifo.first()
-if hasattr (p, 'stalled'):
-return not p.stalled()
-else:
-return 1
+#def writable_for_proxy (self):
+## this version of writable supports the idea of a 'stalled' 
producer
+## [i.e., it's not ready to produce any output yet] This is needed 
by
+## the proxy, which will be waiting for the magic combination of
+## 1) hostname resolved
+## 2) connection made
+## 3) data available.
+#if self.ac_out_buffer:
+#return 1
+#elif len(self.producer_fifo):
+#p = self.producer_fifo.first()
+#if hasattr (p, 'stalled'):
+#return not p.stalled()
+#else:
+#return 1
 
 # 
===
 #   HTTP Server 
Object

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/ - Provide a helper function to upgrade a string exception to a real exception.

2008-10-10 Thread Sidnei da Silva
Log message for revision 91983:
   - Provide a helper function to upgrade a string exception to a real 
exception.

Changed:
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Raise.py
  U   Zope/branches/gsoc-python-2.5/lib/python/OFS/SimpleItem.py
  U   Zope/branches/gsoc-python-2.5/lib/python/zExceptions/__init__.py

-=-
Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Raise.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Raise.py   
2008-10-10 15:06:14 UTC (rev 91982)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Raise.py   
2008-10-10 15:06:23 UTC (rev 91983)
@@ -26,8 +26,12 @@
 __rcs_id__='$Id$'
 __version__='$Revision: 1.13 $'[11:-2]
 
+from zExceptions import upgradeException
 from DT_Util import parse_params, name_param, render_blocks, str
 
+class InvalidErrorTypeExpression(Exception):
+pass
+
 class Raise:
 blockContinuations=()
 name='raise'
@@ -44,15 +48,17 @@
 expr=self.expr
 if expr is None:
 t=self.__name__
-if t[-5:]=='Error' and __builtins__.has_key(t):
-t=__builtins__[t]
 else:
 try: t=expr.eval(md)
-except: t='Invalid Error Type Expression'
+except: t=InvalidErrorTypeExpression
 
 try: v=render_blocks(self.section,md)
 except: v='Invalid Error Value'
-
+
+# String Exceptions are deprecated on Python 2.5 and
+# plain won't work at all on Python 2.6. So try to upgrade it
+# to a real exception.
+t, v = upgradeException(t, v)
 raise t, v
 
 __call__=render

Modified: Zope/branches/gsoc-python-2.5/lib/python/OFS/SimpleItem.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/OFS/SimpleItem.py  2008-10-10 
15:06:14 UTC (rev 91982)
+++ Zope/branches/gsoc-python-2.5/lib/python/OFS/SimpleItem.py  2008-10-10 
15:06:23 UTC (rev 91983)
@@ -36,7 +36,7 @@
 from DocumentTemplate.ustr import ustr
 from ExtensionClass import Base
 from webdav.Resource import Resource
-from zExceptions import Redirect, InternalError
+from zExceptions import Redirect, upgradeException
 from zExceptions.ExceptionFormatter import format_exception
 from zope.interface import implements
 
@@ -185,15 +185,10 @@
 error_name = 'Unknown'
 if isinstance(error_type, basestring):
 # String Exceptions are deprecated on Python 2.5 and
-# plain won't work at all on Python 2.6. So upgrade it
-# to an InternalError exception but keep the original
-# exception in the value.
+# plain won't work at all on Python 2.6. So try to upgrade it
+# to a real exception.
 error_name = error_type
-error_type = InternalError
-error_value = (error_name, error_value)
-warnings.warn('String exceptions are deprecated starting '
-  'with Python 2.5 and will be removed in a '
-  'future release', DeprecationWarning)
+error_type, error_value = upgradeException(error_type, 
error_value)
 else:
 if hasattr(error_type, '__name__'):
 error_name = error_type.__name__

Modified: Zope/branches/gsoc-python-2.5/lib/python/zExceptions/__init__.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/zExceptions/__init__.py
2008-10-10 15:06:14 UTC (rev 91982)
+++ Zope/branches/gsoc-python-2.5/lib/python/zExceptions/__init__.py
2008-10-10 15:06:23 UTC (rev 91983)
@@ -18,12 +18,13 @@
 $Id$
 
 
-from unauthorized import Unauthorized
+import warnings
 
 from zope.interface import implements
 from zope.interface.common.interfaces import IException
 from zope.publisher.interfaces import INotFound
 from zope.security.interfaces import IForbidden
+from zExceptions.unauthorized import Unauthorized
 
 class BadRequest(Exception):
 implements(IException)
@@ -42,3 +43,29 @@
 
 class Redirect(Exception):
 pass
+
+def upgradeException(t, v):
+# If a string exception is found, convert it to an equivalent
+# exception defined either in builtins or zExceptions. If none of
+# that works, tehn convert it to an InternalError and keep the
+# original exception name as part of the exception value.
+import zExceptions
+
+if not isinstance(t, basestring):
+return t, v
+
+warnings.warn('String exceptions are deprecated starting '
+  'with Python 2.5 and will be removed in a '
+  'future release', DeprecationWarning)
+
+n = None
+if __builtins__.has_key(t):
+n = __builtins__[t]
+elif hasattr(zExceptions, t):
+n = getattr(zExceptions, t)
+  

[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/zExceptions/__init__.py - Use stacklevel=2 to show calling site

2008-10-10 Thread Sidnei da Silva
Log message for revision 91986:
   - Use stacklevel=2 to show calling site

Changed:
  U   Zope/branches/gsoc-python-2.5/lib/python/zExceptions/__init__.py

-=-
Modified: Zope/branches/gsoc-python-2.5/lib/python/zExceptions/__init__.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/zExceptions/__init__.py
2008-10-10 15:07:37 UTC (rev 91985)
+++ Zope/branches/gsoc-python-2.5/lib/python/zExceptions/__init__.py
2008-10-10 15:08:47 UTC (rev 91986)
@@ -56,7 +56,7 @@
 
 warnings.warn('String exceptions are deprecated starting '
   'with Python 2.5 and will be removed in a '
-  'future release', DeprecationWarning)
+  'future release', DeprecationWarning, stacklevel=2)
 
 n = None
 if __builtins__.has_key(t):

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/ - Some PEP-328 related changes. Need to make imports conditionally

2008-10-08 Thread Sidnei da Silva
Log message for revision 91894:
  - Some PEP-328 related changes. Need to make imports conditionally
relative using new syntax so that they work on Python 2.6.
  
  

Changed:
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Return.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_String.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Util.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Var.py
  U   
Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DocumentTemplate.py
  U   
Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/cDocumentTemplate.c

-=-
Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Return.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Return.py  
2008-10-08 05:02:37 UTC (rev 91893)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Return.py  
2008-10-08 06:43:00 UTC (rev 91894)
@@ -12,7 +12,11 @@
 ##
 __version__='$Revision: 1.9 $'[11:-2]
 
-from DT_Util import parse_params, name_param
+try:
+from DT_Util import parse_params, name_param
+except ImportError:
+# See PEP-328
+from .DT_Util import parse_params, name_param
 
 class ReturnTag:
 name='return'

Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_String.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_String.py  
2008-10-08 05:02:37 UTC (rev 91893)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_String.py  
2008-10-08 06:43:00 UTC (rev 91894)
@@ -16,9 +16,17 @@
 import thread
 import re
 
-from DT_Util import ParseError, InstanceDict, TemplateDict, render_blocks, str
-from DT_Var import Var, Call, Comment
-from DT_Return import ReturnTag, DTReturn
+try:
+from DT_Util import ParseError, InstanceDict
+from DT_Util import TemplateDict, render_blocks, str
+from DT_Var import Var, Call, Comment
+from DT_Return import ReturnTag, DTReturn
+except ImportError:
+# See PEP-328
+from .DT_Util import ParseError, InstanceDict
+from .DT_Util import TemplateDict, render_blocks, str
+from .DT_Var import Var, Call, Comment
+from .DT_Return import ReturnTag, DTReturn
 
 _marker = []  # Create a new marker object.
 

Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Util.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Util.py
2008-10-08 05:02:37 UTC (rev 91893)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Util.py
2008-10-08 06:43:00 UTC (rev 91894)
@@ -16,12 +16,25 @@
 
 import re
 
-from html_quote import html_quote, ustr # for import by other modules, dont 
remove!
+try:
+# for import by other modules, dont remove!
+from html_quote import html_quote, ustr
+
+from cDocumentTemplate import InstanceDict, TemplateDict
+from cDocumentTemplate import render_blocks, safe_callable
+from cDocumentTemplate import join_unicode
+except ImportError:
+# See PEP-328: 
+# for import by other modules, dont remove!
+from .html_quote import html_quote, ustr
+
+from .cDocumentTemplate import InstanceDict, TemplateDict
+from .cDocumentTemplate import render_blocks, safe_callable
+from .cDocumentTemplate import join_unicode
+
 from RestrictedPython.Guards import safe_builtins
 from RestrictedPython.Utilities import utility_builtins
 from RestrictedPython.Eval import RestrictionCapableEval
-from cDocumentTemplate import InstanceDict, TemplateDict, \
- render_blocks, safe_callable, join_unicode
 
 test = utility_builtins['test'] # for backwards compatibility, dont remove!
 

Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Var.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Var.py 
2008-10-08 05:02:37 UTC (rev 91893)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Var.py 
2008-10-08 06:43:00 UTC (rev 91894)
@@ -151,14 +151,22 @@
 
 
 ''' # '
+
 __rcs_id__='$Id$'
 __version__='$Revision: 1.60 $'[11:-2]
 
+import string, re, sys
 from cgi import escape
-import string, re,  sys
 from urllib import quote, quote_plus, unquote, unquote_plus
-from DT_Util import parse_params, name_param, str, ustr
-from html_quote import html_quote # for import by other modules, dont remove!
+
+try:
+# for import by other modules, dont remove!
+from html_quote import html_quote
+from DT_Util import parse_params, name_param, str, ustr
+except ImportError:
+from .html_quote import html_quote
+from .DT_Util import parse_params, name_param, str, ustr
+
 from Acquisition import 

[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/Zope2/App/ - Raising a string exception generates a TypeError on Python

2008-10-08 Thread Sidnei da Silva
Log message for revision 91896:
  - Raising a string exception generates a TypeError on Python
2.6. Adjust tests accordingly.
  
  

Changed:
  U   Zope/branches/gsoc-python-2.5/lib/python/Zope2/App/startup.py
  U   
Zope/branches/gsoc-python-2.5/lib/python/Zope2/App/tests/testExceptionHook.py

-=-
Modified: Zope/branches/gsoc-python-2.5/lib/python/Zope2/App/startup.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/Zope2/App/startup.py   
2008-10-08 06:50:37 UTC (rev 91895)
+++ Zope/branches/gsoc-python-2.5/lib/python/Zope2/App/startup.py   
2008-10-08 06:58:04 UTC (rev 91896)
@@ -207,8 +207,9 @@
 else:
 error_log_url = log.raising((t, v, traceback))
 
-if (getattr(REQUEST.get('RESPONSE', None), '_error_format', '')
-!='text/html'):
+if (REQUEST is None or 
+(getattr(REQUEST.get('RESPONSE', None), '_error_format', '')
+ != 'text/html')):
 raise t, v, traceback
 
 # Lookup a view for the exception and render it, then

Modified: 
Zope/branches/gsoc-python-2.5/lib/python/Zope2/App/tests/testExceptionHook.py
===
--- 
Zope/branches/gsoc-python-2.5/lib/python/Zope2/App/tests/testExceptionHook.py   
2008-10-08 06:50:37 UTC (rev 91895)
+++ 
Zope/branches/gsoc-python-2.5/lib/python/Zope2/App/tests/testExceptionHook.py   
2008-10-08 06:58:04 UTC (rev 91896)
@@ -118,12 +118,20 @@
 def testStringException1(self):
 def f():
 raise 'unauthorized', 'x'
-self.assertRaises('unauthorized', self.call, None, None, f)
+if sys.version_info  (2, 6):
+self.assertRaises('unauthorized', self.call, None, None, f)
+else:
+# Raising a string exception causes a TypeError on Python 2.6
+self.assertRaises(TypeError, self.call, None, None, f)
 
 def testStringException2(self):
 def f():
 raise 'redirect', 'x'
-self.assertRaises('redirect', self.call, None, None, f)
+if sys.version_info  (2, 6):
+self.assertRaises('redirect', self.call, None, None, f)
+else:
+# Raising a string exception causes a TypeError on Python 2.6
+self.assertRaises(TypeError, self.call, None, None, f)
 
 def testSystemExit(self):
 def f():

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


Re: [Zope-dev] [Fwd: [Bug 279981] Re: zope.app.testing use of 'with' keyword breaks with Python 2.6]

2008-10-08 Thread Sidnei da Silva
I'm sorry Andreas but where did you find mention of code incompatible
with Python 2.4?

On Wed, Oct 8, 2008 at 3:15 AM, Andreas Jung [EMAIL PROTECTED] wrote:

 Who is committing code that is incompatible with Python 2.4?
 I think it is not acceptable - even for code on the trunk of a package.

 Andreas
  Original-Nachricht 
 Betreff: [Bug 279981] Re: zope.app.testing use of 'with' keyword breaks with
 Python 2.6
 Datum: Wed, 08 Oct 2008 04:13:52 -
 Von: Sidnei da Silva [EMAIL PROTECTED]
 Antwort an: Bug 279981 [EMAIL PROTECTED]
 An: [EMAIL PROTECTED]
 Referenzen: [EMAIL PROTECTED]

 ** Also affects: zope.app.testing
   Importance: Undecided
   Status: New

 ** Also affects: zope2
   Importance: Undecided
   Status: New

 --
 zope.app.testing use of 'with' keyword breaks with Python 2.6
 https://bugs.launchpad.net/bugs/279981
 You received this bug notification because you are a member of Zope 3
 Developers, which is subscribed to Zope 3.

 --
 ZOPYX Ltd.  Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany
 Web: www.zopyx.com - Email: [EMAIL PROTECTED] - Phone +49 - 7071 - 793376
 Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535
 Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK
 
 E-Publishing, Python, Zope  Plone development, Consulting


 ___
 Zope-Dev maillist  -  Zope-Dev@zope.org
 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 )





-- 
Sidnei da Silva
Enfold Systemshttp://enfoldsystems.com
Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Relative Imports: PEP-328

2008-10-08 Thread Sidnei da Silva
On Wed, Oct 8, 2008 at 8:53 AM, Philipp von Weitershausen
[EMAIL PROTECTED] wrote:
 Sidnei da Silva wrote:

 I'm trying to fix some import errors, which seem to be related to PEP-328.

 I'm fixing those errors this way, though I don't know if that's the
 recommended way of fixing it. Thoughts?

 
 try:
from DT_Util import parse_params, name_param
 except ImportError:
# See PEP-328
from .DT_Util import parse_params, name_param
 

 This will generate a SyntaxError in Python 2.4. So unless we *require*
 Python = 2.5, this won't work.

Yuck. I hadn't thought of that. Any other suggestions? Like, using
zope.documenttemplate? :)

-- 
Sidnei da Silva
Enfold Systemshttp://enfoldsystems.com
Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] ZServer/medusa doesn't work with Python 2.6

2008-10-08 Thread Sidnei da Silva
This one is for someone that has some asyncore knowledge: Python 2.6
has cleaned up and integrated many patches to asyncore, some of which
seem to have broken the medusa version shipped with Zope.

https://bugs.edge.launchpad.net/zope2/+bug/280020

My question is, is this something we should fix in Zope or is it a bug
in Python 2.6 that asyncore is not backwards compatible?

-- 
Sidnei da Silva
Enfold Systemshttp://enfoldsystems.com
Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/zope/app/ - Fix broken externals

2008-10-07 Thread Sidnei da Silva
Log message for revision 91872:
   - Fix broken externals

Changed:
  _U  Zope/branches/gsoc-python-2.5/lib/python/zope/app/

-=-

Property changes on: Zope/branches/gsoc-python-2.5/lib/python/zope/app
___
Name: svn:externals
   - annotation   
svn://svn.zope.org/repos/main/zope.app.annotation/tags/3.4.0/src/zope/app/annotation
apidoc   
svn://svn.zope.org/repos/main/zope.app.apidoc/tags/3.4.3/src/zope/app/apidoc
applicationcontrol   
svn://svn.zope.org/repos/main/zope.app.applicationcontrol/tags/3.4.1/src/zope/app/applicationcontrol
appsetup 
svn://svn.zope.org/repos/main/zope.app.appsetup/tags/3.4.1/src/zope/app/appsetup
authentication   
svn://svn.zope.org/repos/main/zope.app.authentication/tags/3.4.1/src/zope/app/authentication
basicskin
svn://svn.zope.org/repos/main/zope.app.basicskin/tags/3.4.0/src/zope/app/basicskin
broken   
svn://svn.zope.org/repos/main/zope.app.broken/tags/3.4.0/src/zope/app/broken
cache
svn://svn.zope.org/repos/main/zope.app.cache/tags/3.4.0/src/zope/app/cache
component
svn://svn.zope.org/repos/main/zope.app.component/tags/3.4.1/src/zope/app/component
container
svn://svn.zope.org/repos/main/zope.app.container/tags/3.5.3/src/zope/app/container
content  
svn://svn.zope.org/repos/main/zope.app.content/tags/3.4.0/src/zope/app/content
debug
svn://svn.zope.org/repos/main/zope.app.debug/tags/3.4.0/src/zope/app/debug
dependable   
svn://svn.zope.org/repos/main/zope.app.dependable/tags/3.4.0/src/zope/app/dependable
error
svn://svn.zope.org/repos/main/zope.app.error/tags/3.5.1/src/zope/app/error
exception
svn://svn.zope.org/repos/main/zope.app.exception/tags/3.4.1/src/zope/app/exception
file 
svn://svn.zope.org/repos/main/zope.app.file/tags/3.4.2/src/zope/app/file
folder   
svn://svn.zope.org/repos/main/zope.app.folder/tags/3.4.0/src/zope/app/folder
folder   
svn://svn.zope.org/repos/main/zope.app.folder/tags/3.4.0/src/zope/app/folder
form 
svn://svn.zope.org/repos/main/zope.app.form/tags/3.4.1/src/zope/app/form
generations  
svn://svn.zope.org/repos/main/zope.app.generations/tags/3.4.1/src/zope/app/generations
http 
svn://svn.zope.org/repos/main/zope.app.http/tags/3.4.1/src/zope/app/http
i18n 
svn://svn.zope.org/repos/main/zope.app.i18n/tags/3.4.4/src/zope/app/i18n
interface
svn://svn.zope.org/repos/main/zope.app.interface/tags/3.4.0/src/zope/app/interface
intid
svn://svn.zope.org/repos/main/zope.app.intid/tags/3.4.1/src/zope/app/intid
keyreference 
svn://svn.zope.org/repos/main/zope.app.keyreference/tags/3.4.1/src/zope/app/keyreference
layers   
svn://svn.zope.org/repos/main/zope.app.layers/tags/3.4.0/src/zope/app/layers
locales  
svn://svn.zope.org/repos/main/zope.app.locales/tags/3.4.1/src/zope/app/locales
onlinehelp   
svn://svn.zope.org/repos/main/zope.app.onlinehelp/tags/3.4.1/src/zope/app/onlinehelp
pagetemplate 
svn://svn.zope.org/repos/main/zope.app.pagetemplate/tags/3.4.0/src/zope/app/pagetemplate
pluggableauth
svn://svn.zope.org/repos/main/zope.app.pluggableauth/tags/3.4.0/src/zope/app/pluggableauth
preference   
svn://svn.zope.org/repos/main/zope.app.preference/tags/3.4.1/src/zope/app/preference
preview  
svn://svn.zope.org/repos/main/zope.app.preview/tags/3.4.0/src/zope/app/preview
principalannotation  
svn://svn.zope.org/repos/main/zope.app.principalannotation/tags/3.4.0/src/zope/app/principalannotation
publication  
svn://svn.zope.org/repos/main/zope.app.publication/tags/3.4.3/src/zope/app/publication
publisher
svn://svn.zope.org/repos/main/zope.app.publisher/tags/3.4.1/src/zope/app/publisher
renderer 
svn://svn.zope.org/repos/main/zope.app.renderer/tags/3.4.0/src/zope/app/renderer
rotterdam
svn://svn.zope.org/repos/main/zope.app.rotterdam/tags/3.4.1/src/zope/app/rotterdam
schema   
svn://svn.zope.org/repos/main/zope.app.schema/tags/3.4.0/src/zope/app/schema
security 
svn://svn.zope.org/repos/main/zope.app.security/tags/3.4.0/src/zope/app/security
securitypolicy   
svn://svn.zope.org/repos/main/zope.app.securitypolicy/tags/3.4.6/src/zope/app/securitypolicy
session  
svn://svn.zope.org/repos/main/zope.app.session/tags/3.5.1/src/zope/app/session
skins
svn://svn.zope.org/repos/main/zope.app.skins/tags/3.4.0/src/zope/app/skins
sqlscript
svn://svn.zope.org/repos/main/zope.app.sqlscript/tags/3.4.1/src/zope/app/sqlscript
testing  
svn://svn.zope.org/repos/main/zope.app.testing/tags/3.4.1/src/zope/app/testing
traversing   
svn://svn.zope.org/repos/main/zope.app.traversing/tags/3.4.0/src/zope/app/traversing
tree 

[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/Zope2/Startup/warnfilter.py - Accept new-style classes as valid warning categories. Patch by

2008-10-07 Thread Sidnei da Silva
Log message for revision 91879:
  - Accept new-style classes as valid warning categories. Patch by
Ranjith Kannikara, GSoC student.
  
  

Changed:
  U   Zope/branches/gsoc-python-2.5/lib/python/Zope2/Startup/warnfilter.py

-=-
Modified: Zope/branches/gsoc-python-2.5/lib/python/Zope2/Startup/warnfilter.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/Zope2/Startup/warnfilter.py
2008-10-07 18:32:12 UTC (rev 91878)
+++ Zope/branches/gsoc-python-2.5/lib/python/Zope2/Startup/warnfilter.py
2008-10-07 19:25:16 UTC (rev 91879)
@@ -35,7 +35,7 @@
 cat = getattr(m, klass)
 except AttributeError:
 raise ValueError(unknown warning category: %s % `category`)
-if (not isinstance(cat, types.ClassType) or
+if (not isinstance(cat, (type, types.ClassType)) or
 not issubclass(cat, Warning)):
 raise ValueError(invalid warning category: %s % `category`)
 return cat

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/AccessControl/ImplC.py - Get rid of a relative import. Python 2.6 compatibility patch, by

2008-10-07 Thread Sidnei da Silva
Log message for revision 91890:
  - Get rid of a relative import. Python 2.6 compatibility patch, by
Ranjith Kannikara, GSoC student.
  
  

Changed:
  U   Zope/branches/gsoc-python-2.5/lib/python/AccessControl/ImplC.py

-=-
Modified: Zope/branches/gsoc-python-2.5/lib/python/AccessControl/ImplC.py
===
--- Zope/branches/gsoc-python-2.5/lib/python/AccessControl/ImplC.py 
2008-10-08 00:58:49 UTC (rev 91889)
+++ Zope/branches/gsoc-python-2.5/lib/python/AccessControl/ImplC.py 
2008-10-08 01:14:02 UTC (rev 91890)
@@ -27,7 +27,8 @@
 del sys.modules[__name__]
 
 
-from ImplPython import RestrictedDTML, SecurityManager, ZopeSecurityPolicy
+from AccessControl.ImplPython import RestrictedDTML
+from AccessControl.ImplPython import SecurityManager, ZopeSecurityPolicy
 
 
 class RestrictedDTML(RestrictedDTMLMixin, RestrictedDTML):

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-Checkins] SVN: Zope/branches/gsoc-python-2.5/lib/python/Products/PythonScripts/tests/testPythonScript.py - This test fails with a TypeError on Python 2.6, so adjust accordingly.

2008-10-07 Thread Sidnei da Silva
Log message for revision 91891:
  - This test fails with a TypeError on Python 2.6, so adjust accordingly.
  
  

Changed:
  U   
Zope/branches/gsoc-python-2.5/lib/python/Products/PythonScripts/tests/testPythonScript.py

-=-
Modified: 
Zope/branches/gsoc-python-2.5/lib/python/Products/PythonScripts/tests/testPythonScript.py
===
--- 
Zope/branches/gsoc-python-2.5/lib/python/Products/PythonScripts/tests/testPythonScript.py
   2008-10-08 01:14:02 UTC (rev 91890)
+++ 
Zope/branches/gsoc-python-2.5/lib/python/Products/PythonScripts/tests/testPythonScript.py
   2008-10-08 03:53:21 UTC (rev 91891)
@@ -10,7 +10,7 @@
 # FOR A PARTICULAR PURPOSE
 #
 ##
-import os, unittest, warnings
+import os, sys, unittest, warnings
 
 from Products.PythonScripts.PythonScript import PythonScript
 from AccessControl.SecurityManagement import newSecurityManager
@@ -288,13 +288,19 @@
 f = self._filePS('class.__name__')
 self.assertEqual(f(), ('foo', 'string'))
 
-def test_filepath(self):
-# This test is meant to raise a deprecation warning.
-# It used to fail mysteriously instead.
-self._trap_warning_output()
-f = self._filePS('filepath')
-self.assertEqual(f(), [0])
-self._free_warning_output()
+if sys.version_info  (2, 6):
+def test_filepath(self):
+# This test is meant to raise a deprecation warning.
+# It used to fail mysteriously instead.
+self._trap_warning_output()
+f = self._filePS('filepath')
+self.assertEqual(f(), [0])
+self._free_warning_output()
+else:
+def test_filepath(self):
+# On Python 2.6, this now raises a TypeError.
+f = self._filePS('filepath')
+self.assertRaises(TypeError, f)
 
 class PythonScriptInterfaceConformanceTests(unittest.TestCase):
 

___
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins


[Zope-dev] Relative Imports: PEP-328

2008-10-07 Thread Sidnei da Silva
I'm trying to fix some import errors, which seem to be related to PEP-328.

I'm fixing those errors this way, though I don't know if that's the
recommended way of fixing it. Thoughts?


try:
from DT_Util import parse_params, name_param
except ImportError:
# See PEP-328
from .DT_Util import parse_params, name_param


-- 
Sidnei da Silva
Enfold Systemshttp://enfoldsystems.com
Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Python 2.6: 'with' in Interfaces

2008-10-07 Thread Sidnei da Silva
Trying to run some tests with Python 2.6 I stumbled on a problem that
I need help with: an interface that has an attribute named 'with'.

The interface in question is defined in zope.app.component.back35:

class IAdapterRegistration(IComponentRegistration):
...
with = schema.Tuple(
title = _(With interfaces),
...

Any suggestions on how to fix this one?

-- 
Sidnei da Silva
Enfold Systemshttp://enfoldsystems.com
Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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] Relative Imports: PEP-328

2008-10-07 Thread Sidnei da Silva
On Wed, Oct 8, 2008 at 2:40 AM, Marius Gedminas [EMAIL PROTECTED] wrote:
 I'd suggest converting it to an absolute import

  from zope.documenttemplate.dt_util import parse_params, name_param

So I thought at first. Except there is a problem:

Inside 'DocumentTemplate' there's another 'DocumentTemplate' module. So doing:

 'from DocumentTemplate.DT_Util import parse_params'

... tries to import DT_Util from the relative module. Then the fix is to do:

 'from __future__ import absolute_import'

... except that doesn't work on Python 2.4.

So the try: except seems to be the only way around here, unfortunately.

 or whatever the equivalent for Zope 2 is (I'm assuming it's Zope 2,
 since DT_Util is capitalized).

Another option might be to switch this to use zope.documenttemplate. :)

-- 
Sidnei da Silva
Enfold Systemshttp://enfoldsystems.com
Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214
___
Zope-Dev maillist  -  Zope-Dev@zope.org
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 )


  1   2   3   4   5   >