Re: [Zope-dev] Location of RelStorage

2013-04-12 Thread Chris Withers

On 14/03/2013 08:01, Marius Gedminas wrote:

What's the official location of RelStorage?  I see two source trees:

   * http://zope3.pov.lt/trac/browser/relstorage/trunk
   * https://github.com/zodb/relstorage

They have the same commits (~1 year old).


..and one more just for good measure:

https://github.com/cjw296/relstorage

Would be good to have an official git repo under Shane's care.

Shane, where are you maintaining relstorage nowadays?

cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
   - http://www.simplistix.co.uk
___
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] when did transaction lose the ability to be usable as a context manager?

2013-02-06 Thread Chris Withers

On 06/02/2013 11:47, Wichert Akkerman wrote:


You can also use the transaction manager directly instead of the bound methods 
transaction lifts out of it:

import transaction
with transaction.manager:
 pass


yeah, this is what I'll do.

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] when did transaction lose the ability to be usable as a context manager?

2013-02-06 Thread Chris Withers

Hi All,

I used to do this:

>>> import transaction
>>> with transaction:
...   print 'hello'
...
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: __exit__

When did that stop working and what should I now do instead?

cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] How to signal that projects have moved to github

2013-01-11 Thread Chris Withers

On 10/01/2013 20:48, Jim Fulton wrote:

It isn't just CI:  people may have projects running from SVN checkouts,
which we break without warning (the Plone devs have been notorious for
causing such breakage for years).


I still think breakage is better.  If they're using trunk, without
pinning a revision, it must be because they want the latest code.
They won't get that from svn.  This is a case where I think it's
better to fail in an obvious way.


Yeah, +1 from me here. If people think they're using trunk, and they're 
not 'cos its moved to GitHub, that's bad.


FWIW, you may not know that GitHub really does have an svn interface to 
git repositories on GitHub. They unfortunately announced this on April 1 
one year, so I think most people (myself included, until I actually 
started using it) assume it's a joke.


So, it really is a case of CI tools changing their subversion url, and 
others doing a svn switch --relocate.


cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] [Checkins] SVN: zc.buildout/ Moved to github

2012-08-18 Thread Chris Withers
I'm not going to dignify this with a fuller response other than to say 
that Jean-Paul Smets' entire email is nothing but bullshit written to 
try and promote an inferior competing product ;-)


Chris

On 18/08/2012 13:31, Jean-Paul Smets wrote:

Hi,

I approve your position Jens.

Moving to git can make sense. Moving to github as primary platform does
not make sense.

Github is a proprietary platform. There is really no justification in
using a proprietary platform for open source projects, especially
considering that many open source alternatives exist and that nothing
prevents from using github as a mirror (for marketing purpose for example).

It is not only depressing to see open source communities not eating
their own dog food but also irresponsible.

It is irresponsible because Cloud / SaaS is far from reliable. Please
read this to get an idea.
(http://iwgcr.org/paris-university-and-telecom-paristech-publish-availability-ranking-of-world-cloud-computing/).
Service outages are not rare.

It is irresponsible because it sends a message to the market that open
source is not competitive (else open source communities would use it for
themselves). Many open source git hosting solutions do exist (incl.
gitorious, gitlab, indefero). Why not use them ?

On a more positive side, Nexedi is currently sponsoring the port of
Gitlab (http://gitlabhq.com/) open source git platform to SlapOS (
http://www.slapos.org/) open source Cloud. This means that there will in
a few days a python based, Zope based, buildout based and fully
resilient platform to host open source projects, with the ability to
manage copies of source code on servers all around the world in a true
community fashion.

And after reading today's message, I got so upset that I decided that
Nexedi will use SlapOS to offer hosting to any open source Zope
community project which believes enough in open source values to use
open source tools rather than proprietary ones. This will include free
support to any open source Zope project willing to manage its own SlapOS
platform rather rely on ours. Let us see if Zope community will be the
first or the last to eat its own dog food ;-).

Regards,

JPS.
Nexedi CEO

PS. I do not mind behind hated for using the word "irresponsible",
whooever took the decision to use github. I do mean it.

Le 18/08/2012 09:49, Jens Vagelpohl a écrit :

Hi Alex,

Please revert this checkin. You can't just take core software pieces from Zope 
Foundation-hosted repositories and move them somewhere else.

Thanks!

jens



On Aug 18, 2012, at 3:09 , J. Alexander Clark  wrote:


Log message for revision 127519:
  Moved to github


Changed:
  A   zc.buildout/README_MOVED_TO_GITHUB.txt
  D   zc.buildout/trunk/

-=-
Added: zc.buildout/README_MOVED_TO_GITHUB.txt
===
--- zc.buildout/README_MOVED_TO_GITHUB.txt  (rev 0)
+++ zc.buildout/README_MOVED_TO_GITHUB.txt  2012-08-18 01:09:06 UTC (rev 
127519)
@@ -0,0 +1 @@
+https://github.com/buildout/buildout/tree/1.6.x

___
checkins mailing list
check...@zope.org
https://mail.zope.org/mailman/listinfo/checkins

___
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  )




__
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
__


___
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 )



--
Simplistix - Content Management, Batch Processing & Python Consulting
   - http://www.simplistix.co.uk
___
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] [Checkins] SVN: zc.buildout/ Moved to github

2012-08-18 Thread Chris Withers

Hi Jens,

On 18/08/2012 09:39, Jens Vagelpohl wrote:

Legally this must be a fork then and I'm not sure it can be released as 
official Zope Foundation software anymore if you make releases from GitHub. 
Reason: the ZF can no longer ascertain that only official ZF contributor 
agreement signers have modified code in the package,


Actually, with the cryptographically signed nature of git commits, I'm 
not sure this is true...



which is a core requirement for software released from Zope Foundation 
repositories/under Zope Foundation auspices.


Well, I guess releases would be made outside of these auspices then, 
whatever that means... The license looks the same, the same people are 
doing the development.


Quite frankly, given the hard time we have getting people to help out, 
anything that eases that can only be a good thing. Chris McDonough and 
the rest of the Pyramid folk seem happy enough with the GitHub model, 
and I've found it's made life very much easier for the python-excel 
project and the other packages I maintain.



Apart from those legal points which are still not entirely clear, since this can only be 
a fork I would say that last checkin must still be reverted. Don't get me wrong, I'm not 
trying to be facetious, but until those legal questions are cleared up you should not 
make any checkins on svn.zope.org that basically "shut down" development of 
that package from there, such as deleting the trunk.


No history has been destroyed, it's just a clear marker of where active 
development is happening. That said, I don't have a strong opinion on 
this, I'd suggest Jim just makes the call...


cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
   - http://www.simplistix.co.uk
___
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] working with different requirements depending on python version

2012-07-01 Thread Chris Withers

On 30/06/2012 18:12, Tres Seaver wrote:

How have other people solved this?


For repoze.sendmail, I did two fixups for Python 2.5:

- - I changed 'install_requires' in setup.py based on sys.version_info

   https://github.com/repoze/repoze.sendmail/blob/master/setup.py

- - I pinned the verstion in tox.ini:

   https://github.com/repoze/repoze.sendmail/blob/master/tox.ini


Thanks, that worked for me:

https://github.com/Simplistix/testfixtures/commit/d56035510f7a63793a82b966b8c8c273b379c7a1

https://github.com/Simplistix/checker/commit/a5f8d089a3af7da1f1e8a5dc3182ea5b5345dcf5

cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
   - http://www.simplistix.co.uk


___
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] Can't compile zope.interface 4.0.1 extensions on Mac OS with Py2.7

2012-07-01 Thread Chris Withers

Hi All,

Got this:

Getting distribution for 'zope.interface'.
In file included from 
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:4,
 from 
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85,
 from 
src/zope/interface/_zope_interface_coptimizations.c:15:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25: error: 
stdarg.h: No such file or directory
In file included from 
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/unicodeobject.h:4,
 from 
/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/Python.h:85,
 from 
src/zope/interface/_zope_interface_coptimizations.c:15:
/Developer/SDKs/MacOSX10.6.sdk/usr/include/stdarg.h:4:25: error: 
stdarg.h: No such file or directory
lipo: can't figure out the architecture type of: 
/var/folders/m6/tsd59qsj7pd_lldh4mhwh6khgn/T//cc4KmKtY.out


WARNING:

An optional code optimization (C extension) could not be compiled.

Optimizations for this package will not be available!
()
command 'gcc-4.2' failed with exit status 1

Got zope.interface 4.0.1.

Anyone seen that before?

cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
   - http://www.simplistix.co.uk

___
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] working with different requirements depending on python version

2012-06-30 Thread Chris Withers

Hi All,

While trying to debug another problem, I re-ran some Jenkins jobs for 
two of my packages, which promptly failed under Python 2.5:


http://jenkins.simplistix.co.uk/job/testfixtures-buildout/
http://jenkins.simplistix.co.uk/job/checker-buildout/

Now, the issue here is that zope.interface 4.0 and above no longer 
supports Python 2.5:


http://jenkins.simplistix.co.uk/job/checker-buildout/PYTHON=2.5,label=linux/15/console
http://pypi.python.org/pypi/zope.interface/4.0.0

That's fine, but I'd like the above projects to continue 2.5 support for 
the time being.


The simple solution would be to add a versions section to the buildout here:

https://github.com/Simplistix/checker/blob/master/buildout.cfg

...and pin the versions in the tox.ini here:

https://github.com/Simplistix/checker/blob/master/tox.ini

...however, that doesn't give the correct result. The version 
requirement is "use the latest version of all packages that work with 
the Python version under test" and the changes I've suggested would mean 
that on Python 2.6 and 2.7, the latest version of zope.interface 
wouldn't be used.


What makes this even more "interesting" is that zope.interface isn't a 
direct requirement of either of these projects, it's a dependency of a 
dependency in both cases.


How have other people solved this?

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
   - http://www.simplistix.co.uk

___
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.server still used?

2012-01-07 Thread Chris Withers

On 20/12/2011 10:44, Jim Fulton wrote:

What's wrong with mod_wsgi?


Debugging with it seems to be a pain, so you end up using different
servers in development and production.


I'm pretty sure if you ask Graham there'll be a simple way to run Apache 
& mod_wsgi in a way that lets you debug in much the same way as running 
ZServer or Paste.


cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
   - http://www.simplistix.co.uk
___
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] ZConfig: multi-line values

2012-01-06 Thread Chris Withers

On 05/01/2012 21:07, Fred Drake wrote:

On Thu, Jan 5, 2012 at 1:47 PM, Chris Withers  wrote:

Is there any way in ZConfig to allow a file that looks like this:

...

...or some other way of spelling multi-line values for a key?


Nope, sorry.  I played with adding that at one point, but didn't have
enough time or motivation.  There are a lot of limitations in the current
syntax.


Meh, I find it covers all things that should be covered pretty well :-)

Out of interest, if I implemented support for filters inside handler 
sections, would you crank out a release?


Would Zope's schema need to change to get that or does Zope 2 use 
ZConfig's logger schema for handlers?


cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] ZConfig: multi-line values

2012-01-05 Thread Chris Withers

Hi Fred,

Is there any way in ZConfig to allow a file that looks like this:


key1 value1

multi
line
value



...or some other way of spelling multi-line values for a key?

If so, how do I phrase it in the schema?

cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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.server still used?

2011-12-19 Thread Chris Withers

On 20/12/2011 07:08, Wolfgang Schnerring wrote:

as advanced as we've come to know. What do people use here, what are
your experiences and ideas?


What's wrong with mod_wsgi?

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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 4 release management

2011-11-17 Thread Chris Withers
On 17/11/2011 16:32, Tres Seaver wrote:
> Note that this question is *not* suitable for "loudest voice on zope-dev
> wins" ressolution.  The software belongs to the Zope Foundation, which
> will make any such decision.

Small point: the software is open source and anyone who wants can 
maintain it anywhere they want ;-)

If the energy of the people doing the current round of development is 
focused on Git, I say let them use Git. Provided they keep the svn 
markers in (and there's no reason not to!) then a git svn dcommit from 
someome authorized will bring all the work back to wherever the Zope 
Foundation wants it...

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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] [TIP] zope.testrunner and nose count doctests differently

2011-11-12 Thread Chris Withers
On 09/11/2011 13:17, Benji York wrote:
>> If this is the case, perhaps Manuel shouldn't do anything with
>> countTestCases? (I know it would drop the test count, but that's not
>> *that* important, right? ;-) - and at least all the test runners would
>> agree...)
>
> Meh.  Having a good count in complaint test runners is more important to
> me than having all test runners agree.  Especially since the lowest
> common denominator seems to be counting the entire file as one test.

Right, but can Manuel "do the right thing" by influencing testsRun 
rather than countTestCases?

>> PS: When are you going to move source control for Manuel over to GitHub?
>
> I have no plans to move the source.  If I did I'd probably move it to
> launchpad.net because most of the other things I work on are there
> (including work things).

Booo, the least favourite dvcs ;-)

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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] Undelivered Mail Returned to Sender

2011-11-09 Thread Chris Withers

Any idea what mx1.emailsrvr.com doesn't like?
Is it Bejni's address, the email in question or that isn't coming from 
server1.simplistix.co.uk?


cheers,

Chris

(trying again to get around the crazy zope.org obsession with banning 
.eml attachments - ie: Thunderbird and others forwarded messages)


--

This is the mail system at host server1.simplistix.co.uk.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system

: host mx1.emailsrvr.com[98.129.184.3] said: 550 5.7.1
 : Relay access denied. (in reply to RCPT TO command)


Reporting-MTA: dns; server1.simplistix.co.uk
X-Postfix-Queue-ID: E45074F8100
X-Postfix-Sender: rfc822; chris@simplistix.co.uk
Arrival-Date: Wed,  9 Nov 2011 08:49:13 + (GMT)

Final-Recipient: rfc822; benji@zope.com
Original-Recipient: rfc822;benji@zope.com
Action: failed
Status: 5.7.1
Remote-MTA: dns; mx1.emailsrvr.com
Diagnostic-Code: smtp; 550 5.7.1 : Relay access denied.
___
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] [TIP] zope.testrunner and nose count doctests differently

2011-11-09 Thread Chris Withers
Hi Benji,

On 08/11/2011 11:10, Jonathan Lange wrote:
>> Mark has somewhat misdirected the thread here, either that or I've got in a
>> muddle, anyway, the issue at hand is that nose ignores
>> TestCase.countTestCases(). Any nose people know what that is?
>
> Not a nose person, but it's usual to report on TestResult.testsRun
> rather than TestSuite.countTestCases. The numbers can be different
> because one test might run multiple times or report multiple results,
> or tests might be generated during the run that weren't available for
> countTestCases to count.

If this is the case, perhaps Manuel shouldn't do anything with 
countTestCases? (I know it would drop the test count, but that's not 
*that* important, right? ;-) - and at least all the test runners would 
agree...)

cheers,

Chris

PS: When are you going to move source control for Manuel over to GitHub?

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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] [TIP] zope.testrunner and nose count doctests differently

2011-11-08 Thread Chris Withers
Hi All,

On 07/11/2011 22:25, Michael Foord wrote:
> On 07/11/2011 19:51, Mark Sienkiewicz wrote:
>> On 11/07/11 12:53, Chris Withers wrote:
>>> The only hiccup is that nose doesn't respect a test_suite function by
>>> default, so I wrote a plugin to make it do the right thing:
>>>
>>> Nose people: any idea *why* nose doesn't respect this method?

Mark has somewhat misdirected the thread here, either that or I've got 
in a muddle, anyway, the issue at hand is that nose ignores 
TestCase.countTestCases(). Any nose people know what that is?


> unittest doesn't *require* you to write a test_suite either - the point
> of test_suite is to allow you to *customize* the set of tests that are
> collected automatically when a test module is loaded. So if you are
> providing a test_suite it is because the default automatic collection
> strategy isn't enough for you.

This is true now, but I'm pretty sure when unittest was introduced, you 
had to provide a test_suite function for test discovery to work.

Of course, that's the dim and distant past and so doesn't really matter. 
However, the fact that nose ignores a test_suite method is a bug, plain 
and simple ;-)

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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.testrunner and nose count doctests differently

2011-11-07 Thread Chris Withers
Hi Benji,

On 03/11/2011 12:31, Benji York wrote:
>
> If you will tell me how you wired up Manuel and nose, I'd love to add a
> how-to section to the Manuel docs.

The only hiccup is that nose doesn't respect a test_suite function by 
default, so I wrote a plugin to make it do the right thing:

http://pypi.python.org/pypi/nose_fixes/1.0

> On Thu, Nov 3, 2011 at 7:13 AM, Chris Withers  wrote:
>> The code uses Manuel, under both nose and zope.testrunner:
>
> Manuel will report the same test count under both nose and
> zope.testrunner but I don't know if nose respects the count provided.
>
> You could put a breakpoint in TestCase.countTestCases() of
> manuel/testing.py and see if it gets called by nose and what it does
> with the result.

Well, grepping through the nose source returns no matches for 
countTestCases, so I'm guessing it doesn't respect this.

Nose people: any idea *why* nose doesn't respect this method?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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.testrunner and nose count doctests differently

2011-11-03 Thread Chris Withers
On 03/11/2011 11:05, Jim Fulton wrote:
> On Thu, Nov 3, 2011 at 5:14 AM, Chris Withers  wrote:
>> Hi Michael,
>>
>> On 03/11/2011 09:12, Michael Howitz wrote:
>>> Run both test runners with the option -vv to see which tests are run.
>>> (I did this for your code and the list of tests seems to be equal.)
>
> It would be interesting for the rest of us to know the length of that list.

$ bin/test -m testfixtures.tests.test_docs -vv
Running tests at level 1
Running zope.testrunner.layer.UnitTests tests:
   Set up zope.testrunner.layer.UnitTests in 0.000 seconds.
   Running:
  testfixtures/docs/api.txt
  testfixtures/docs/changes.txt
  testfixtures/docs/comparing.txt
  testfixtures/docs/components.txt
  testfixtures/docs/datetime.txt
  testfixtures/docs/description.txt
  testfixtures/docs/development.txt
  testfixtures/docs/exceptions.txt
  testfixtures/docs/files.txt
  testfixtures/docs/index.txt
  testfixtures/docs/installation.txt
  testfixtures/docs/license.txt
  testfixtures/docs/logging.txt
  testfixtures/docs/mocking.txt
  testfixtures/docs/streams.txt
  testfixtures/docs/utilities.txt
   Ran 316 tests with 0 failures and 0 errors in 0.150 seconds.
Tearing down left over layers:
   Tear down zope.testrunner.layer.UnitTests in 0.000 seconds.

$ bin/nosetests testfixtures/tests/test_docs.py -vv
nose.config: INFO: Ignoring files matching ['^\\.', '^_', '^setup\\.py$']
testfixtures_nose/docs/api.txt ... ok
testfixtures_nose/docs/changes.txt ... ok
testfixtures_nose/docs/comparing.txt ... ok
testfixtures_nose/docs/components.txt ... ok
testfixtures_nose/docs/datetime.txt ... ok
testfixtures_nose/docs/description.txt ... ok
testfixtures_nose/docs/development.txt ... ok
testfixtures_nose/docs/exceptions.txt ... ok
testfixtures_nose/docs/files.txt ... ok
testfixtures_nose/docs/index.txt ... ok
testfixtures_nose/docs/installation.txt ... ok
testfixtures_nose/docs/license.txt ... ok
testfixtures_nose/docs/logging.txt ... ok
testfixtures_nose/docs/mocking.txt ... ok
testfixtures_nose/docs/streams.txt ... ok
testfixtures_nose/docs/utilities.txt ... ok

--
Ran 16 tests in 0.141s

> My guess is that when you're using the zope testruner, you're somehow
> picking up zope.testing.doctest, which counts each doctest example as
> a  test.

The code uses Manuel, under both nose and zope.testrunner:

from doctest import REPORT_NDIFF,ELLIPSIS
from glob import glob
from manuel import doctest,codeblock,capture
from manuel.testing import TestSuite
from os.path import dirname,join,pardir

def test_suite():
 m =  doctest.Manuel(optionflags=REPORT_NDIFF|ELLIPSIS)
 m += codeblock.Manuel()
 m += capture.Manuel()
 return TestSuite(
 m,
 *glob(join(dirname(__file__),pardir,pardir,'docs','*.txt'))
 )

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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.testrunner and nose count doctests differently

2011-11-03 Thread Chris Withers
On 03/11/2011 10:54, Matthew Wilkes wrote:
>
> On 2011-11-03, at 0025, Chris Withers wrote:
>
>> I'm experimenting with using nose as an alternative to zope.testrunner
>> so I can take advantage of the junit and cobertura compatible xml output
>> offered.
>
> Using http://pypi.python.org/pypi/collective.xmltestreport might be easier? 
> Not sure if it gives you everything you need, but works well for us Plonies.

I'm interested in nose for other reasons too ;-)

The question I'm looking to get answered is what is counting the 
doctests and why is it different between nose and zope.testrunner?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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.testrunner and nose count doctests differently

2011-11-03 Thread Chris Withers
Hi Michael,

On 03/11/2011 09:12, Michael Howitz wrote:
> Run both test runners with the option -vv to see which tests are run.
> (I did this for your code and the list of tests seems to be equal.)

Cool, I'd done this already, but it's good to have someone else verify 
this :-)

> Though this is no answer to the question which code does the counting.

Indeed, so I guess that becomes the real question!

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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] zope.testrunner and nose count doctests differently

2011-11-03 Thread Chris Withers
Hi All,

I'm experimenting with using nose as an alternative to zope.testrunner 
so I can take advantage of the junit and cobertura compatible xml output 
offered.

However, it appears that doctest counting is different between the two:

$  bin/test -m testfixtures.tests.test_docs
Running zope.testrunner.layer.UnitTests tests:
   Set up zope.testrunner.layer.UnitTests in 0.000 seconds.
   Ran 316 tests with 0 failures and 0 errors in 0.136 seconds.
Tearing down left over layers:
   Tear down zope.testrunner.layer.UnitTests in 0.000 seconds.

$ bin/nosetests testfixtures/tests/test_docs.py

--
Ran 16 tests in 0.134s

Does anyone knows why this count is different? What code is counting 
differently?

I'm paranoid that nose might not be running some tests that 
zope.testrunner is.

If you want to take a look at the code, it's here:

https://github.com/Simplistix/testfixtures

zope.testrunner is used on the master branch, nose on the nose branch.

Any help gratefully received!

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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 4 publisher/traversal, sprint topic

2011-10-28 Thread Chris Withers
On 28/10/2011 08:46, yuppie wrote:
> Is that the fault of the publisher? AFAICT the biggest security problem
> of Zope2 is this line in OFS.SimpleItem.Item:
>
>   # Allow (reluctantly) access to unprotected attributes
>   __allow_access_to_unprotected_subobjects__=1
>
> I'm not familiar with the details of the first hotfix, but the second
> one wouldn't have been necessary without that line.

Yep, that's what should have been done in the first place.

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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.sqlalchemy+py3 test failures.

2011-09-29 Thread Chris Withers
On 29/09/2011 15:22, Laurence Rowe wrote:
> On 29 September 2011 10:33, Chris McDonough  wrote:
>> On Tue, 2011-09-27 at 12:40 -0400, Tres Seaver wrote:
>>> This bootstrap is from Jim's '2' branch of zc.buildout:
>>>
>>>   
>>> http://svn.zope.org/zc.buildout/branches/2/bootstrap/bootstrap.py?rev=121484&view=auto
>>>
>>> It is designed to work with Py3k.
>>
>> I've replaced the bootstrap.py in the chrism-py3 branch of both the
>> transaction package and the zope.sqlalchemy packages with that one, and
>> everything looks good!
>>
>> I think we can probably merge both of these branches to their respective
>> trunks and make releases.  I have the necessary powers to do it for
>> transaction; I'll try to track down elro to see if he's willing to do it
>> for zope.sqlalchemy.
>
> I've added chrism as an owner. Before we make a final release I'd like
> to revisit the savepoint release branches of transaction /
> zope.sqlalchemy. I'll bring this up in another mail.

It'd also be great if we could get support for SA 0.7+'s new events 
system...

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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.sqlalchemy+py3 test failures.

2011-09-27 Thread Chris Withers
On 27/09/2011 02:47, Chris McDonough wrote:
> In case anyone is interested, I've made a stab at porting
> zope.sqlalchemy to Python 3 at
> http://svn.zope.org/zope.sqlalchemy/branches/chrism-py3/ .  Several
> tests still fail.  I could use some help fixing them.

Have you tried running the tests by building the buildout instead?
(that's making a huge assumption that zc.buildout and zope.testing work 
on Py3, which I guess isn't the case...)

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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] access to create z.i and z.c releases

2011-09-27 Thread Chris Withers
On 23/09/2011 19:16, Charlie Clark wrote:
> Am 23.09.2011, 09:36 Uhr, schrieb Chris Withers:
>
>> t tried zope.interface 3.8.0 on MacOS X Lion and got:
>
> Oh you brave boy! Given what Apple managed with Snow Leopard I've held off
> Lion so far and I always use the MacPorts toolchain.

I tend to avoid MacPorts/Portage/whatever...

> Works fine on Snow Leopard and builds with gcc-4.2 here. Maybe your Python
> was built with 4.0 or has some unrecognisable architecture flags?

Nah, the migration assistant did a pretty good job, but in the end I 
needed to rebuild my source install of Python2.6, after some bashing to 
get rid of the zope.interface that ships with Mac OS X, I was able to 
get everything working as normal...

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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] access to create z.i and z.c releases

2011-09-23 Thread Chris Withers
On 22/09/2011 10:10, Chris McDonough wrote:
> On Thu, 2011-09-22 at 10:10 +0200, Hanno Schlichting wrote:
>> On Thu, Sep 22, 2011 at 9:03 AM, Chris McDonough  wrote:
>>> I've made tags for zope.interface 3.8.0 and zope.component 3.11.0, as
>>> described in a recent thread to this list, but I don't have PyPI owner
>>> rights to publish them.  Can someone add me to the owners list for those
>>> packages (my pypi user name is "chrism")?
>>
>> Added, release away!
>
> Eggcellent, they are both now released.

I just tried zope.interface 3.8.0 on MacOS X Lion and got:

Getting distribution for 'zope.interface'.
unable to execute gcc-4.0: No such file or directory

WARNING:

 An optional code optimization (C extension) could not be compiled.

 Optimizations for this package will not be available!

command 'gcc-4.0' failed with exit status 1


Not seen that before, definitely got gcc:

$ which gcc
/usr/bin/gcc

$ gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 
5658) (LLVM build 2335.15.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

...not sure why it wants gcc-4.0 specifically, any ideas?

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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: Proposal for merging jbohman-zope.registry branch of zope.component

2011-09-16 Thread Chris Withers
On 15/09/2011 07:11, Chris McDonough wrote:
>>> zope.registry also currently provides a minor API in the way of an
>>> "adapts" decorator.  This could (and should) be moved back into
>>> zope.component; it's actually not used internally by zope.registry now
>>> (although some decoy imports would make you think so if you look at
>>> zope.registry.__init__).
>>
>> First cuts of this at:
>>
>> http://svn.zope.org/zope.component/branches/chrism-zope.interface-componentregistry/
>>
>> http://svn.zope.org/zope.interface/branches/chrism-componentregistry/
>
> I have merged these two branches to their respective trunks:
>
> z.i: https://mail.zope.org/pipermail/checkins/2011-September/057121.html
>
> z.c: https://mail.zope.org/pipermail/checkins/2011-September/057124.html

A big enough change to warrant a second point bump rather than just 
third point, certainly for z.i, surely?

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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: Proposal for merging jbohman-zope.registry branch of zope.component

2011-08-26 Thread Chris Withers
On 26/08/2011 02:17, Charlie Clark wrote:
> Regarding Withers suggestion - should we be looking to move these
> libraries to the WSGI namespace? Or are there real use cases outside the
> web world?

As with Tim, I use both of these libraries plenty of the time outside of 
web work...

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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: Proposal for merging jbohman-zope.registry branch of zope.component

2011-08-25 Thread Chris Withers
On 25/08/2011 06:24, Jim Fulton wrote:
> Maybe something like "zope.plugins" would be better.  When I try
> to explain zope.component to people, I often explain it as a good
> generic plugin mechanism.

If we're renaming, we could also consider dropping the "zope" bit.

I never will understand the irrational fear and hatred of the "zope" 
name but it's still there and I reckon we'd get a much more sensible 
reception in the rest of the python world if we dropped it.

cheers,

Chris

PS: In passing, and for similar reasons, along with ease of 
pronunciation and lack of package namespacing, it'd be great if buildout 
2.0 could be just "buildout" rather than zc.buildout.

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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] TestFixtures 1.10.0 Released!

2011-07-19 Thread Chris Withers
Hmm, might have been helpful to include docs for these new bits:

On 19/07/2011 09:36, Chris Withers wrote:
> - Implement the ability to mock out dict and list
> items using testfixtures.Replacer and
> testfixtures.replace.
>
> - Implement the ability to remove attributes and dict
> items using testfixtures.Replacer and
> testfixtures.replace.

So, here they are:


http://packages.python.org/testfixtures/mocking.html#replacing-items-in-dictionaries-and-lists

http://packages.python.org/testfixtures/mocking.html#removing-attributes-and-dictionary-items

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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] TestFixtures 1.10.0 Released!

2011-07-19 Thread Chris Withers
Hi All,

I'm happy to announce a new release of TestFixtures with the following 
changes:

- Removed the dependency on zope.dottedname.

- Implement the ability to mock out dict and list
   items using testfixtures.Replacer and
   testfixtures.replace.

- Implement the ability to remove attributes and dict
   items using testfixtures.Replacer and
   testfixtures.replace.

The package is on PyPI and a full list of all the links to docs, issue 
trackers and the like can be found here:

http://www.simplistix.co.uk/software/python/testfixtures

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] versions on zope.org and launchpad.net

2011-06-28 Thread Chris Withers
On 28/06/2011 18:28, Johannes Raggam wrote:
> on http://www.zope.org/Products/Zope/swpackage_releases
> there are zope 2.8.12, 2.9.12, 2.10.13 and 2.11.8 available, where on
> launchpad they are not.

Not to mention that http://www.zope.org/Products/ is out of date and 
lists Zope 2.11.4 as the latest 2.11 release, for example...

> IMO it would be better to move all versions up to launchpad and drop the
> download section on zope.org (and zope.org will be soon relaunched
> anyways).

Yeah yeah, we'll see ;-)

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] [modwsgi] Re: weird intermittent error with apache2 and mod_wsgi

2011-06-28 Thread Chris Withers
On 27/06/2011 17:31, Tres Seaver wrote:
> "Let me google that for you":
>
> - - http://mail.zope.org/pipermail/zodb-dev/2009-June/012607.html
>
> - -
> http://mediacore.com/blog/hosting-multiple-wsgi-applications-with-apache/
>
> - - http://trac.edgewall.org/ticket/3371

Adding:

WSGIApplicationGroup %{GLOBAL}

...to my httpd.conf before the virtualhosts section made no difference.
Still works fine for a while, then starts randomly and inconsistently 
spitting exceptions, this time:

mod_wsgi (pid=22471): Exception occurred processing WSGI script 
'/...mod_wsgi'.
Traceback (most recent call last):
   File "...bin/mod_wsgi", line 34, in 
 from aircon.web import make_app
   File "...aircon/web.py", line 7, in 
 from repoze.bfg.configuration import Configurator
ImportError: No module named bfg.configuration

I must stress again, this is intermittent, it'll work for a while, then 
fail for a few requests, then more so until Apache is restarted.

(bfg.configuration is most certainly there and on the python path...)

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] weird intermittent error with apache2 and mod_wsgi

2011-06-27 Thread Chris Withers
Hi All,

Apologies for the cross post, but this problem is occurring with a 
repoze.bfg app running on apache using mod_wsgi, and the exception is 
suggesting something zope.interface related...

So, firstly, it only happens intermittently, and I haven't been able to 
figure out any pattern to the exceptions. It didn't used to happen at 
all (this app has been happily running for a year or so now) but I can't 
think of anything that's changed on the machine in question that might 
cause this. Restarting Apache does appear to cure it for a bit...

The exception is as follows:

File "aircon/bin/mod_wsgi", line 34, in 
   from aircon.web import make_app
File "aircon/aircon/web.py", line 2, in 
   from aircon.config import system,Session
File "aircon/aircon/config.py", line 1, in 
   from gb50 import System
File "aircon/aircon/gb50.py", line 33, in 
   class System:
File 
"zope.interface-3.6.1-py2.6-linux-i686.egg/zope/interface/advice.py", 
line 141, in advise
   return callback(newClass)
File 
"zope.interface-3.6.1-py2.6-linux-i686.egg/zope/interface/declarations.py", 
line 471, in _implements_advice
   classImplements(cls, *interfaces)
File 
"zope.interface-3.6.1-py2.6-linux-i686.egg/zope/interface/declarations.py", 
line 447, in classImplements
   spec = implementedBy(cls)
File 
"zope.interface-3.6.1-py2.6-linux-i686.egg/zope/interface/declarations.py", 
line 287, in implementedByFallback
   spec = cls.__dict__.get('__implemented__')
  2011] [error] [client 93.89.128.162] RuntimeError: class.__dict__ not 
accessible in restricted mode

the section of gb50.py looks like:

from aircon.interfaces import ISystem,IUnit
from zope.interface import implements

class System:

 implements(ISystem)

...

The interface is:

from zope.interface import Interface,Attribute

class ISystem(Interface):
...

Anyone seen anything like this before or have any ideas?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] component registry navelgazing

2011-06-13 Thread Chris Withers
On 13/06/2011 15:26, Charlie Clark wrote:
>> In order to get the object itself back from such an adaptation, you need
>> to use the default= argument.
>
> I know that the question has been answered but your question makes me ask
> another: why would you want to adapt an object with itself?

I have something, I want something that implements IWhatever.

Now, it may well be that something implements IWhatever, but it may also 
not. As the author of the code in question, I don't want to have to care.

Other authors can plug in adapters for the cases where something doesn't 
implement IWhatever ;-)

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] component registry navelgazing

2011-06-13 Thread Chris Withers
On 12/06/2011 21:48, Chris McDonough wrote:
> Currently if you ask a registry to singly-adapt an object to an
> interface, and the object you're trying to adapt implements that
> interface, here's what happens:
>
 from zope.component.registry import Components
 c = Components()
 from zope.interface import Interface, implements
 class IFoo(Interface): pass
> ...
 class Foo(object):
> ... implements(IFoo)
> ...
 foo = Foo()
 c.queryAdapter(IFoo, foo)
> 

Looking back in history:

https://mail.zope.org/pipermail/zope-dev/2008-August/032902.html

I guess one or other of us has the parameter order wrong, probably me.

Much thread ensued:
https://mail.zope.org/pipermail/zope-dev/2008-August/thread.html#32902
https://mail.zope.org/pipermail/zope-dev/2008-September/thread.html#33174

Some justification for keeping the status quo from Fred:

https://mail.zope.org/pipermail/zope-dev/2008-September/033172.html

I stand by my resultant request here:

https://mail.zope.org/pipermail/zope-dev/2008-September/033170.html

Maybe less people care about ZCA now and so we might actually get 
sensible changes made.

Maybe forking would be easier...

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] beta.zope.org (www.zope.org relaunch project)

2011-05-10 Thread Chris Withers
On 11/05/2011 06:52, Andreas Jung wrote:
>> How do existing Zope contributors help out?
>
> Please make your notes. We will pick them up and incorporate
> for the final version. Further changes should be made by the webmaster
> which is currently Michael Haubenwaller.

This sounds a lot like "we don't want your help, kindly go away".
(Where "your" is existing Zope contibutors)

Good luck with that...

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] beta.zope.org (www.zope.org relaunch project)

2011-05-10 Thread Chris Withers
On 11/05/2011 06:45, Andreas Jung wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Chris Withers wrote:
>> On 10/05/2011 22:31, Jens Vagelpohl wrote:
>>>> ...but this name doesn't resolve for me, does it for other people?
>>> The link is incorrect. It should point to www.zodb.org.
>>
>> Where would I got to fix it?
>
> This is our task.

That sounds like a very closed answer :-(

Where's the site in svn?
How do existing Zope contributors help out?

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] beta.zope.org (www.zope.org relaunch project)

2011-05-10 Thread Chris Withers
On 10/05/2011 22:31, Jens Vagelpohl wrote:
>> ...but this name doesn't resolve for me, does it for other people?
>
> The link is incorrect. It should point to www.zodb.org.

Where would I got to fix it?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] beta.zope.org (www.zope.org relaunch project)

2011-05-10 Thread Chris Withers
Hi All,

I found a link off the new site (which looks great, btw) to:

http://zodb.zope.org/

...but this name doesn't resolve for me, does it for other people?

Chris

On 10/05/2011 05:55, Andreas Jung wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Hi there,
>
> I am happy to announce that we have made progress
> with the zope.org relaunch project. The first public
> version of the new site is now available under
>
> http://beta.zope.org
>
> The basic idea behind the project is:
>
>   - a minimalistic www.zope.org site giving a short
> overview about what "Zope" is - including all
> related app servers, CMSes, frameworks etc.
> which links to the related project sites (micro-site
> approach)
>
>   - no more member contents on www.zope.org
>
>   - the current www.zope.org will be stripped down
> to the current member contents and stuff that
> has to be preserved. www.zope.org will be
> renamed to old.zope.org later
>
> Constructive criticism and feedback is welcome _now_.
>
> I hope that we can fix the outstanding issues and integrate
> further feedback over the next few week in order to roll
> out the new site in the first half of June (2011 of course).
>
> Many thanks to my team (doing the real work):
>
> - - Michael Haubenwaller
> - - Kai Mertens
> - - Johannes Raggam
>
> Andreas Jung
> Zope Foundation
>
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.11 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iQGUBAEBAgAGBQJNyMVOAAoJEADcfz7u4AZjTgoLvigFQqPKlnn9J97+wrQRJkdr
> 8ErOiV6LCmpQeNLGDVodq0Y4JGnfQELu0ByzRz+xdig3NDAY9WyKTcxjJqu7DJ4H
> NnZ49dK47uvZaYbfq0kKjzIw9/FX092t5+lyVdiYst1d3JGEphz1iDsl+rySu4m1
> xf3Zq5/+HH0xl2NPQ391dqPuoka+93ydygBfqR7TbBxr4t1GcbFs6vMhN5/13I7c
> g/Q6CWCKlBOfdSnof+p1M/EHtLelst7LPHXluB5tLSQcbpbhd3vtV2x19+InNBWs
> 3vbaWz9EFPQVdgrAc8f3Npw6+t1tn2JMBlLEJtwLmaErqjgDA4MMEmOmJPqNDqYo
> 7fyVWy0+OFeJdrGtO6MOZvmkgTxp+DBYjCOqzhzBijoHGaBQz1RsfH8IrWqhI+Av
> PRihsjM6ZBEhVcHyW/FIQfSvsYJCsim+xxcfkmUhUjXSD6j2h4BBjNnnyI2JRHkq
> iu0A27ANzqZrHx8rRipFcU9gJqLtBfA=
> =8/ed
> -END PGP SIGNATURE-
>
>
> __
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> __
>
>
>
> ___
> 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 )

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] TestFixtures 1.9.2 Released!

2011-04-20 Thread Chris Withers
Hi All,

I'm happy to announce a new release of TestFixtures.

This release adds a utcnow method to test_datetime that behaves 
identically to the now method:

http://packages.python.org/testfixtures/api.html#testfixtures.tdatetime.utcnow

The package is on PyPI and a full list of all the links to docs, issue 
trackers and the like can be found here:

http://www.simplistix.co.uk/software/python/testfixtures

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] [buildout] "private" releases

2011-03-30 Thread Chris Withers
On 30/03/2011 12:29, Wolfgang Schnerring wrote:
>>> (Shameless plug: ;-) gocept.zestreleaser.customupload is a plugin for
>>> zest.releaser that allows uploading the created egg via scp. We use this
>>> to put our non-public eggs into a folder that's served (and htpasswd
>>> protected) by an Apache or somesuch, no complicated "egg server"
>>> business required.
>>
>> So those solutions then require you to put the password for accessing it
>> somewhere during deployment ... where is that for you?
>
> We put the password into the buildout.cfg.

lovely.buildouthttp keeps the passwords in a seperate file in yoru 
.buildout directory...

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] [buildout] "private" releases

2011-03-25 Thread Chris Withers
Hi Christian,

On 25/03/2011 16:49, Christian Theune wrote:
> the German speaking Zope Users Group (DZUG e.V.) organizes a series of 4
> sprints this year to support feature development within the proximity of
> the ZTK and solve problems encountered by Zope, Plone and Python developers.
>

> Topics
> ==
>
> * Discussing how to deal with "private" releases

FWIW, I've had no problems with this, here's a sample buildout.cfg:

[buildout]
extensions = lovely.buildouthttp
find-links = https://example.com/password/protected/folder

...and just dump the .tgz sdists in that folder.

Of course, if you don't need password protection such as when you have 
your "egg server" on a private network, you just need the find-links.

I'm not really sure why people have written a complicated array of "egg 
servers" and the like when a simple http or file system served folder is 
just fine ;-)

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] can't register adapters for classes with metaclasses

2011-02-27 Thread Chris Withers
On 27/02/2011 17:22, Tres Seaver wrote:
>> TypeError: 'DeclarativeMeta' object is not iterable
>>
>> Why is that and how should I register an adapter against such a class?
>
> UTSL:  the 'required' argument passed to 'registerAdapter' is supposed
> to be a sequence of interfaces or classes, not a single interface or
> class.  If a class, then it must be something which can be passed to
> 'implementedBy'.

Thanks. I blame mcdonc, got used to having actual docs for everything ;-)

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] can't register adapters for classes with metaclasses

2011-02-27 Thread Chris Withers

Hi All,

This is particularly problematic when using the common case of 
SQLAlchemy declaratively mapped model classes.


The attached unit test when run will fail with:

Error in test test_provideAdapter (test_sa.TestAdapter)
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/unittest.py", line 279, in run
testMethod()
  File "test_sa.py", line 25, in test_provideAdapter
provideAdapter(MyAdapter,Model)
  File 
"zope.component-3.10.0-py2.6.egg/zope/component/globalregistry.py", line 
72, in provideAdapter

base.registerAdapter(factory, adapts, provides, name, event=False)
  File "zope.component-3.10.0-py2.6.egg/zope/component/registry.py", 
line 182, in registerAdapter

required = _getAdapterRequired(factory, required)
  File "zope.component-3.10.0-py2.6.egg/zope/component/registry.py", 
line 414, in _getAdapterRequired

for r in required:
TypeError: 'DeclarativeMeta' object is not iterable

Why is that and how should I register an adapter against such a class?

cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
   - http://www.simplistix.co.uk
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.schema import Column
from sqlalchemy.types import Integer
from unittest import TestCase
from zope.component import provideAdapter
from zope.interface import implements,Interface


class TestAdapter(TestCase):

def test_provideAdapter(self):
# setup
Base = declarative_base()
class Model(Base):
__tablename__='model'
id = Column('id', Integer, primary_key=True)

class IMyInterface(Interface):
pass

class MyAdapter:
implements(IMyInterface)

provideAdapter(MyAdapter,Model)
___
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] [ZODB-Dev] transaction as context manager, exception during commit

2011-02-24 Thread Chris Withers
On 24/02/2011 11:38, Laurence Rowe wrote:
>> Hi Jim,
>>
>> The current __exit__ for transaction managers looks like this:
>>
>>  def __exit__(self, t, v, tb):
>>  if v is None:
>>  self.commit()
>>  else:
>>  self.abort()
>>
>> ..which means that if you're using the transaction package as a context
>> manager and, say, a relational database integrity constraint is
>> violated, then you're left with a hosed transaction that still needs
>> aborting.
>>
>> How would you feel about the above changing to:
>>
>>  def __exit__(self, t, v, tb):
>>  if v is None:
>>  try:
>>  self.commit()
>>  except:
>>  self.abort()
>>  raise
>>  else:
>>  self.abort()
>>
>> If this is okay, I'll be happy to write the tests and make the changes
>> provided someone does a release when I have...
>
> Looking at the way ZPublisher handles this, I think you're right.

Cool, I'll wait for Jim's verdict (and some time to implement it ;-)) 
before diving in...

> I
> think you might also need to modify the __exit__ in Attempt, which
> additionally handles retrying transactions that fail.

Yeah, I see a bug relating to this was reported yesterday:

https://bugs.launchpad.net/bugs/724332

I know it's a different problem, but sounds like the code for attempt 
needs some love...

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] transaction as context manager, exception during commit

2011-02-24 Thread Chris Withers
Hi Jim,

The current __exit__ for transaction managers looks like this:

 def __exit__(self, t, v, tb):
 if v is None:
 self.commit()
 else:
 self.abort()

..which means that if you're using the transaction package as a context 
manager and, say, a relational database integrity constraint is 
violated, then you're left with a hosed transaction that still needs 
aborting.

How would you feel about the above changing to:

 def __exit__(self, t, v, tb):
 if v is None:
 try:
 self.commit()
 except:
 self.abort()
 raise
 else:
 self.abort()

If this is okay, I'll be happy to write the tests and make the changes 
provided someone does a release when I have...

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] TestFixtures 1.9.0 Released!

2011-02-11 Thread Chris Withers
Hi All,

I'm happy to announce a new release of TestFixtures.

This release adds a helper for tests of code using zope.component:

http://packages.python.org/testfixtures/components.html

The package is on PyPI and a full list of all the links to docs, issue 
trackers and the like can be found here:

http://www.simplistix.co.uk/software/python/testfixtures

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] Manuel and TestFixtures

2011-01-14 Thread Chris Withers
On 08/09/2009 18:04, Chris Withers wrote:
> Coming back to this ancient thread...

...and once more, only a year and a half later ;-)

> What I'd really like to do is write a Manuel plugin that will be part of
> testfixtures' TempDirectory and would handle the following:
>
> .. topic:: some/dir/myfile.py
> :class: file
>
>  ::
>
>   class MyClass:
>  def something(self):
> pass
>
> ...to write the file.
>
> ...and:
>
> .. topic:: some/dir/myfile.py
> :class: expected-file
>
>  ::
>
>   class MyClass:
>  def something(self):
> pass
>
> ...to check it exists and matches what should be there, emitting
> meaningful error messages if things are wrong.

...this is now a reality:

http://packages.python.org/testfixtures/files.html#using-with-manuel

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] Context priority as an alternative to configuration directive overrides

2010-12-03 Thread Chris Withers
On 03/12/2010 10:51, Malthe Borch wrote:
> On 3 December 2010 11:41, Chris Withers  wrote:
>> I'd much prefer it to just be an "order of execution" thing, the nyou have
>> total and flexible control. Combined with some logging about why something
>> is as it is and you have your solution.
>
> It's not always possible to control the order of execution.

It's *always* possible, zcml is essentially one big declarative file...

> For
> instance, with z3c.autoinclude, the order of inclusion is somewhat
> random and although you can to some extend control the order via
> explicit dependency includes, it's hard to work around 3rd party
> packages that provide own overrides.

...anything else is just a kludge or a hack. The Plone world is full of 
these, of course, but I'd prefer not to polute zcml with that.

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] Context priority as an alternative to configuration directive overrides

2010-12-03 Thread Chris Withers
On 02/12/2010 08:15, Malthe Borch wrote:
> I always found configuration overrides (e.g. ZCML's
> directive) to be difficult to manage and hard to get right.
>
> How about an alternative where you can put a priority on a
> configuration context like so:
>
>

I'm -sys.maxint on priorities.

> Default priority would be 0, traditional overrides get the maximum
> priority. ZTK components might then all be at the default priority,
> making it trivial to add a preferred component in a custom setup.

I'd much prefer it to just be an "order of execution" thing, the nyou 
have total and flexible control. Combined with some logging about why 
something is as it is and you have your solution.

The current includeOverrides stuff is a bit of a hack...

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] logrotation/logreopening in ZTK-based applications

2010-11-29 Thread Chris Withers
On 10/11/2010 14:23, Christian Theune wrote:
> I'd like to keep this out of the server: rotation is a system
> administration task where I'd like to rely on the policies and tools
> provided by the system environment.

I just use logrotate's copytruncate option :-)

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] The mysterious origins of a temp_folder

2010-11-04 Thread Chris Withers
Switching to zope-dev as this has become a Zope question:

On 04/11/2010 14:17, Shane Hathaway wrote:
> On 11/04/2010 06:32 AM, Chris Withers wrote:
>> I have the following config for the temp_folders of my ZODB instances:
>>
>>  
>>  
>>  
>>host   dr2.private
>>user   zope
>> ..
>>  
>>keep-history false
>>  
>>mount-point /temp_folder
>>container-class Products.TemporaryFolder.TemporaryContainer
>>  
>>
>> However, even after exercising the site that uses this temp_folder and
>> verifying that there are objects containing within it using the ZMI, I
>> still see the database as totally empty when using MySQL's gui
>> administrator.
>>
>> Any idea what's going on here? Where is the data actually being stored?
>
> If there are no tables at all, then nothing has ever tried to open the
> storage.

Curiouser and curiouser. So, I just checked again and the tables are now 
there but there's precisely 1 row in object_state, which isn't enough.

A "zopectl debug" creates further confusion:

 >>> app._p_jar.db().storage

 >>> app.temp_folder._p_jar.db().storage


To try and figure out what was going on, I removed the whole
 section. I restarted the zope instance, but still 
got the same end result:

 >>> app.temp_folder._p_jar.db().storage


Now I'm really confused. I did try and dig into the startup code and 
found the `install_tempfolder_and_sdc` method of 
OFS.Application.AppInitializer. But, putting a pdb.set_trace() in there 
reveals that the temp folder already exists in the Application by that 
point.

Does anyone know where this is actually coming from or how it's mounted up?

Should we remove the red herring  section in 
zope.conf.in?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] Yet more unicode and page template weirdness

2010-10-13 Thread Chris Withers
On 13/10/2010 13:47, Marius Gedminas wrote:
> On Wed, Oct 13, 2010 at 08:53:08AM +0100, Chris Withers wrote:
>> Hi All,
>>
>> In Zope 2.12, try putting the following in a TTW ZPT:
>>
>> 
>
> Are you sure you didn't mean
>
>

Ah, d'oh! Thanks for the catch!

> The way XML works, all entities in an attribute value are decoded before
> being interpreted, so your TALES interpreter gets an expression
> u'\u203a' which it then fails to interpret.

Makes sense, thanks! What about entities outside of attributes?

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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] Yet more unicode and page template weirdness

2010-10-13 Thread Chris Withers
On 13/10/2010 11:19, Charlie Clark wrote:
> Maybe your question is actually why is the XML entity being converted to
> character data at all?

I guess so...

My naive experience is that this "just works" in Zope 2.9 and "just 
breaks" in 2.12.

> Maybe your question is actually why is the XML entity being converted to
> character data at all?

Yes, absolutely :-)

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] Another weird unicode error from Zope 2

2010-10-13 Thread Chris Withers
On 13/10/2010 11:10, Charlie Clark wrote:
> Am 13.10.2010, 12:06 Uhr, schrieb Chris Withers:
>
>> So why on earth is iso8859_15 being picked instead of utf-8?
>
> I would guess this is the default-publisher-encoding of your system.

I don't have one set.

So, is iso-8859-15 the default in Zope 2.12? If so, why on earth that 
rather than utf-8?

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] Another weird unicode error from Zope 2

2010-10-13 Thread Chris Withers
On 12/10/2010 16:00, Charlie Clark wrote:
> Traceback (most recent call last):
> File "", line 1, in
> UnicodeEncodeError: 'latin-1' codec can't encode character u'\u203a' in
> position 0: ordinal not in range(256)
>
> ISO-8859-15 is, of course, Latin-1 + the €

Yes, but I don't see why that is being used...

Some bits from the error_log entry for this request:

HTTP_USER_AGENT 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; 
WOW64; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; 
MDDC; .NET CLR 3.5.30729; .NET CLR 3.0.30729; MS-RTC LM 8; .NET4.0C)'

HTTP_ACCEPT '*/*'

HTTP_ACCEPT_LANGUAGE'en-us'

So why on earth is iso8859_15 being picked instead of utf-8?

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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 2.12 20% slower than Zope 2.9?!

2010-10-13 Thread Chris Withers
On 11/10/2010 19:00, Alan Runyan wrote:
>> Try with a smaller "batch" (whatever you are doing) and profile it.
>
> I 100% agree with what ajung says.  post a profile of your batch run
> that takes ~30 minutes.

Related to this, what http load testing tools do people around here 
recommend?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] Yet more unicode and page template weirdness

2010-10-13 Thread Chris Withers
Hi All,

In Zope 2.12, try putting the following in a TTW ZPT:



...nothing more, nothing less.

On save, I get:

Compilation failed
: 'ascii' codec can't encode 
character u'\u203a' in position 0: ordinal not in range(128)

If I try and view the template, unsurprisingly, I get:

Module ZPublisher.Publish, line 127, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 47, in call_object
Module Shared.DC.Scripts.Bindings, line 324, in __call__
Module Shared.DC.Scripts.Bindings, line 361, in _bindAndExec
Module Products.PageTemplates.ZopePageTemplate, line 335, in _exec
Module Products.PageTemplates.ZopePageTemplate, line 432, in pt_render
Module Products.PageTemplates.PageTemplate, line 80, in pt_render
Module zope.pagetemplate.pagetemplate, line 109, in pt_render
Warning: Compilation failed
Warning: : 'ascii' codec can't 
encode character u'\u203a' in position 0: ordinal not in range(128)
PTRuntimeError: ['Compilation failed', ": 'ascii' codec can't encode character 
u'\\u203a' in position 0: ordinal not in range(128)"]

Any ideas where the non-ascii character is in the above?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] Another weird unicode error from Zope 2

2010-10-12 Thread Chris Withers
Anyone seen this or know what it means?

Traceback (innermost last):
  Module ZPublisher.Publish, line 130, in publish
  Module ZServer.HTTPResponse, line 266, in setBody
  Module ZPublisher.HTTPResponse, line 330, in setBody
  Module ZPublisher.HTTPResponse, line 485, in _encode_unicode
  Module encodings.iso8859_15, line 12, in encode
UnicodeEncodeError: 'charmap' codec can't encode character u'\u203a' in 
position 2439: character maps to 

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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 2.12 20% slower than Zope 2.9?!

2010-10-11 Thread Chris Withers
On 11/10/2010 16:53, David Glick wrote:
>> Are there any docs on how to get Chameleon to work with classic,
>> ZODB-based page templates?
> Just use cmf.pt: http://pypi.python.org/pypi/cmf.pt

Ah, okay, well, I'm not using anything CMF, so I opted for just five.pt.

Unfortunately, this hits a unicode problem. The unicode problem I solved 
with an IUnicodeEncodingConflictResolver using the normal page template 
engine:

class Resolver:

 implements(IUnicodeEncodingConflictResolver)

 def resolve(self, context, text, expression):
 return unicode(text,'latin-1')

chameleon doesn't appear to use this, so I get:

   File "five.pt-1.3.3-py2.6.egg/five/pt/patches.py", line 90, in 
call_template_and_wrap
 return template(self, *args, **kw)
   File "z3c.pt-1.2.1-py2.6.egg/z3c/pt/pagetemplate.py", line 145, in 
__call__
 return bound_pt(*args, **kwargs)
   File "z3c.pt-1.2.1-py2.6.egg/z3c/pt/pagetemplate.py", line 262, in 
__call__
 return self.im_func(**kw)
   File "z3c.pt-1.2.1-py2.6.egg/z3c/pt/pagetemplate.py", line 136, in render
 return self.render(**context)
   File "Chameleon-1.2.13-py2.6.egg/chameleon/zpt/template.py", line 17, 
in render
 return super(PageTemplate, self).render(*args, **kwargs)
   File "Chameleon-1.2.13-py2.6.egg/chameleon/core/template.py", line 
221, in render
 return self.cook_and_render(kwargs, utils.emptydict, None, True)
   File "Chameleon-1.2.13-py2.6.egg/chameleon/core/template.py", line 
205, in cook_and_render
 return func(econtext, rcontext)
- __traceback_info__: (,)
   File "", line 79, in render
UnicodeDecodeError: 'utf8' codec can't decode byte 0xa3 in position 0: 
unexpected code byte

What's the chameleon or z3c.pt way of dealing with this*?

Chris

*'this' is stacks of ZODB-based page templates whose source may well be 
latin-1 encoded but, moreover, which are operating on a bunch of content 
that's *definitely* latin-1 encoded...
-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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 2.12 20% slower than Zope 2.9?!

2010-10-11 Thread Chris Withers
On 11/10/2010 13:32, Hanno Schlichting wrote:
> My only guess here is that you are calling a lot of page templates and
> those have gotten slower. When we switched to Unicode based templates
> in Zope 2.10, that move has of course cost some performance. Dealing
> with Unicode instead of bytes is always slower.
>
> If you want to improve rendering times and your analysis shows page
> templates to be the problem, try Chameleon.

Yes, this is my guess too.

Are there any docs on how to get Chameleon to work with classic, 
ZODB-based page templates?

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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 Tests: 35 OK, 7 Failed

2010-10-11 Thread Chris Withers
On 09/10/2010 17:01, Tres Seaver wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
>
>> Subject: FAILED : ZTK 1.0 / Python2.4.6 Linux 64bit
>> From: ccomb at free.fr
>> Date: Fri Oct  8 09:12:06 EDT 2010
>> URL: http://mail.zope.org/pipermail/zope-tests/2010-October/021256.html
>
>
> This looks to be a build failure:  the buildout process itself was 'kill
> - -9'ed.

Maybe related to buildout.org being down?

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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] Zope 2.12 20% slower than Zope 2.9?!

2010-10-11 Thread Chris Withers
Hi All,

Just finished upgrading a medium sized project from Zope 2.9 to 2.12.
One part of that does a batch of static copies of a Zope-served site.

I guess I was hoping for a bit of a speed up, so was slightly horrified 
to see the batch, which used to take 11hrs, now takes 13 hrs. This has 
been the same for 2 or 3 days since I did the upgrade so I don't think 
it's a freak occurrence.

The site is classic Zope 2: zodb-based python scripts and page templates 
building the UI from Product-based content objects.

Have others shared this experience?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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] encoding ignored for PageTemplate file uploads

2010-09-30 Thread Chris Withers
Hi All,

Unless I'm missing something, the encoding text field that forms part of 
the file upload form on page template instances is completely ignored 
since it's not used in the pt_upload method of ZopePageTemplate instances.

Am I missing anything?

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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] ZODB history problem with Zope 2.12.7

2010-09-28 Thread Chris Withers
On 28/09/2010 12:55, Tres Seaver wrote:
> On 09/28/2010 03:36 AM, Chris Withers wrote:
>> On 28/09/2010 00:12, Marius Gedminas wrote:
>>> --- ./OFS/History.py.orig   2010-09-28 02:11:56.535745440 +0300
>>> +++ ./OFS/History.py2010-09-28 02:12:00.043764683 +0300
>>> @@ -151,6 +151,9 @@
>>>base = aq_base(self)
>>>base._p_activate()   # make sure we're not a ghost
>>>base.__setstate__(state) # change the state
>>> +for attr in dir(base):
>>> +if attr.startswith('_v_'):
>>> +delattr(base, attr)
>>>base._p_changed = True   # marke object as dirty
>>>self.manage_afterHistoryCopy()
>>
>> Thanks, I guess I'll monkey patch for now, here's the bug:
>>
>> https://bugs.launchpad.net/zope2/+bug/649605
>>
>> However, I'm curious, so the above will fix the object in the current
>> thread, but what about objects in other threads?
>>
>> (or do _v_ attributes get killed off at the start of each transaction?)
>
> Only when objects are ghostified (due to an invalidation from another
> thread or process) or evicted from the cache.  I'm not quite sure how
> the case you are triggering occurs, but if that code saves the new-old
> version of the template to the ZODB, then any instances in other
> threads' connection caches should be invalidated.

Feel free to repeat the steps I originally posted and are in the bug 
description ;-)

Looks like the History.py code isn't doing something it should, but I 
don't know when or what changed to make this so. I'll CC zodb-dev in 
case Jim knows of any changes in ZODB (I'm using 3.9.6) that might be 
relevant...

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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] weird Page Template / ZODB history problem with Zope 2.12.7

2010-09-28 Thread Chris Withers
On 28/09/2010 00:12, Marius Gedminas wrote:
> --- ./OFS/History.py.orig 2010-09-28 02:11:56.535745440 +0300
> +++ ./OFS/History.py  2010-09-28 02:12:00.043764683 +0300
> @@ -151,6 +151,9 @@
>   base = aq_base(self)
>   base._p_activate()   # make sure we're not a ghost
>   base.__setstate__(state) # change the state
> +for attr in dir(base):
> +if attr.startswith('_v_'):
> +delattr(base, attr)
>   base._p_changed = True   # marke object as dirty
>   self.manage_afterHistoryCopy()

Thanks, I guess I'll monkey patch for now, here's the bug:

https://bugs.launchpad.net/zope2/+bug/649605

However, I'm curious, so the above will fix the object in the current 
thread, but what about objects in other threads?

(or do _v_ attributes get killed off at the start of each transaction?)

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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] weird Page Template / ZODB history problem with Zope 2.12.7

2010-09-27 Thread Chris Withers
Hi All,

Try this:

- edit a page template

- edit it again

- go to the history tab, and use the "Copy to present" button to bring 
back your first edit.

On the edit tab, you will correctly see the text you brought back.
However, if you render the template, the old text will be used.

It's only if you "Save changes" that the copied-to-present text will 
actually be used.

Anyone got any ideas why and how to fix this?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] IUnicodeEncodingConflictResolver moronosity

2010-09-22 Thread Chris Withers
On 22/09/2010 09:58, Andreas Jung wrote:
> If you think it is crap then I cam happy to accept that (and I don't
> mind much because Zope 2 is not my radar right now). You are committer
> and you can fix my crap. Blame me for having written this crap but you
> could also blame me for having on this whole Zope 3 ZPT engine
> integration :-)

Can you please answer me one thing though: in what way could it ever be 
a good idea to consult the browser's list of acceptable character sets 
to decide how to decode python strings into python unicode objects in a 
database that the browser has never had anything to do with?

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] IUnicodeEncodingConflictResolver moronosity

2010-09-22 Thread Chris Withers
On 21/09/2010 21:18, Andreas Jung wrote:
> I can not recall all details but at the time of the integration of the
> Zope 3 ZPT engine the unicode resolver approach was the best thinkable
> solution for dealing all possible edgecase where encoding issues may pop
> *for the sake of backwards compatibility*

...where it miserably failed. The projects I've hit this on have all 
been running flawlessly on Zope 2.1(ish) through to Zope 2.9.
Zope 2.11 onwards, in my experience, phail, spectacularly...

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] IUnicodeEncodingConflictResolver moronosity

2010-09-22 Thread Chris Withers
On 22/09/2010 03:50, Andreas Jung wrote:
> I also strongly object such a change in the default behavior.

I'm sorry, but WHAT?

> I did a
> lot of testing of the current implementation and configuration with
> various browsers and Zope applications and add-ons in order to make the
> Zope 3 ZPT engine in Zope 2 work out-of-the-box for most applications.

Er, you can't be serious...

The idea of asking the user agent what encoding is used to encode data 
in the database is like telling an obese person they can have their foot 
amputated in order to lose weight.

A less insane version of that default would be:

class BasicEncodingConflictResolver(object):
   implements(IUnicodeEncodingConflictResolver)

   def resolve(self, context, text, expression):
   logging.warn('You should register an '
'IUnicodeEncodingConflictResolver that matches '
'your content')
   encodings = ['utf-8','latin-1']
   mpc =  getattr(context,'management_page_charset',None)
   if mpc:
   encodings.insert(0,mpc)
   for enc in encodings:
   try:
   return unicode(text,enc)
   except UnicodeDecorError:
   pass
   return unicode(text,sys.getdefaultencoding(),'replace')


> However with the given constraints there will be always applications or
> bad written code

PreferredCharsetResolver *is* bad code.

I'll say it again, 'cos the message doesn't seem to be getting through:

What on earth do the character sets accepted by the browser have to do 
with the python string encoding used in the data on the server, which up 
until that request, most likely has never been anywhere near that 
browser before?!

> resolver. That's why it is pluggable.

Yes, and well documented and advertised too... not!

> existing resolver smarter and more efficient: +1 for tuning the
> implementation but the proposed solution above does not solve anything
> and will break a bunch of apps.

bull crap.

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] IUnicodeEncodingConflictResolver moronosity

2010-09-22 Thread Chris Withers
On 21/09/2010 23:59, Marius Gedminas wrote:
> On Tue, Sep 21, 2010 at 07:39:46PM +0100, Chris Withers wrote:
>> So, would anyone object if I change the default, on both trunk and the
>> 2.12 branch to some variant of:
>>
>> class BasicEncodingConflictResolver(object):
>>implements(IUnicodeEncodingConflictResolver)
>>
>>def resolve(self, context, text, expression):
>>logging.warn('You should register an '
>> 'IUnicodeEncodingConflictResolver that matches '
>> 'your content')
>>return text.decode('ascii','replace')
>>
>> ...and delete that devil spawn turd that is PreferredCharsetResolver?
>
> If this means Zope2-the-application becomes unusable out of the box if
> you've non-ASCII data in your database, then I'm -1.

I'd call having the odd '?' shown in pages and a warning in your logs 
telling you about the problem in clear terms versus sporadic total 
failures by way of unicode exceptions a lot more usable, rather than the 
current situation, which is conceptually insane *and* unusable ;-)

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] IUnicodeEncodingConflictResolver moronosity

2010-09-21 Thread Chris Withers
On 21/09/2010 19:32, Hanno Schlichting wrote:
> Because there's not all that many people left using plain Zope 2 and
> upgrading to new versions.

Well, or they assume they must be doing something wrong because of this 
default.

> The rest is using Plone, which has its own version of this:
>
> def _unicode_replace(structure):
>  if isinstance(structure, str):
>  text = structure.decode('utf-8', 'replace')
>  else:
>  text = unicode(structure)
>  return text
>
> class UTF8EncodingConflictResolver(object):
>  implements(IUnicodeEncodingConflictResolver)
>
>  def resolve(self, context, text, expression):
>  return _unicode_replace(text)

Right, although the 'replace' is a lame cop out too ;-)

> We can do this, as we force manage_page_charset and
> default-zpublisher-encoding to be utf-8 and only support utf-8 and
> Unicode in the database.

Fundamentally, the developer must know what encoding is being used in 
their data. So, they should be able to register an appropriate decoder 
BUT...

> Zope 2 itself tries to support arbitrary encodings, at which point it
> can only guess badly or fail.

...having this default, which makes ABSOLUTELY NO SENSE in this 
universe, or likely any other, is fucking crazy.

So, would anyone object if I change the default, on both trunk and the 
2.12 branch to some variant of:

class BasicEncodingConflictResolver(object):
  implements(IUnicodeEncodingConflictResolver)

  def resolve(self, context, text, expression):
  logging.warn('You should register an '
   'IUnicodeEncodingConflictResolver that matches '
   'your content')
  return text.decode('ascii','replace')

...and delete that devil spawn turd that is PreferredCharsetResolver?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] IUnicodeEncodingConflictResolver moronosity

2010-09-21 Thread Chris Withers
Hi All,

It's been a a while since I had a good rant on a Zope list, but this 
really takes the biscuit.

Andreas, what on *earth* were you thinking with PreferredCharsetResolver?!

I like the idea of IUnicodeEncodingConflictResolver, but 
PreferredCharsetResolver is in the realms of totally batshit crazy.

Why? well, because what *on earth* have the character sets accepted by 
the user agent got to do with how strings are encoded in *my database*?!

Nevermind the logic holes of the following:

- reverting to management_page_charset *only* if there's no REQUEST 
(there's always a REQUEST, this is Zope 2, the world collapses if there 
isn't!)

- returning the original text if the bizarre dance fails, violating the 
contract of IUnicodeEncodingConflictResolver to *return unicode*

How about the *insane performance overhead* of doing two utility lookups 
*and* iterating over a load of encodings trying to find one that works 
for *every single string substituition* done by a ZPT?!

Why has no-one noticed this? Well, my guess is because when browsers are 
explicitly supplying headers, as quite a few do (IE and Safari excepted, 
who are legitimately going "we can handle anything you can throw at 
us"), this moronic piece of code happily loops through them all, and no 
doubt gets a hit on either utf-8 or latin-1, or, if you're really lucky, 
ascii.

To boot, when things go wrong, nobody suspects this miserable little 
turd because it's hides itself nicely by just returning the original 
text, leaving the bemused reader to wonder why some UA's fail and some 
succeed, pointing the finger in totally the wrong direction (hence 
Charlie's hacked up getPreferredCharsets and poor Vlad's desperate 
attempts).

Thankfully, I guess I can register an override that doesn't bark at the 
moon and froth at the mouth... Here, have an invoice for the hours of my 
life you've needlessly wasted...

Farq,

Chris ;-)

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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] Extending Zope2 bin/instance run

2010-09-20 Thread Chris Withers
On 05/09/2010 15:03, Wichert Akkerman wrote:
> On 2010-9-4 00:43, Chris Withers wrote:
>> On 03/09/2010 17:21, Tres Seaver wrote:
>>>> I am not sure if this is best done in plone.recipe.zope2instance or
>>>> Zope2.Startup.zopectl. They have differing versions of ZopeCmd. Perhaps
>>>> the plone.recipe.zope2instance code should be merged into Zope2's
>>>> original as well?
>>>
>>> I don't know anything about the code in plone.recipe.zope2instance.
>>
>> Yes, and please remember that Plone is not the only consumer of Zope 2,
>> and neither is plone.recipe.zope2instance the only way to deploy Zope...
>
> there is absolutely nothing Plone-specific about plone, and people are
> using it for non-Plone systems as well.

It's an overly verbose throwback to before Zope2 was a properly packaged 
package ;-)

I prefer zope2instance, or just using a raw buildout with one of the 
templating recipes for your zope.conf, but then I would say that...

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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] [ZODB-Dev] attempting to undo an un-undoable transaction gives "NotImplementedError" with ZODB 3.9.5

2010-09-09 Thread Chris Withers
On 09/09/2010 21:47, Jim Fulton wrote:
>> 2010-08-26 22:49:01 ERROR txn.-1338986496 Failed to abort resource
>> manager:> object at 0x2d509f0>  at 47516176>
>> Traceback (most recent call last):
>>File "transaction-1.1.0-py2.6.egg/transaction/_transaction.py", line
>> 475, in abort
>>  rm.abort(self)
>>File "transaction-1.1.0-py2.6.egg/transaction/_transaction.py", line
>> 548, in abort
>>  self.manager.abort(o, txn)
>>File "ZODB3-3.9.5-py2.6-macosx-10.3-fat.egg/ZODB/DB.py", line 985, in
>> abort
>>  raise NotImplementedError
>> NotImplementedError
>>
>> This used to give a meaningful error message.
>
> In 3.7 and earlier.
>
>>
>> Anyone know why it no longer does?
>
> The resource manager abort method used to be a pass. In 3.9 in raises
> an exception, which hides the undo exception.

That's bad, right?

> An app should capture
> the undo exception information before calling abort.

"the app" here is Zope 2's publisher process, right?

> My guess is that this works much better in ZODB 3.10.

Any particular reason?

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] Extending Zope2 bin/instance run

2010-09-03 Thread Chris Withers
On 03/09/2010 17:21, Tres Seaver wrote:
>> I am not sure if this is best done in plone.recipe.zope2instance or
>> Zope2.Startup.zopectl. They have differing versions of ZopeCmd. Perhaps
>> the plone.recipe.zope2instance code should be merged into Zope2's
>> original as well?
>
> I don't know anything about the code in plone.recipe.zope2instance.

Yes, and please remember that Plone is not the only consumer of Zope 2, 
and neither is plone.recipe.zope2instance the only way to deploy Zope...

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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 from PageTemplate rendering after upgrading to Zope 2.12.7

2010-09-01 Thread Chris Withers
Marius Gedminas wrote:
>> Has anyone seen this or anything similar before?
> 
> Yes.  Basically, every Zope site I've upgraded to 2.12 has suffered from
> this.  Annoyingly this only happens with MSIE, so developers/admins tend
> not to notice.

...well, and Safari, but no-one uses that, right? ;-)

> Clarifying the "only with MSIE" comment: this happens if and only if
> the HTTP request doesn't explicitly include 'UTF-8' in Accept-Charset.
> IIRC.

OK, but I'll ask this again; what has the present of an Accept-Charset 
header got to do with whether or not rending a page template to a 
unicode string succeeds? Surely, up to that point, it really shouldn't 
matter what the browser wants or doesn't want, we're just getting a 
unicode string ready from whatever data we have around, right?

>> Any solutions spring to mind?
> 
> Magically sprinkle .encode() / .decode() in TAL expressions/Python
> scripts, where appropriate.

I want to get to the bottom of why the Accept-Charset header is getting 
involved at this point. Anyone able to point me at the code that does this?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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 from PageTemplate rendering after upgrading to Zope 2.12.7

2010-08-31 Thread Chris Withers
Vladislav Vorobiev wrote:
> Maybe not the best solution but I use this hack:
> 
> zope.tal-3.5.2-py2.7.egg/zope/tal/talinterpreter.py

Indeed, certainly not a good solution.
This implies that things should be unicode by the time they get here.

Now, the decoding shouldn't be dependent on anything the browser sends, 
should it? I would have thought only the encoding side of things should 
matter..

...so why on earth does the browser used have an effect on the decoding 
  (or not, as seems to be the case with the bug) of the structure?
(and where is this decoding done?)

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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 from PageTemplate rendering after upgrading to Zope 2.12.7

2010-08-31 Thread Chris Withers
Charlie Clark wrote:
> Am 31.08.2010, 12:05 Uhr, schrieb Chris Withers :
> 
>> What does Zope2's publisher do with requested encodings and the like now?
>> Why would this be causing problems?
> 
> I can't remember exactly where but preferred_charset is looked for. It  
> isn't set by either IE or Safari and, although it should default to UTF-8  
> it seems they get served Latin 1 and you get badda boom pretty quickly.

That's weird, the content in this app should be fine to be served latin-1.

>> Errors that affect all browsers I'd be inclined to attribute to my code,
>> ones that randomly affect specific browsers appear more likely to be a
>> bug in Zope for me...
> 
> It is and I thought it had been squashed.

Any idea what I should be looking for and in what changelog?

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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 from PageTemplate rendering after upgrading to Zope 2.12.7

2010-08-31 Thread Chris Withers
Marco Bizzarri wrote:
> 
> No solution, actually, but I would suggest to sniff the traffic between 
> you and the server; I suspect different headers cause problems, here.

Of that I have no doubt.

What does Zope2's publisher do with requested encodings and the like now?
Why would this be causing problems?

Errors that affect all browsers I'd be inclined to attribute to my code, 
ones that randomly affect specific browsers appear more likely to be a 
bug in Zope for me...

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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] UnicodeDecodeError from PageTemplate rendering after upgrading to Zope 2.12.7

2010-08-31 Thread Chris Withers
Hi All,

After a recent upgraded to Zope 2.12, I'm now seeing errors like the 
following when using IE (version 8) or Safari (version 4.0.3) to view 
page templates. Chrome and Firefox work fine.

Traceback (innermost last):
   Module ZPublisher.Publish, line 127, in publish
   Module ZPublisher.mapply, line 77, in mapply
   Module ZPublisher.Publish, line 47, in call_object

   Module Shared.DC.Scripts.Bindings, line 324, in __call__
   Module Shared.DC.Scripts.Bindings, line 361, in _bindAndExec
   Module Products.PageTemplates.ZopePageTemplate, line 335, in _exec
   Module Products.PageTemplates.ZopePageTemplate, line 432, in pt_render
   Module Products.PageTemplates.PageTemplate, line 80, in pt_render
   Module zope.pagetemplate.pagetemplate, line 115, in pt_render
   Module zope.tal.talinterpreter, line 271, in __call__

   Module zope.tal.talinterpreter, line 343, in interpret
   Module zope.tal.talinterpreter, line 751, in do_insertStructure_tal
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position 
366: ordinal not in range(128)

Has anyone seen this or anything similar before?
Any solutions spring to mind?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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] import of zexp containing Page Template objects causes sudden zope death

2010-08-30 Thread Chris Withers
Laurence Rowe wrote:
>> architecture i386): Mach-O executable i386
> 
> This is telling you that the executable contains versions for ppc and
> i386 (no x86_64, so no 64bit version). Another way to confirm this is
> at the python prompt with: import sys; sys.maxint

That's annoying, I was hoping it'd be a 32-bit versus 64-bit problem.

>> Nonetheless, why would a .zexp on a 32-bit architecture and import on
>> 64-bit cause sudden crash death when viewing /manage_main of a an
>> imported folder containing Page Templates?!
>>
>> Still in "wtf?!" mode...
> 
> Your best bet is adding the breakpoint and stepping through with pdb
> until you hit the error (you can usually just hold down the return key
> after the first step...)

Thankfully, I don't deploy in production on Mac OS X so, for now, it's a 
case of "don't do that" :-(

If anyone wants to inspect the .zexp and see if they can figure out 
what's making it go pop, lemme know and I'll try and get one together 
that is small enough that I can let it out to play...

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] import of zexp containing Page Template objects causes sudden zope death

2010-08-29 Thread Chris Withers
Tim Hoffman wrote:
> on linux 
> 
> t...@chrome:~$ file /usr/bin/python2.5
> /usr/bin/python2.5: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), 
> dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped
> t...@chrome:~$ 

Right, so the linux boxes are 32-bit as I suspected:

$ file /usr/local/bin/python2.6
/usr/local/bin/python2.6: ELF 32-bit LSB executable, Intel 80386, 
version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared 
libs), not stripped

$ file /usr/local/bin/python2.6
/usr/local/bin/python2.6: ELF 32-bit LSB executable, Intel 80386, 
version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 
2.6.8, not stripped

> os/x will work the same.

Sadly not:

$ file /Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6
/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6: Mach-O 
universal binary with 2 architectures
/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6 (for 
architecture ppc):  Mach-O executable ppc
/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6 (for 
architecture i386): Mach-O executable i386

Nonetheless, why would a .zexp on a 32-bit architecture and import on 
64-bit cause sudden crash death when viewing /manage_main of a an 
imported folder containing Page Templates?!

Still in "wtf?!" mode...

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk
___
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] import of zexp containing Page Template objects causes sudden zope death

2010-08-28 Thread Chris Withers
Tres Seaver wrote:
>> Now, how in gdb do I find out what it was that was trying to be imported?
>> (should any sort of import cause a core dump?!)
> 
> http://wiki.python.org/moin/DebuggingWithGdb

Things you learn, thanks for that :-)

Okay, another interesting data point; this appears to be related to OS.
The originating server is a 32-bit (I think, how can I double check?) 
linux box, the crashing machine is my 64-bit (but I'm pretty sure python 
is 32-bit, how can I check?) MacBook Pro.

I tried importing the .zexp back onto the originating server; no crashes.

I tried importing the .zexp onto my linux dev both; no crashes.

This ring any bells for anyone?

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] import of zexp containing Page Template objects causes sudden zope death

2010-08-27 Thread Chris Withers
Tres Seaver wrote:
>> It's the sudden death I have issue with, not a peep of logging anywhere...
> 
> Two options there:
> 
> - - Run under gdb.

gdb says:

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0xb0186cec
[Switching to process 12270]
0x000dc08c in import_submodule ()
(gdb) bt
#0  0x000dc08c in import_submodule ()
#1  0x000dc409 in load_next ()
#2  0x000dcdb1 in PyImport_ImportModuleLevel ()
#3  0x000b5a4f in builtin___import__ ()
#4  0xeb25 in PyObject_Call ()
#5  0x000bb4be in PyEval_CallObjectWithKeywords ()

Now, how in gdb do I find out what it was that was trying to be imported?
(should any sort of import cause a core dump?!)

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] import of zexp containing Page Template objects causes sudden zope death

2010-08-27 Thread Chris Withers
Tres Seaver wrote:
> Binary search is your friend:
> 
> - - Is it only one of the ZPTs which cause the crash?

Dunno this yet, will try and find out...

> - - Can you trim out parts of its content and make it not crash?

Yep, if I leave the ZPTs out, it's fine ;-)

> Also, you might try exporting to XML and looking at the XML file for
> oddities (mojibake, etc.)

mojibake?

> You might try to open the imported folder under 'zopectl debug' and see
> if you can examine the contents of the ZPTs. 

Yep, that worked.

> If that works, then the
> issue must be in how 'manage_main' is trying to render the links /
> titles of the templates.

I can render manage_main under zopectl debug with a Test.makerequest'd 
app and a newSecurityManager(None,app.acl_users.getUserById('chris')) :-/

Again, "wtf?!"

It's the sudden death I have issue with, not a peep of logging anywhere...

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] testing problem with path expressions in page templates

2010-08-27 Thread Chris Withers
Marius Gedminas wrote:
>> What adapter might that be and what's the "right" way to get it 
>> registered in a unit test?
> 
> DefaultTraversable, I think, and
> 
> from zope.app.testing import setup
> setup.setUpTraversal()
> 
> Various other features need various other components, e.g. if your
> template tries to use @@absolute_url, in addition to the above, you'll need
> 
> provideAdapter(zope.traversing.namespace.view,
>adapts=(None, None),
>provides=ITraversable,
>name='view')
> 
> similarly for resources you do something like
> 
> ztapi.provideView(Interface, Interface, ITraversable, 'resource',
>   zope.traversing.namespace.resource)
> ztapi.browserResource('style.css', ResourceStub)
> 
> and let's not even start talking about forms and widgets.
> 
> I'm not sure rendering page templates in unit tests is worth the pain.

Actually, it wasn't that bad:

from Products.Five import zcml

class Tests(unittest.TestCase):

 def setUp(self):
 cleanup.cleanUp()
 zcml._initialized = False
 zcml.load_site()

 def tearDown(self):
 cleanup.cleanUp()

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] import of zexp containing Page Template objects causes sudden zope death

2010-08-27 Thread Chris Withers
Hi All,

So, here the story; I have a zodb that's been around for many years.
In it, it has a folder containing a few ZPTs and python scripts.

This server is now running Zope 2.12.

If I zexp export that folder and import into a clean 2.12 instance, the 
import works fine, but when I try to go to the folder in the ZMI, Zope 
dies immediately. No messages, no errors, no output.

If I delete the ZPTs before the export and import, everything is okay.

I can browse the folder and ZPTs fine on the originating server, even 
after the 2.12 upgrade.

I'm left with a vague "wtf?!" feeling.
Does anyone have any clue what the problem might be or how I can get any 
kind of output or error message when it does happen?

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] testing problem with path expressions in page templates

2010-08-26 Thread Chris Withers
Hi All,

When trying to test a template in a unit test, I get the following 
exception:

- Expression: 
...
   File 
"Zope2-2.12.7-py2.6-macosx-10.3-fat.egg/Products/PageTemplates/Expressions.py", 
line 79, in boboAwareZopeTraverse
 request=request)
   File "zope.traversing-3.7.1-py2.6.egg/zope/traversing/adapters.py", 
line 136, in traversePathElement
 raise LocationError('No traversable adapter found', obj)
- __traceback_info__: ({'content': , 'args': ()}, 'content')
LocationError: ('No traversable adapter found', {'content': , 
'args': ()})

'SomeProperty' is, well, a property ;-)

Now, the same template works just fine when used "for real", so I figure 
some standard traversal adapter hasn't been registered when the test runs.

What adapter might that be and what's the "right" way to get it 
registered in a unit test?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] attempting to undo an un-undoable transaction gives "NotImplementedError" with ZODB 3.9.5

2010-08-26 Thread Chris Withers
Here's an example:

2010-08-26 22:49:01 ERROR txn.-1338986496 Failed to abort resource 
manager:  at 47516176>
Traceback (most recent call last):
   File "transaction-1.1.0-py2.6.egg/transaction/_transaction.py", line 
475, in abort
 rm.abort(self)
   File "transaction-1.1.0-py2.6.egg/transaction/_transaction.py", line 
548, in abort
 self.manager.abort(o, txn)
   File "ZODB3-3.9.5-py2.6-macosx-10.3-fat.egg/ZODB/DB.py", line 985, in 
abort
 raise NotImplementedError
NotImplementedError

This used to give a meaningful error message.

Anyone know why it no longer does?

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] Undo tab in Zope 2.12

2010-08-26 Thread Chris Withers
Chris Withers wrote:
> ...often appears to be empty when it shouldn't be.
> 
> Has anyone else observed this?

The answer turned out to be ZODB 2.10b4 being used on the storage server 
side.

I found a clue in the ChangeLog but it sure would be nice if there was 
some logging of some sort to warn what was going on...

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] Undo tab in Zope 2.12

2010-08-26 Thread Chris Withers
...often appears to be empty when it shouldn't be.

Has anyone else observed this?

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
___
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] zc.recipe.egg bug (tracker)?

2010-08-23 Thread Chris Withers
Andreas Jung wrote:
> "/Users/ajung/sandboxes/occ/eggs/zc.recipe.egg-1.3.0-py2.6.egg/zc/recipe/egg/egg.py",
> line 159, in install
> if options.query_bool('dependent-scripts', 'false'):
> AttributeError: 'dict' object has no attribute 'query_bool'
> 
> Not sure who is in charge and where the related bug tracker is!?

Best bet is distutils-sig and/or Gary Poster direct at the moment...

Chris


___
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] Another PageTemplate bug

2010-08-18 Thread Chris Withers
Hi All,

If a PageTemplate's content type is set to text/plain, the edit form 
bombs out with:

2010-08-18 19:40:01 ERROR Zope.SiteErrorLog 1282156801.210.45371719052 
http://localhost:8080/index_html/pt_editAction
Traceback (innermost last):
   Module ZPublisher.Publish, line 127, in publish
   Module ZPublisher.mapply, line 77, in mapply
   Module ZPublisher.Publish, line 47, in call_object
   Module Products.PageTemplates.ZopePageTemplate, line 198, in 
pt_editAction
   Module Products.PageTemplates.ZopePageTemplate, line 163, in pt_edit
   Module Products.PageTemplates.utils, line 80, in convertToUnicode
TypeError: decoding Unicode is not supported

Has anyone else seen this?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk

___
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] PageTemplate Interfaces in Zope 2.12

2010-08-18 Thread Chris Withers
Hi All,

If I got to the "Interfaces" tab of a Page Template in the ZMI of a 
plain Zope 2.12 instance, it simply renders the template.

Should that tab be there?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk

___
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] Zope2 Products.PageTemplates.ZopePageTemplate regression in 2.12+

2010-08-17 Thread Chris Withers
Hi All,

The pt_edit method of the ZopePageTemplate appears to have sprouted a 
string.strip() as its first line.

While I'm use this is fine for xml and html templating, it's 
unacceptable for text/plain templates.

This appears to have been introduced here:

http://zope3.pov.lt/trac/changeset/65525/Zope/trunk/lib/python/Products/PageTemplates/ZopePageTemplate.py

Prior to that, the base PageTemplate's pt_edit method was used, which 
did no stripping.

So:

- does anyone care about this?

- if I remove that .strip(), what tests should I run and how should I 
run them to verify there are no adverse affects to this?

cheers,

Chris

-- 
Simplistix - Content Management, Batch Processing & Python Consulting
 - http://www.simplistix.co.uk

___
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] docs.zope.org automation

2010-08-04 Thread Chris Withers
Jens Vagelpohl wrote:
>> I've just been doing some build and release tools for a customer that
>> involve this sort of stuff, I resorted to:
> 
> 
> Yikes. Maybe the subshell isn't so bad after all :-P

Yeah ;-) Although getting the right python path set up can be a pain...

Here's the actual version I use to do an in-process sdist:

 try:
 orig_argv = sys.argv
 orig_stdout,orig_stderr = sys.stdout,sys.stderr
 curdir = os.getcwd()
 sys.argv = sys.argv[0:1]+['egg_info',
   '--tag-svn-revision',
   '--tag-date',
   'sdist']
 sys.path.insert(0,location)
 os.chdir(location)
 sys.stdout,sys.stderr = StringIO(),StringIO()
 # yuk, but setup.py is yuk anyway!
 if 'setup' in sys.modules:
 del sys.modules['setup']
 import setup
 finally:
 os.chdir(curdir)
 sys.path.pop(0)
 sys.stdout,sys.stderr = orig_stdout,orig_stderr
 sys.argv = orig_argv

cheers,

Chris

___
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 )


  1   2   3   4   5   6   7   8   9   10   >