[Zope-dev] cache_detail crash

2011-09-22 Thread Ruslan Mahmatkhanov
Good day.

I'm using zope 2.13 and all is working fine.

But when i going:
http://localhost:8080/Control_Panel/Database/cache_detail

I got Site Error with this traceback:

Traceback (innermost last):
   Module ZPublisher.Publish, line 126, in publish
   Module ZPublisher.mapply, line 77, in mapply
   Module ZPublisher.Publish, line 46, in call_object
   Module App.CacheManager, line 105, in cache_detail
   Module App.CacheManager, line 105, in genexpr
TypeError: %d format: a number is required, not str


Can anybody reproduce this?

Relevant components versions:
zope.publisher-3.12.6
Products.StandardCacheManagers-2.13.0

Thanks.

-- 
Regards,
Ruslan

Tinderboxing kills... the drives.
___
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] cache_detail crash

2011-09-22 Thread Hanno Schlichting
On Thu, Sep 22, 2011 at 10:21 AM, Ruslan Mahmatkhanov cvs-...@yandex.ru wrote:
 Can anybody reproduce this?

Yes, it's a known bug reported at https://bugs.launchpad.net/zope2/+bug/838978

Patches are very welcome for this.

Hanno
___
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] cache_detail crash

2011-09-22 Thread Ruslan Mahmatkhanov

Hanno Schlichting wrote on 22.09.2011 12:34:

On Thu, Sep 22, 2011 at 10:21 AM, Ruslan Mahmatkhanovcvs-...@yandex.ru  wrote:

Can anybody reproduce this?


Yes, it's a known bug reported at https://bugs.launchpad.net/zope2/+bug/838978

Patches are very welcome for this.

Hanno


Ok, this change works for me.

It should be applied against src/App/CacheManager.py.
Would you mind to commit it?

--
Regards,
Ruslan

Tinderboxing kills... the drives.
--- CacheManager.py.orig2011-09-22 12:52:48.0 +0400
+++ CacheManager.py 2011-09-22 12:56:54.0 +0400
@@ -102,7 +102,7 @@
 if REQUEST is not None:
 # format as text
 REQUEST.RESPONSE.setHeader('Content-Type', 'text/plain')
-return '\n'.join('%6d %s'%(count, name) for count, name in detail)
+return '\n'.join('%s %6d'%(count, name) for count, name in detail)
 else:
 # raw
 return detail
___
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] cache_detail crash

2011-09-22 Thread Albertas Agejevas
On Thu, Sep 22, 2011 at 12:59:43PM +0400, Ruslan Mahmatkhanov wrote:
 Ok, this change works for me.
 
 It should be applied against src/App/CacheManager.py.
 Would you mind to commit it?

  REQUEST.RESPONSE.setHeader('Content-Type', 'text/plain')
 -return '\n'.join('%6d %s'%(count, name) for count, name in 
 detail)
 +return '\n'.join('%s %6d'%(count, name) for count, name in 
 detail)

This doesn't look right!  So count is %s, and name is %d?  Perhaps
their order in detail changed?

Albertas
___
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] cache_detail crash

2011-09-22 Thread Ruslan Mahmatkhanov

Albertas Agejevas wrote on 22.09.2011 13:05:

On Thu, Sep 22, 2011 at 12:59:43PM +0400, Ruslan Mahmatkhanov wrote:

Ok, this change works for me.

It should be applied against src/App/CacheManager.py.
Would you mind to commit it?



  REQUEST.RESPONSE.setHeader('Content-Type', 'text/plain')
-return '\n'.join('%6d %s'%(count, name) for count, name in detail)
+return '\n'.join('%s %6d'%(count, name) for count, name in detail)


This doesn't look right!  So count is %s, and name is %d?  Perhaps
their order in detail changed?

Albertas


detail is looks like that:

[('AccessControl.users.User', 3),
 ('App.ApplicationManager.ApplicationManager', 3),
. ]

So if the count still should go first, this patch should work.

--
Regards,
Ruslan

Tinderboxing kills... the drives.
--- CacheManager.py.orig2011-09-22 12:52:48.0 +0400
+++ CacheManager.py 2011-09-22 13:09:20.0 +0400
@@ -102,7 +102,7 @@
 if REQUEST is not None:
 # format as text
 REQUEST.RESPONSE.setHeader('Content-Type', 'text/plain')
-return '\n'.join('%6d %s'%(count, name) for count, name in detail)
+return '\n'.join('%6d %s'%(count, name) for name, count in detail)
 else:
 # raw
 return detail
___
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 )