Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article [EMAIL PROTECTED], Fredrik Lundh wrote: Jon Ribbens wrote: does the word information set mean anything to you? You would appear to be talking about either game theory, or XML, neither of which have anything to do with HTML. I notice that yet again you've snipped the substantial

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article [EMAIL PROTECTED], Fredrik Lundh wrote: What do XML Information Sets have to do with escaping control characters in HTML? figure out the connection, and you'll have the answer to your substantial point. If you don't know the answer, you can say so y'know. There's no shame in it.

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article [EMAIL PROTECTED], Brian Quinlan wrote: Well, there are dozens (hundreds?) of templating systems for Python. I know, I wrote one of them ;-) t = Template(test.html) t['foo'] = 'Brian - Hi!' assert str(t) == 'pBrian -gt; Hi/p' So how would you test our template system? What I

Re: A critique of cgi.escape

2006-09-26 Thread Jon Ribbens
In article [EMAIL PROTECTED], Brian Quinlan wrote: If, in the example that I showed, the less-than character was not correctly escaped, then it might not manifest itself frequently in a typical application because the less-than character is seldom used in English prose. OK, but effectively

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article [EMAIL PROTECTED], Fredrik Lundh wrote: maybe you haven't done software long enough to understand that software works better if you use it the way it was intended to be used, but that's no excuse for being stupid. So what's your excuse? --

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article [EMAIL PROTECTED], Fredrik Lundh wrote: If you're really serious about making things easier to use, shouldn't you look at the whole picture? HTML documents are byte streams, so any transformation from internal character data to HTML must take both escaping and encoding into

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article [EMAIL PROTECTED], Fredrik Lundh wrote: (still waiting for the jon's enhanced escape proposal, btw, but I guess it's easier to piss on others than to actually contribute something useful). Well, yes, you certainly seem to be good at the pissing on others part, even if you have to lie

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article [EMAIL PROTECTED], Duncan Booth wrote: It is generally a principle of Python that new releases maintain backward compatability. An incompatible change such proposed here would probably break many tests for a large number of people. Why is the suggested change incompatible? What

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article [EMAIL PROTECTED], Fredrik Lundh wrote: There's nothing to say that cgi.escape should take them both into account in the one function so what exactly are you using cgi.escape for in your code ? To escape characters so that they will be treated as character data and not control

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article [EMAIL PROTECTED], Georg Brandl wrote: I'm sorry, that's not good enough. How, precisely, would it break existing code? Can you come up with an example, or even an explanation of how it *could* break existing code? Is that so hard to see? If cgi.escape replaced ' with an entity

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article [EMAIL PROTECTED], Duncan Booth wrote: I guess you've never seen anyone write tests which retrieve some generated html and compare it against the expected value. If the page contains any unescaped quotes then this change would break it. You're right - I've never seen anyone do

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article [EMAIL PROTECTED], Max M wrote: I'm sorry, that's not good enough. How, precisely, would it break existing code? Can you come up with an example, or even an explanation of how it *could* break existing code? Some examples are: - Possibly any code that tests for string equality

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article [EMAIL PROTECTED], Max M wrote: Oh ... because you cannot see a use case for that *documented* behaviour, it must certainly be wrong? No, but if nobody else can find one either, that's a clue that maybe it's safe to change. Here's a point for you - the documentation for cgi.escape

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: I'm sorry, that's not good enough. How, precisely, would it break existing code? ('owdo Mr. Ribbens!) Good afternoon Mr Glover ;-) URI= 'http://www.oreilly.com/' html= cgi.escape(text) html= html.replace('O\'Reilly', 'a

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article [EMAIL PROTECTED], Fredrik Lundh wrote: Sorry, that's still not good enough. that's not up to you to decide, though. It's up to me to decide whether or not an argument is good enough to convince me, thank you very much. -- http://mail.python.org/mailman/listinfo/python-list

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article [EMAIL PROTECTED], Filip Salomonsson wrote: Here's a point for you - the documentation for cgi.escape says that the characters , and are converted, but not what they are converted to. If the documentation isn't clear enough, that means the documentation should be fixed.

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article [EMAIL PROTECTED], Fredrik Lundh wrote: It's up to me to decide whether or not an argument is good enough to convince me, thank you very much. not if you expect anyone to take anything you say seriously. Now you're just being ridiculous. In this thread you have been rude, evasive,

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article [EMAIL PROTECTED], Brian Quinlan wrote: Now you're just being ridiculous. In this thread you have been rude, evasive, insulting, vague, hypocritical, and have failed to answer substantive points in favour of sarcastic and erroneous sniping - I'd suggest it's you that needs to worry

Re: A critique of cgi.escape

2006-09-25 Thread Jon Ribbens
In article [EMAIL PROTECTED], Georg Brandl wrote: Here's a point for you - the documentation for cgi.escape says that the characters , and are converted, but not what they are converted to. It says to HTML-safe sequences. That's reasonably clear without the need to reproduce the exact

Re: QuoteSQL

2006-09-25 Thread Jon Ribbens
In article [EMAIL PROTECTED], Lawrence D'Oliveiro wrote: You're proposing two separate functions: 1) quoting of non-wildcard specials 2) quoting of wildcard specials Lawrence, you're wrong in this thread for the same reason you were right in the cgi.escape thread. Escaping general

Re: A critique of cgi.escape

2006-09-24 Thread Jon Ribbens
In article [EMAIL PROTECTED], Georg Brandl wrote: Attributes can be quoted with either single or double quotes. That's what the HTML spec says. cgi.escape doesn't correctly allow for that. Ergo, cgi.escape is broken. QED. A function is broken if its implementation doesn't match the

Re: A critique of cgi.escape

2006-09-24 Thread Jon Ribbens
In article [EMAIL PROTECTED], Fredrik Lundh wrote: Making cgi.escape always escape the '' character would not break anything, and would probably fix a few bugs in existing code. Yes, those bugs are not cgi.escape's fault, but that's no reason not to be helpful. It's a minor improvement with no

Re: A critique of cgi.escape

2006-09-23 Thread Jon Ribbens
In article [EMAIL PROTECTED], Fredrik Lundh wrote: Lawrence D'Oliveiro wrote: So I think the default for the second argument to cgi.escape should be changed to True. Or alternatively, the second argument should be removed altogether, and quotes should always be escaped. you're confused:

Re: add without carry

2006-09-15 Thread Jon Ribbens
In article [EMAIL PROTECTED], Bruno Desthuilliers wrote: Hugh wrote: Sorry, here's an example... 5+7=12 added without carrying, 5+7=2 i.e the result is always less than 10 I've been thinking some more about this and my brain is starting to work something out... No need to think

Re: IP address

2006-08-10 Thread Jon Ribbens
In article [EMAIL PROTECTED], Lad wrote: I have a website written in Python and I would like to login every visitor's IP address. In other words, if a visitor come to my Python application, this application will record his IP. Depending on what CGI framework you're using, something like:

Re: need an alternative to getattr()

2006-08-07 Thread Jon Ribbens
In article [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: import heading1 import heading2 While True: heading = get_next_heading(file_ptr) # This func will return heading1, then heading2(on next call) if heading = : break getattr(heading, process)(file_ptr) # The problem,

Re: how can I avoid abusing lists?

2006-07-07 Thread Jon Ribbens
In article [EMAIL PROTECTED], Thomas Nelson wrote: This is exactly what I want to do: every time I encounter this kind of value in my code, increment the appropriate type by one. Then I'd like to go back and find out how many of each type there were. This way I've written seems simple enough

Re: Fork You.. Forking and threading..

2006-07-05 Thread Jon Ribbens
In article [EMAIL PROTECTED], rh0dium wrote: if os.fork() == 0: os.setsid sys.stdout = open(/dev/null, 'w') sys.stdin = open(/dev/null, 'r') I don't know if it's the cause of your problem, but you're not doing the backgrounding right, it should be: if os.fork():

Re: Sudoko solver

2006-07-04 Thread Jon Ribbens
In article [EMAIL PROTECTED], Rony Steelandt wrote: Yes, this is on windows using winzip It says the zip file is not a valid zipfile Works fine for me on Windows. Try deleting the file you downloaded, clearing your browser cache, and trying again. On the other hand, when you run it it

Re: help() on stdout.closed

2006-06-21 Thread Jon Ribbens
In article [EMAIL PROTECTED], Pekka Karjalainen wrote: from sys import stdout help (stdout.closed) If I do this, it gives me help on the bool object. stdout.closed is a bool. What were you expecting it to show you? -- http://mail.python.org/mailman/listinfo/python-list

Re: What's the best way to wrap a whole script in try..except?

2006-06-21 Thread Jon Ribbens
In article [EMAIL PROTECTED], Hari Sekhon wrote: I want to wrap a whole script in try ... except. What is the best way of doing this? You could do this maybe: import sys def excepthook(exc_type, exc_value, tb): import modules_needed_to_notify_exception ... sys.excepthook =

Re: OS specific command in Python

2006-06-21 Thread Jon Ribbens
In article [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: So basically, instead of typing in on the command line argument I want to have it in a python program and let it do the action. Try exec() and execfile() from the standard library (IIRC) Ths os.spawn...() functions are likely to be

Re: Select hangs after some reads

2006-06-08 Thread Jon Ribbens
In article [EMAIL PROTECTED], Steve Holden wrote: Of course, if the client forces the TCP PSH flag true then the receiver is guaranteed to debuffer the stream up to that point - this is how FTP clients work, for example. I don't think that's right. You are confusing the PSH flag (which is

Re: Select hangs after some reads

2006-06-08 Thread Jon Ribbens
In article [EMAIL PROTECTED], Steve Holden wrote: I don't think that's right. You are confusing the PSH flag (which is basically unused in Unix networking I think) and the URG flag (which is extremely rarely used, but is indeed used by FTP to get abort requests to 'jump the queue' as it were).

Re: 2.5 excitement (was Re: Java Developer Exploring Python)

2006-04-19 Thread Jon Ribbens
In article [EMAIL PROTECTED], Chris Lambacher wrote: At least on windows. PySqlite is statically linked with the sqlite library. This can be done because it is quite small. OK, well that makes sense, but why not on any other platform? -- http://mail.python.org/mailman/listinfo/python-list

Re: 2.5 excitement (was Re: Java Developer Exploring Python)

2006-04-19 Thread Jon Ribbens
In article [EMAIL PROTECTED], Fredrik Lundh wrote: Apologies if I'm being obtuse, but how does including the pysqlite wrapper module change anything? You still need to download and install SQLite I'm pretty sure the distributors will do this for you, just as they've included zlib, dbm,

Re: 2.5 excitement (was Re: Java Developer Exploring Python)

2006-04-19 Thread Jon Ribbens
In article [EMAIL PROTECTED], Fredrik Lundh wrote: these days, most end users get their Python either with their OS, or by downloading a prebuilt installer. Oh, ok. I've just never heard such people referred to as the distributors before. It sounds like some sort of TV series! ;-) I guess I

Re: 2.5 excitement (was Re: Java Developer Exploring Python)

2006-04-18 Thread Jon Ribbens
In article [EMAIL PROTECTED], Aahz wrote: On that front, I think that pysqlite is much more important because it finally gets rid of the excuse for using Berkeley for simple database purposes. Apologies if I'm being obtuse, but how does including the pysqlite wrapper module change anything?

Re: Difference between 'is' and '=='

2006-04-03 Thread Jon Ribbens
In article [EMAIL PROTECTED], Roy Smith wrote: This may even be useful. What if you were trying to emulate SQL's NULL? NULL compares false to anything, even itself. Strictly speaking, comparing NULL to anything gives NULL, not False. -- http://mail.python.org/mailman/listinfo/python-list

Re: overloading constructor in python?

2006-04-03 Thread Jon Ribbens
In article [EMAIL PROTECTED], Alex Martelli wrote: I guess in python we use two idioms to cover most of the uses of mulltiple constructors: ... and classmethods. OK, _three_ idioms. Oh, and factory functions. Among the idioms we use are the following... Nobody expects the Spanglish

Re: How do clients(web browser) close a python CGI program that is not responding?

2006-03-28 Thread Jon Ribbens
In article [EMAIL PROTECTED], Sullivan WxPyQtKinter wrote: Hi,there. Sometimes a python CGI script tries to output great quantities of HTML responce or in other cases, it just falls into a dead loop. How could my client close that CGI script running on the server? I tried to use the STOP

Re: why isn't Unicode the default encoding?

2006-03-21 Thread Jon Ribbens
In article [EMAIL PROTECTED], Martin v. Löwis wrote: In any case, it doesn't matter what encoding the document is in: read(2) always returns two bytes. It returns *up to* two bytes. Sorry to be picky but I think it's relevant to the topic because it illustrates how it's difficult to change the

<    2   3   4   5   6   7