In article ,
Neil Hodgson wrote:
> milanj:
>
> > and all of them use native threads (python still use green threads ?)
>
>Python uses native threads.
But then it adds the global interpreter lock, which completely
undermines the utility of native threads. So yes, it uses native
threads,
In article ,
Lawrence D'Oliveiro wrote:
> In message , Ron
> Garret wrote:
>
> > Python 2.6.2 on OS X 10.5.7:
>
> Same result, Python 2.6.1-3 on Debian Unstable. My $LANG is en_NZ.UTF-8.
>
> > ... I always thought one of the fundamental
> > invaria
Python 2.6.2 on OS X 10.5.7:
[...@mickey:~]$ echo $LANG
en_US.UTF-8
[...@mickey:~]$ cat frob.py
#!/usr/bin/env python
print u'\u03BB'
[...@mickey:~]$ ./frob.py
ª
[...@mickey:~]$ ./frob.py > foo
Traceback (most recent call last):
File "./frob.py", line 2, in
print u'\u03BB'
UnicodeEncodeE
I'm trying to build PyObjC on an Intel Mac running OS X 10.5.7. The
build is breaking because distutils seems to want to build extension
modules as universal binaries, but some of the libraries it depends on
are built for intel-only, i.e.:
[...@mickey:~/Desktop/pyobjc-framework-ScreenSaver-2.2
In article <499f397c.7030...@v.loewis.de>,
"Martin v. Löwis" wrote:
> > Yes, I know that. But every concrete representation of a unicode string
> > has to have an encoding associated with it, including unicode strings
> > produced by the Python parser when it parses the ascii string "u'\xb5'"
In article <499f3a8f.9010...@v.loewis.de>,
"Martin v. Löwis" wrote:
> > u'\xb5'
> >> u'\xb5'
> > print u'\xb5'
> >> ?
> >
> > Unicode literals are *in the source file*, which can only have one
> > encoding (for a given source file).
> >
> >> (That last character shows up as a micron si
In article <499f18bd$0$31879$9b4e6...@newsspool3.arcor-online.net>,
Stefan Behnel wrote:
> Ron Garret wrote:
> > I would have thought that the answer would be: the default encoding
> > (duh!) But empirically this appears not to be the case:
> >
> >>&g
In article <499f0cf0.8070...@v.loewis.de>,
"Martin v. Löwis" wrote:
> MRAB wrote:
> > Thorsten Kampe wrote:
> >> * Ron Garret (Thu, 19 Feb 2009 18:57:13 -0800)
> >>> I'm writing a little wiki that I call µWiki. That's a lowercase
>
I would have thought that the answer would be: the default encoding
(duh!) But empirically this appears not to be the case:
>>> unicode('\xb5')
Traceback (most recent call last):
File "", line 1, in
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb5 in position 0:
ordinal not in range(
In article ,
MRAB wrote:
> Thorsten Kampe wrote:
> > * Ron Garret (Thu, 19 Feb 2009 18:57:13 -0800)
> >> I'm writing a little wiki that I call µWiki. That's a lowercase Greek
> >> mu at the beginning (it's pronounced micro-wiki).
> >
&g
I'm writing a little wiki that I call µWiki. That's a lowercase Greek
mu at the beginning (it's pronounced micro-wiki). It's working, except
that I can't actually enter the name of the wiki into the wiki itself
because the default unicode encoding on my Python installation is
"ascii". So I'm
In article ,
Albert Hopkins wrote:
> On Thu, 2009-02-19 at 10:55 -0800, Ron Garret wrote:
> > I'm trying to split a CamelCase string into its constituent components.
> > This kind of works:
> >
> > >>> re.split('[a-z][A-Z]', 'fooBar
In article ,
"andrew cooke" wrote:
> i wonder what fraction of people posting with "bug?" in their titles here
> actually find bugs?
IMHO it ought to be an invariant that len(r.split(s)) should always be
one more than len(r.findall(s)).
> anyway, how about:
>
> re.findall('[A-Z]?[a-z]*', 'fo
In article ,
Peter Otten <__pete...@web.de> wrote:
> Ron Garret wrote:
>
> > I'm trying to split a CamelCase string into its constituent components.
>
> How about
>
> >>> re.compile("[A-Za-z][a-z]*").findall("fooBarBaz")
> [
In article ,
MRAB wrote:
> Ron Garret wrote:
> > I'm trying to split a CamelCase string into its constituent components.
> > This kind of works:
> >
> >>>> re.split('[a-z][A-Z]', 'fooBarBaz')
> > ['fo', 'a
I'm trying to split a CamelCase string into its constituent components.
This kind of works:
>>> re.split('[a-z][A-Z]', 'fooBarBaz')
['fo', 'a', 'az']
but it consumes the boundary characters. To fix this I tried using
lookahead and lookbehind patterns instead, but it doesn't work:
>>> re.spli
In article <498de947$0$24412$426a7...@news.free.fr>,
Bruno Desthuilliers wrote:
> Ron Garret a écrit :
> > In article ,
> > Chris Rebert wrote:
> >
> >> On Thu, Feb 5, 2009 at 12:52 PM, Ron Garret wrote:
> >>> Is there any? Where is it? Ex
In article ,
Chris Rebert wrote:
> On Thu, Feb 5, 2009 at 12:52 PM, Ron Garret wrote:
> > Is there any? Where is it? Extensive Googling has proven fruitless.
>
> It's not a standard Python exception. A third-party library you're
> using must be raising it. Check
Is there any? Where is it? Extensive Googling has proven fruitless.
Thanks,
rg
--
http://mail.python.org/mailman/listinfo/python-list
In article ,
"Gabriel Genellina" wrote:
> En Mon, 02 Feb 2009 06:59:16 -0200, Ron Garret
> escribió:
>
> > I'm running the following WSGI app under Yaro:
> >
> > def error(req):
> > try:
> > req.non_existent_key
> > e
I'm running the following WSGI app under Yaro:
def error(req):
try:
req.non_existent_key
except:
try:
return cgitb.html(sys.exc_info())
except:
return 'foo'
The result of running this is 'foo'. In other words, the reference to
the non-existent key generates an except
In article
<63cf7deb-f15c-4259-aa24-1b8da8468...@r41g2000prr.googlegroups.com>,
Graham Dumpleton wrote:
> On Jan 30, 11:01 am, Ron Garret wrote:
> > In article ,
> > Joshua Kugler wrote:
> >
> > > Ron Garret wrote:
> > > > My question is:
In article
<146f6796-37b5-4220-bdb1-5119cb3ac...@z6g2000pre.googlegroups.com>,
Graham Dumpleton wrote:
> On Jan 30, 9:53 am, Ron Garret wrote:
> > In article <498171a5$0$3681$426a7...@news.free.fr>,
> > Bruno Desthuilliers
> >
> > wrote:
> &
In article ,
Joshua Kugler wrote:
> Ron Garret wrote:
> > My question is: is this supposed to be happening? Or is this an
> > indication that something is wrong, and if so, what?
>
> You are probably just hitting a different instance of Apache, thus the
> different
In article ,
Ron Garret wrote:
> I'm running mod_wsgi under apache (on Debian etch so it's a somewhat out
> of date version, though I doubt that has anything to do with this issue).
>
> I have a little test page that displays the process ID under which my
> app is
I'm running mod_wsgi under apache (on Debian etch so it's a somewhat out
of date version, though I doubt that has anything to do with this issue).
I have a little test page that displays the process ID under which my
app is running, and some global state, so I can tell when the wsgi app
gets re
In article <498170d4$0$23718$426a7...@news.free.fr>,
Bruno Desthuilliers
wrote:
> Ron Garret a écrit :
> > I'm running a WSGI app under apache/mod_wsgi and I've noticed that
> > whenever I restart the server after making a code change it takes a very
> >
In article <498171a5$0$3681$426a7...@news.free.fr>,
Bruno Desthuilliers
wrote:
> Ron Garret a écrit :
> > In article ,
> > Aleksandar Radulovic wrote:
> (snip)
> >> Secondly, why are you restarting apache after code changes? In normal
> >> ci
In article
<4cd232ff-ba8b-47aa-8ee6-d8d9712db...@s1g2000prg.googlegroups.com>,
Graham Dumpleton wrote:
> On Jan 29, 8:35 am, Ron Garret wrote:
> > I'm running a WSGI app under apache/mod_wsgiand I've noticed that
> > whenever I restart the server after makin
In article ,
Jean-Paul Calderone wrote:
> On Wed, 28 Jan 2009 13:35:56 -0800, Ron Garret wrote:
> >I'm running a WSGI app under apache/mod_wsgi and I've noticed that
> >whenever I restart the server after making a code change it takes a very
> >long time (like
In article ,
Aleksandar Radulovic wrote:
> Hi there,
>
> On Wed, Jan 28, 2009 at 9:35 PM, Ron Garret wrote:
> > I'm running a WSGI app under apache/mod_wsgi and I've noticed that
>
> Off the bat, there's no reason to run an app under apache/mod_wsgi
&
I'm running a WSGI app under apache/mod_wsgi and I've noticed that
whenever I restart the server after making a code change it takes a very
long time (like a minute) before the script is active again. In other
words, I do an apachectl restart, reload the page in my browser, and one
minute late
Consider the following wsgi app:
def application(env, start_response):
start_response('200 OK',[('Content-type','text/plain')])
yield "hello"
x=1/0
yield "world"
The result of this is that the web browser displays "hello" and an error
message ends up in the web log. But there is no othe
I'm selecting infrastructure for a web development and I've found two
lightweight frameworks that seem to offer a lot of bang-for-the-byte:
Yaro and WebOb. I'm wondering if anyone here has used either or both
and has opinions about them. What has been your experience with them?
Which do you
On Jan 18, 1:21 pm, Graham Dumpleton
wrote:
> On Jan 19, 6:01 am, Ron Garret wrote:
>
> > I'm writing a WSGI application and I would like to check the content-
> > length header before reading the content to make sure that the content
> > is not too big in order
On Jan 18, 12:40 pm, "Diez B. Roggisch" wrote:
> Ron Garret schrieb:
>
>
>
> > On Jan 18, 11:29 am, "Diez B. Roggisch" wrote:
> >> Ron Garret schrieb:
>
> >>> I'm writing a WSGI application and I would like to check the conten
On Jan 18, 11:43 am, Petite Abeille wrote:
> On Jan 18, 2009, at 8:01 PM, Ron Garret wrote:
>
> > def application(environ, start_response):
> > status = "200 OK"
> > headers = [('Content-Type', 'text/html'), ]
> > start_res
On Jan 18, 11:29 am, "Diez B. Roggisch" wrote:
> Ron Garret schrieb:
>
>
>
> > I'm writing a WSGI application and I would like to check the content-
> > length header before reading the content to make sure that the content
> > is not too big in orde
I'm writing a WSGI application and I would like to check the content-
length header before reading the content to make sure that the content
is not too big in order to prevent denial-of-service attacks. So I do
something like this:
def application(environ, start_response):
status = "200 OK"
So I have a MoinMoin installation running as a cgi and also under wsgi.
Since I was on a roll I decided to press my luck and try running it
under scgi. Following a suggestion in the following article:
http://www.linuxjournal.com/article/9310
I wrote this little server adapter:
from MoinMo
In article
,
Graham Dumpleton wrote:
> On Dec 28, 7:22 pm, Ron Garret wrote:
> > In article ,
> > Ron Garret wrote:
> >
> >
> >
> > > I successfully installed MoinMoin as a CGI according to the instructions
> > > on the moinmo.in s
In article ,
Ron Garret wrote:
> I successfully installed MoinMoin as a CGI according to the instructions
> on the moinmo.in site. But when I tried to switch over to running it
> under wsgi it failed thusly:
>
> [Sat Dec 27 21:44:14 2008] [error] [client 66.214.189.2]
I successfully installed MoinMoin as a CGI according to the instructions
on the moinmo.in site. But when I tried to switch over to running it
under wsgi it failed thusly:
[Sat Dec 27 21:44:14 2008] [error] [client 66.214.189.2] Traceback (most
recent call last):
[Sat Dec 27 21:44:14 2008] [err
In article <[EMAIL PROTECTED]>,
"Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> foolib = cdll.LoadLibrary('foo.so')
> foolib.foo(0xF)
> > 0
>
> Shouldn't you tell ctypes that the argument and the result
> of foo is a pointer?
Yeah... that's it. Default return type is int, whic
CTypes on a 64-bit machine appears to be truncating pointers to 32 bits:
[EMAIL PROTECTED]:~]$ uname -a
Linux monster1 2.6.18-6-amd64 #1 SMP Mon Jun 16 22:30:01 UTC 2008 x86_64
GNU/Linux
[EMAIL PROTECTED]:~]$ cat foo.c
void* foo(void* x) { return x; }
[EMAIL PROTECTED]:~]$ gcc -fPIC -shared foo.c
In article <[EMAIL PROTECTED]>,
Michael Ströder <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
> > In article <[EMAIL PROTECTED]>,
> > Ron Garret <[EMAIL PROTECTED]> wrote:
> >
> >> In article <[EMAIL PROTECTED]>,
> >> M
In article <[EMAIL PROTECTED]>,
Ron Garret <[EMAIL PROTECTED]> wrote:
> In article <[EMAIL PROTECTED]>,
> Michael Ströder <[EMAIL PROTECTED]> wrote:
>
> > Ron Garret wrote:
> > > I'm writing a little HTTP server and need to parse reque
In article <[EMAIL PROTECTED]>,
Michael Ströder <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
> > I'm writing a little HTTP server and need to parse request content that
> > is mime-encoded. All the MIME routines in the Python standard library
> > see
In article
<[EMAIL PROTECTED]>,
[EMAIL PROTECTED] wrote:
> On Jul 3, 3:59 pm, Ron Garret <[EMAIL PROTECTED]> wrote:
> > I'm writing a little HTTP server and need to parse request content that
> > is mime-encoded. All the MIME routines in the Python standa
I'm writing a little HTTP server and need to parse request content that
is mime-encoded. All the MIME routines in the Python standard library
seem to have been subsumed into the email package, which makes this
operation a little awkward. It seems I have to do the following:
1. Extract the co
In article <[EMAIL PROTECTED]>,
Peter Otten <[EMAIL PROTECTED]> wrote:
> If all else fails there's
>
> >>> sys.setdefaultencoding("latin1")
> >>> "Andre\xe9 Ramel".decode()
> u'Andre\xe9 Ramel'
>
> but that's an evil hack, you should rather talk to the maintainer of the
> offending code to upda
Is there a way to change the default string encoding used by the
string.encode() method? My default environment is utf-8 but I need it
to be latin-1 to avoid errors like this:
>>> 'Andr\xe9 Ramel'.decode()
Traceback (most recent call last):
File "", line 1, in
UnicodeDecodeError: 'a
In article <[EMAIL PROTECTED]>,
Stargaming <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
> > The wsgiref module in Python 2.5 seems to be empty:
> >
> > [EMAIL PROTECTED]:~/Sites/modpy]$ python
> > Python 2.5 (r25:51908, Mar 1 2007, 10:09:05)
> >
The wsgiref module in Python 2.5 seems to be empty:
[EMAIL PROTECTED]:~/Sites/modpy]$ python
Python 2.5 (r25:51908, Mar 1 2007, 10:09:05)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import wsgiref
>>> dir(wsgi
In article <[EMAIL PROTECTED]>,
Donn Cave <[EMAIL PROTECTED]> wrote:
> In article <[EMAIL PROTECTED]>,
> Ron Garret <[EMAIL PROTECTED]> wrote:
>
> > The answer is obvious: select is looking only at the underlying socket,
> > and not at the rfile bu
In article <[EMAIL PROTECTED]>,
Jean-Paul Calderone <[EMAIL PROTECTED]> wrote:
> Twisted does this out of the box, for what it's worth.
Thanks. I will look at that.
rg
--
http://mail.python.org/mailman/listinfo/python-list
In article <[EMAIL PROTECTED]>,
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
> En Mon, 23 Apr 2007 04:33:22 -0300, Ron Garret <[EMAIL PROTECTED]>
> escribió:
>
> > I have not been able to find a proxy server that can proxy to unix
> > socket
In article <[EMAIL PROTECTED]>,
Irmen de Jong <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
> > I don't understand why socketserver calling select should matter. (And
> > BTW, there are no calls to select in SocketServer.py. I'm using
> > Python
In article <[EMAIL PROTECTED]>,
Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> Well, on WinXP, Python 2.4, with
I should have specified: I'm running 2.5 on unix. (I've reproduced the
problem on both Linux and OS X.)
rg
--
http://mail.python.org/mailman/listinfo/python-list
In article <[EMAIL PROTECTED]>,
Erik Max Francis <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
>
> > Geez you people are picky. Since I ran this several times I ran into
> > the TIM_WAIT problem. Here's the actual transcript:
>
> It's not abou
In article <[EMAIL PROTECTED]>,
Erik Max Francis <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
>
> > So this is clearly a bug, but surely I'm not the first person to have
> > encountered this? Is there a known workaround?
>
> It's hard to see
In article <[EMAIL PROTECTED]>,
Ron Garret <[EMAIL PROTECTED]> wrote:
> The answer is obvious: select is looking only at the underlying socket,
> and not at the rfile buffers.
Here is conclusive proof that there's a bug in select:
from socket import *
from select
I think I've figured out what's going on.
First, here's the smoking gun: I changed the code as follows:
class myHandler(StreamRequestHandler):
def handle(self):
print '>>>'
while 1:
sl = select([self.rfile],[],[],1)[0]
print sl
l = self.rfile.readline()
i
In article <[EMAIL PROTECTED]>,
Ron Garret <[EMAIL PROTECTED]> wrote:
> Here's my code. It's a teeny weeny little HTTP server. (I'm not really
> trying to reinvent the wheel here. What I'm really doing is writing a
> dispatching proxy server, but t
In article <[EMAIL PROTECTED]>,
Irmen de Jong <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
> > Here's my code. It's a teeny weeny little HTTP server. (I'm not really
> > trying to reinvent the wheel here. What I'm really doing is writing a
In article <[EMAIL PROTECTED]>,
Bjoern Schliessmann <[EMAIL PROTECTED]>
wrote:
> > The only difference I can discern is that the browser send \r\n
> > for end-of-line while telnet just sends \n.
...
> > But I don't see why that should make any difference.
>
> Easy. If you only accept "\r\n
Here's my code. It's a teeny weeny little HTTP server. (I'm not really
trying to reinvent the wheel here. What I'm really doing is writing a
dispatching proxy server, but this is the shortest way to illustrate the
problem I'm having):
from SocketServer import *
from socket import *
from sele
In article <[EMAIL PROTECTED]>,
"Luis M. González" <[EMAIL PROTECTED]> wrote:
> On Apr 13, 8:44 pm, Ron Garret <[EMAIL PROTECTED]> wrote:
> > In article <[EMAIL PROTECTED]>,
> > Ron Garret <[EMAIL PROTECTED]> wrote:
> >
> >
In article <[EMAIL PROTECTED]>,
Ron Garret <[EMAIL PROTECTED]> wrote:
> Does
> anyone know of a straightforward way to get Apache to "forward" requests
> to a given path to another HTTP server running on a different port?
Never mind, I think I figured it out.
I have a fairly large web app written in Python as a CGI fairly
elaborate CGI. All of the requests go through a single CGI script which
does authentication and session management and then dispatches to one of
a number of handlers that generate the various pages.
There is one page that is a per
In article <[EMAIL PROTECTED]>,
Robert Kern <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
> > In article <[EMAIL PROTECTED]>,
> > Robert Kern <[EMAIL PROTECTED]> wrote:
>
> >> Note that in recent versions of Python, I believe that the pythonw
In article <[EMAIL PROTECTED]>,
Robert Kern <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
> > I'm trying to run the Python examples distributed with XCode and they
> > all give me the same error:
> >
> > Traceback (most recent call last):
> >
I'm trying to run the Python examples distributed with XCode and they
all give me the same error:
Traceback (most recent call last):
File "checktext.py", line 35, in
main()
File "checktext.py", line 8, in main
pathname = EasyDialogs.AskFileForOpen(message='File to check
end-of-lines
In article <[EMAIL PROTECTED]>,
James Stroud <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
> > In article <[EMAIL PROTECTED]>,
> > James Stroud <[EMAIL PROTECTED]> wrote:
> >
> >>Is LD_LIBRARY_PATH pointing to the directory libreadline.dyl
In article <[EMAIL PROTECTED]>,
James Stroud <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
> > I have installed Python 2.5 on my new Intel Mac but I can't for the life
> > of me get readline to work. I have libreadline installed, I've tried
>
In article <[EMAIL PROTECTED]>,
Irmen de Jong <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
> > I have installed Python 2.5 on my new Intel Mac but I can't for the life
> > of me get readline to work. I have libreadline installed, I've tried
>
I have installed Python 2.5 on my new Intel Mac but I can't for the life
of me get readline to work. I have libreadline installed, I've tried
copying readline.so from my Python 2.3 installation into 2.5, I've
searched the web, and no joy. Could someone please give me a clue?
rg
--
http://mai
In article <[EMAIL PROTECTED]>,
"Michele Simionato" <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
> > One of the things I find annoying about Python is that when you make a
> > change to a method definition that change is not reflected in existing
> >
In article <[EMAIL PROTECTED]>,
"Carl Banks" <[EMAIL PROTECTED]> wrote:
> The principle behind this is pretty much "it was just a language design
> decision".
Yes, and I'm not taking issue with the decision, just pointing out that
the desire to do things differently is not necessarily perverse.
In article <[EMAIL PROTECTED]>,
"Michele Simionato" <[EMAIL PROTECTED]> wrote:
> Duncan Booth wrote:
> > Ron Garret <[EMAIL PROTECTED]> wrote:
> >
> > > I want to say:
> > >
> > > trace(c1.m1)
> > >
> > > an
In article <[EMAIL PROTECTED]>,
Kent Johnson <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
> > The reason I want to do this is that I want to implement a trace
> > facility that traces only specific class methods. I want to say:
> >
> > trace(c1.m1)
>
If I do this:
def f(self): print self
class c1: pass
setattr(c1, 'm1', f)
Then f is automagically transmogrified into the appropriate sort of
method depending on how it is used:
>>> c1.m1
>>> c1().m1
>
>>> c1().m1()
<__main__.c1 instance at 0x51ec60>
Note that m1 gets passed a self argument
In article <[EMAIL PROTECTED]>,
"Paul McGuire" <[EMAIL PROTECTED]> wrote:
> "Carl Banks" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> >
> > A straightforward, Pythonic way to do it would be to create an
> > intermediate representation that understands both the existing class
>
In article <[EMAIL PROTECTED]>,
Ron Garret <[EMAIL PROTECTED]> wrote:
> In article <[EMAIL PROTECTED]>,
> "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote:
>
> > "Ron Garret" <[EMAIL PROTECTED]> wrote:
> >
> >
>
In article <[EMAIL PROTECTED]>,
"Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote:
> "Ron Garret" <[EMAIL PROTECTED]> wrote:
>
>
> >
> > One of the things I find annoying about Python is that when you make a
> > change to a method
In article <[EMAIL PROTECTED]>,
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> Ron Garret schrieb:
> > One of the things I find annoying about Python is that when you make a
> > change to a method definition that change is not reflected in existing
>
One of the things I find annoying about Python is that when you make a
change to a method definition that change is not reflected in existing
instances of a class (because you're really defining a new class when
you reload a class definition, not actually redefining it). So I came
up with thi
In article <[EMAIL PROTECTED]>,
Larry Bates <[EMAIL PROTECTED]> wrote:
> Because datetime is a new-style class:
Ah.
> The Constructor __new__
>
> If you are like me, then you probably always thought of the __init__ method
> as
> the Python equivalent of what is called a constructor in C++. Th
Python 2.3.5 (#1, Jan 30 2006, 13:30:29)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1819)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from datetime import datetime
>>> class ts(datetime):
... def __init__(self): pass
...
>>> ts()
Traceback (most rece
In article <[EMAIL PROTECTED]>,
Steve Holden <[EMAIL PROTECTED]> wrote:
> I wouldn't necessarily say you are wrong here, It's just that the cgi
> module has sort of "just growed", so it isn't conveniently factyored for
> reusability in other contexts. Several people (including me) have taken
>
In article <[EMAIL PROTECTED]>,
Damjan <[EMAIL PROTECTED]> wrote:
> >> But basically, you aren't providing a CGI environment, and that's why
> >> cgi.parse() isn't working.
> >
> > Clearly. So what should I be doing?
>
> Probably you'll need to read the source of cgi.parse_qs (like Steve did)
In article <[EMAIL PROTECTED]>,
Kent Johnson <[EMAIL PROTECTED]> wrote:
> Steve Holden wrote:
> > Ron Garret wrote:
> >> In article <[EMAIL PROTECTED]>,
> >> Steve Holden <[EMAIL PROTECTED]> wrote:
> >>
> >>
> &
In article <[EMAIL PROTECTED]>,
Steve Holden <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
> > In article <[EMAIL PROTECTED]>,
> > Steve Holden <[EMAIL PROTECTED]> wrote:
> >
> >
> >>But basically, you aren't providing
In article <[EMAIL PROTECTED]>,
Steve Holden <[EMAIL PROTECTED]> wrote:
> But basically, you aren't providing a CGI environment, and that's why
> cgi.parse() isn't working.
Clearly. So what should I be doing? Surely I'm not the first person to
have this problem?
I have managed to work aroun
In article <[EMAIL PROTECTED]>,
Steve Holden <[EMAIL PROTECTED]> wrote:
> The normal way is
>
> s = cgi.parse()
>
> since the CGI script sees the client network socket (after consumption
> of HTTP headers) as its standard input.
Doesn't work. (I even tried sys.stdin=r.rfile; s=cgi.parse())
I'm trying to figure out how to use BaseHTTPServer. Here's my little
test app:
=
#!/usr/bin/python
from BaseHTTPServer import *
import cgi
class myHandler(BaseHTTPRequestHandler):
def do_GET(r):
s = ''
try:
s = cgi.parse_qs(r.rfile.read(int(r.
I'm write a web server using BaseHTTPServer. It can't be a CGI because
it has to do some weird server-push stuff as database updates come in.
But I still need to process form inputs as if it were a CGI. But the
cgi module only works in a CGI environment. Is there something with the
equivale
In article <[EMAIL PROTECTED]>,
"Marshall" <[EMAIL PROTECTED]> wrote:
> The conversation I would *really* like to have is the one where we
> discuss what all the differences are, functionally, between the two,
> and what the implications of those differences are, without trying
> to address which
In article <[EMAIL PROTECTED]>,
"Serge Orlov" <[EMAIL PROTECTED]> wrote:
> Serge Orlov wrote:
> > Ron Garret wrote:
> > > In article <[EMAIL PROTECTED]>,
> > > "Serge Orlov" <[EMAIL PROTECTED]> wrote:
> > >
>
In article <[EMAIL PROTECTED]>,
"Serge Orlov" <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
> > In article <[EMAIL PROTECTED]>,
> > "Serge Orlov" <[EMAIL PROTECTED]> wrote:
> >
> > > Ron Garret wrote:
> > >
1 - 100 of 139 matches
Mail list logo