Re: [Zope] Frustrated with Python and Frameworks. Zope, Grok, Django, CherryPy
Rene B wrote: I'm frustrated trying to select a python web framework. I’ve researched quite a few. CherryPy,Karrigell,Zope 2,3,Grok, Gluon,Django,Mod_Python. I’ve also Perhaps web.py can interest you then? Its not very much of framework (you actually write everything in Python, even making your own architectural decisions, and template language resembles Python also), but it requires almost no learning and dynamic site can be setup in no time. And webpy is not too hard as it is very minimalistic, so enjoy writing Python most of the time instead of working around some framework's peculiarities. Maybe after at least playing with that you will revisit other Python web application frameworks already knowing what you want. Regards, Roman Susi looked at templating languages like Spyce, and Cheetah. I’m beginning to think there’s nothing out there for a newbie python programmer like myself. I’m a Network Admin that likes programming but doesn’t have the time to get really proficient at it. I selected Python as a language of choice and that’s all I’ve used. I’ve written a few scripts . I’m interested in building dynamic web sites but I tell you it’s impossible to select a tool. I’ve researched all the tools mentioned above. The most important thing in my decision is that I know some Python and want to use it to build the dynamic site. I don’t want to learn a new language to do that. ZPT is a new language. Its not python. Not even close. Out of all the ones I’ve researched I like Zope 2 the best. Not sure why. I want some thing easy. I like DTML. It’s easy. I know why ZPT has it’s advantages but for ease of use it doesn’t come close to DTML. Most people like me wont be building complex web sites and I’d be the only working on it meaning I’ll do the HTML layout and code the dynamic portions of it. So I don’t’ need to worry about an HTML editor getting confused with the dynamic languages mixed in blah blah blah. I’m afraid to learn Zope 2 because I have no idea what direction it’s going in. Not to mention I don’t particularly like ZPT. I’ve read DTML isn’t going anywhere but I don’t imagine I’ll get much support on it when needed and I’m sure people will be telling me to use ZPT cause DTML is dead. Funny, I read something while reading news about Grok’s new plugins for any template language . They used Genshi as an example and talked about template languages and which one is better etc.. The bottom line was use the one that you like. So I wish people would stop putting down DTML or others over the one they prefer and continue to help those regardless of which they choose. Back to trying to choose. I think Django is too hard. I like Mod_python with PSP. PSP seems to be more python like then anything I’ve seen. Yet Mod_Python has terrible docs for people like me and it doesn't seem to popular. The other frameworks have some good ideas. I like Karrigell but you just don’t know how long it will be supported.Gluon is cool but its new. Zope 3 is out of the question. Grok looks to me like another CherryPy. It may be easier the Zope 3 but it’s not easier then Zope 2. Plus I’ve yet to get it installed on my windows XP to play. I like cheetah as a tool. There docs are not that great and not many examples. Plus no auto generated content like you get in Zope 2. Yes some magic is good. The CRUD is what made Rails over rated to start out with.People like some magic. saves time. Combining Cheetah and Zope sounds interesting to me. So what do I do. I like Zope 2. I can’t find any books on it released after 2002. Plone is tooo much. There aren’t any new products out for Zope 2 and the ones that are there haven’t been touched for years. Zope 2 wiki seems dead. I was looking the other day for some type of auto CRUD for Zope 2. couldn’t find anyting. No one seems to be adding anything new to Zope 2 which scares me the most. If I take the time to learn a tool I want to make sure it’s going to be around for awhile and have good support and new addons being added all of the time to help me. ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) !DSPAM:474b8277286491564115247! ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] ordinal not in range error in StringIO.py
hi! My code produces the following traceback File /opt/Zope-2.9.1/lib/python/ZPublisher/Publish.py, line 40, in call_object result=apply(object,args) # Type scr to step into published object. File /var/zope-2.9/Products/Five/browser/metaconfigure.py, line 403, in __call__ return self.index(self, *args, **kw) File /opt/Zope-2.9.1/lib/python/Shared/DC/Scripts/Bindings.py, line 311, in __call__ return self._bindAndExec(args, kw, None) File /opt/Zope-2.9.1/lib/python/Shared/DC/Scripts/Bindings.py, line 348, in _bindAndExec return self._exec(bound_data, args, kw) File /opt/Zope-2.9.1/lib/python/Products/PageTemplates/PageTemplateFile.py, line 110, in _exec return self.pt_render(extra_context=bound_names) File /opt/Zope-2.9.1/lib/python/Products/PageTemplates/PageTemplate.py, line 105, in pt_render return output.getvalue() File /opt/lib/python2.4/StringIO.py, line 272, in getvalue self.buf += ''.join(self.buflist) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 8: ordinal not in range(128) when frontpage is published. I have analysed self.buflist and it seems that unicode strings are mixed with usual strings. Unicode strings come from .mo file. So, the question is why ZPublisher doesnt coerce different string before serving and what can I do in this situation? .po file has utf8 encoding. Publisher encoding is utf8. Quick and very dirty solution is to mend StringIO.py... Does anybody has better cure? Thanks! Regards, Roman Suzi ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Hooks for methods other than GET/POST on port 80?
Andreas Jung wrote: --On 9. Dezember 2005 15:33:38 +0200 Roman Susi [EMAIL PROTECTED] wrote: Hi! I've found the reason for original bug I hit. The recursion was in my code (and gone away after I corrected it). However, the bug I reported to Zope.org is still there. I think its a bug to freeze the whole server by maximum-recursion-reached error in a product... There is always a chance to bring Zope down by writing bad code. But I still do not understand if this is really a Zope problem or just an example of stupid code. Not sure if filesystem based products qualify, but its like saying that ´is it operating system problem or stupid application code which brings OS down'. One misbehaving code should not bring down the whole framework, IMHO. -aj Regards, Roman ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Hooks for methods other than GET/POST on port 80?
Andreas Jung wrote: --On 9. Dezember 2005 08:04:04 +0200 Roman Susi [EMAIL PROTECTED] wrote: Chris Withers wrote: Roman Susi wrote: Even if it is in my code, it is still too bad to get down the whole Zope server. Also, it was confirmed as a bug. Where and who by? At Zope.org issue tracker by ajung. However, it is not seen as it is security related. I did not confirm it as bug. I said that it is possibly a bug but nothing that worries me so much. -aj Hi! I've found the reason for original bug I hit. The recursion was in my code (and gone away after I corrected it). However, the bug I reported to Zope.org is still there. I think its a bug to freeze the whole server by maximum-recursion-reached error in a product... Regards, Roman ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Hooks for methods other than GET/POST on port 80?
Chris Withers wrote: Roman Susi wrote: Even if it is in my code, it is still too bad to get down the whole Zope server. Also, it was confirmed as a bug. Where and who by? At Zope.org issue tracker by ajung. However, it is not seen as it is security related. Chris ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Hooks for methods other than GET/POST on port 80?
Chris Withers wrote: (please keep the list CC'ed in) Roman Susi wrote: What do you mean by freezes? how did you cause this to happen? Surely, this is not only a bug but a security issue leading to DOS attack, IMHO. Well, it's a pretty weird use case from what I can see... Still, it is unclear why it happens... Traceback (most recent call last): File /usr/local/lib/python2.3/logging/__init__.py, line 674, in emit msg = self.format(record) File /usr/local/lib/python2.3/logging/__init__.py, line 567, in format return fmt.format(record) File /usr/local/lib/python2.3/logging/__init__.py, line 369, in format s = s + self.formatException(record.exc_info) File /usr/local/lib/python2.3/logging/__init__.py, line 342, in formatException traceback.print_exception(ei[0], ei[1], ei[2], None, sio) File /usr/local/lib/python2.3/traceback.py, line 123, in print_exception print_tb(tb, limit, file) File /usr/local/lib/python2.3/traceback.py, line 68, in print_tb line = linecache.getline(filename, lineno) File /usr/local/lib/python2.3/linecache.py, line 14, in getline lines = getlines(filename) RuntimeError: maximum recursion depth exceeded We need more of the traceback, there is no repeating part here so it's impossible to see what's causing the infinite recursion... I am not sure how to get the whole traceback... Well, where did you see the above? In the log. Chris, could you put this into Zope issue tracker (with security tick as I do not want to make this info public right now)? (I've tried but I do not have an account there..) No, there's nothing stopping you registering at zope.org and doing this yourself. Furhtermore, I'd guess this is likely a bug in your code and nothing to do with Zope ;-) (of course, I could be wrong on that, but I haven't seen any evidence yet) Even if it is in my code, it is still too bad to get down the whole Zope server. Also, it was confirmed as a bug. cheers, Chris Regards, Roman ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Hooks for methods other than GET/POST on port 80?
Dieter Maurer wrote: Roman Suzi wrote at 2005-12-3 21:56 +0200: I am looking for a way in Zope to receive HTTP-requests with, eg, DELETE and PUT in the object method. Zope (2.7.x) seems to intercept these and issue Not authorised. DELETE and PUT are WebDAV methods (and defined in webdav.Resource.Resouce). You have the usual hook: override the definition in your class. Do not forget to assign a new permission to your new method definitions (otherwise, the 'Unauthorized' will remain). Advice taken, thanks. However, when I tried to do it and Zope freezes (that is, the whole Zope server freezes!). never saw anything like that before... After restarting Zope the same thing happened again. Probably it's a bug. Roman Suzi ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Hooks for methods other than GET/POST on port 80?
Dieter Maurer wrote: Roman Suzi wrote at 2005-12-3 21:56 +0200: I am looking for a way in Zope to receive HTTP-requests with, eg, DELETE and PUT in the object method. Zope (2.7.x) seems to intercept these and issue Not authorised. DELETE and PUT are WebDAV methods (and defined in webdav.Resource.Resouce). You have the usual hook: override the definition in your class. Do not forget to assign a new permission to your new method definitions (otherwise, the 'Unauthorized' will remain). This is what freezes Zope: Traceback (most recent call last): File /usr/local/lib/python2.3/logging/__init__.py, line 674, in emit msg = self.format(record) File /usr/local/lib/python2.3/logging/__init__.py, line 567, in format return fmt.format(record) File /usr/local/lib/python2.3/logging/__init__.py, line 369, in format s = s + self.formatException(record.exc_info) File /usr/local/lib/python2.3/logging/__init__.py, line 342, in formatException traceback.print_exception(ei[0], ei[1], ei[2], None, sio) File /usr/local/lib/python2.3/traceback.py, line 123, in print_exception print_tb(tb, limit, file) File /usr/local/lib/python2.3/traceback.py, line 68, in print_tb line = linecache.getline(filename, lineno) File /usr/local/lib/python2.3/linecache.py, line 14, in getline lines = getlines(filename) RuntimeError: maximum recursion depth exceeded Regards, Roman Suzi ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Hooks for methods other than GET/POST on port 80?
Tino Wildenhain wrote: Am Samstag, den 03.12.2005, 21:56 +0200 schrieb Roman Suzi: Hi! ... DELETE /path/to/object/X/Y HTTP/1.1 Host: myhost.myorg.org Content-Type: application/myprotocol+xml Of course, I have a product Z which has this class: class Z: ... def Y(self, REQUEST): if REQUEST.REQUEST_METHOD == 'POST': # no problem elif REQUEST.REQUEST_METHOD == 'DELETE': # this is never reached... Zope doesnt call Y What do I tweak so object X will receive Y on a usual HTTP port 80? THANKS! It seems you want the action and not the original request. When you use if ... why not just define manage_delObjects on your class? No, I want to control whatever is done. That is, I want to intercept that request. This works for PUT and most other request types as well. HTH Tino ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )