Re: Third party script debugging on remote server ...

2007-04-18 Thread Graham Dumpleton
After calling whatever it is that is writing to standard output/error, do: import sys sys.stdout.flush() sys.stderr.flush() This should cause any buffered data to be immediately flushed to the main Apache error log, ie., don't look in any virtual host logs, check the main one. Graha

Re: Third party script debugging on remote server ...

2007-04-18 Thread Graham Dumpleton
you anything as this trick is only needed with mod_python. All the functions do is force the output of any buffered data that was written out previously. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: python cgi problem with textarea

2007-04-22 Thread Graham Dumpleton
;s looked at it, but it > > doesn't work for me here in Japan. > > i just tried it and its working. here it is > > http://yallara.cs.rmit.edu.au/~bevcimen/form.html > > maybe the internal server error is because mod_python isn't installed > assuming your using Apache as your web server You do not need mod_python installed to be able to run CGI scripts, thus has nothing to do with mod_python. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: re-importing modules

2007-04-30 Thread Graham Dumpleton
oken Getting module importing with reloading working is frightfully tricky in an application where multiple threads corresponding to concurrent web requests are executing as one can't be reloading on top of modules where code may be executing, one must also avoid triggering a reload of a specifi

Re: re-importing modules

2007-04-30 Thread Graham Dumpleton
On May 1, 3:51 pm, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > Graham Dumpleton <[EMAIL PROTECTED]> writes: > > That it doesn't reload a parent when a child changes may be fine in an > > interactive debugger, but can cause problems if not done where > >

Re: WSGI spec clarification regarding exceptions

2007-05-09 Thread Graham Dumpleton
ld be large or take some time to produce. Anyway, for WSGI matters, you are probably better off bringing them up on the Python WEB-SIG list. http://www.python.org/community/sigs/current/web-sig/ Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: WSGI spec clarification regarding exceptions

2007-05-09 Thread Graham Dumpleton
On May 10, 12:07 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On May 10, 8:26 am, Adam Atlas <[EMAIL PROTECTED]> wrote: > > > I'm trying to figure out if there's any defined behaviour in PEP 333 > > for instances where an application returns an itera

Re: Is wsgi ready for prime time?

2007-05-17 Thread Graham Dumpleton
lib would be nice. > As google uses it (mod_wsgi), I would suspect you can use it. So people don't get the wrong impression, mod_wsgi is merely hosted on the Google code site. This does not mean that Google uses it, nor does Google have anything to do with its development. Graham --

Re: Is wsgi ready for prime time?

2007-05-17 Thread Graham Dumpleton
lib would be nice. > As google uses it (mod_wsgi), I would suspect you can use it. So people don't get the wrong impression, mod_wsgi is merely hosted on the Google code site. This does not mean that Google uses it, nor does Google have anything to do with its development. Graham --

Re: mod_python performs several magnitudes slower than PHP?

2007-05-19 Thread Graham Dumpleton
le for comparison would have been: def handler(req): for i in xrange(1000): req.write('Yeah\n, 0) return apache.OK The second argument of 0 to req.write() will allow Apache to buffer data in an appropriate way and avoid lots of socket writes with small amounts of data, plus avoid triggering of Apache's filter mechanism every time. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: mod_python performs several magnitudes slower than PHP?

2007-05-21 Thread Graham Dumpleton
On May 21, 5:51 pm, Winfried Tilanus <[EMAIL PROTECTED]> wrote: > On 05/20/2007 Graham Dumpleton wrote: > > Hi, > > > A more suitable example for comparison would have been: > > And are there any benchmarks with this new version available? Just > curious... Unless

Re: need advice on building core code for python and PHP

2007-05-24 Thread Graham Dumpleton
instead. In doing this your back end Python server doesn't have to change, you just make XML-RPC calls from the Python code for the web pages in place of where you would be doing it with PHP initially. You also wouldn't be restricted to web based front ends, you could also use GUI based front end as well. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: need advice on building core code for python and PHP

2007-05-29 Thread Graham Dumpleton
On May 30, 11:24 am, digimotif <[EMAIL PROTECTED]> wrote: > On May 24, 5:01 pm, Graham Dumpleton <[EMAIL PROTECTED]> > wrote: > > > > > On May 25, 5:24 am, aspineux <[EMAIL PROTECTED]> wrote: > > > > On 24 mai, 19:33, Szabolcs Nagy <[EMAIL PROT

Re: Installing mod_python on mac os 10.4.7

2007-07-29 Thread Graham Dumpleton
On Jul 29, 7:26 am, 7stud <[EMAIL PROTECTED]> wrote: > On Jul 14, 8:34 pm, Graham Dumpleton <[EMAIL PROTECTED]> > wrote: > > > > > On Jul 15, 10:06 am, Graham Dumpleton <[EMAIL PROTECTED]> > > wrote: > > > > On Jul 15, 2:47 am, 7stud <

Re: Installing mod_python on mac os 10.4.7

2007-07-29 Thread Graham Dumpleton
On Jul 30, 2:37 am, 7stud <[EMAIL PROTECTED]> wrote: > On Jul 29, 4:07 am, Graham Dumpleton <[EMAIL PROTECTED]> > wrote: > > > Have you got an appropriate LoadModule directive in Apache > > configuration to load the mod_python module? That you get this error >

Re: Destruction of generator objects

2007-08-08 Thread Graham Dumpleton
ow if body was empty finally: if hasattr(result,'close'): result.close() That the consumer called close() allowed generators to provide a close() method to cleanup resources even though older version of Python was being used which didn't support automatic means

Re: some import / namespace questions

2007-08-08 Thread Graham Dumpleton
s/2.3/lib/python2.3/lib-dynload/_ssl.so import errno # builtin Output goes to standard error. There can be quite a lot, so you may want to redirect standard error to a file. Graham -- http://mail.python.org/mailman/listinfo/python-list

Overriding Thread.join in derived class.

2007-08-18 Thread Graham Dumpleton
a C program. There is no Python main function where code can be put to signal threads to otherwise stop. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Overriding Thread.join in derived class.

2007-08-20 Thread Graham Dumpleton
On Aug 20, 5:40 am, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > On 18 ago, 04:31, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > > > > > If one creates a thread using threading.Thread and makes it a daemon > > by calling setDaemon(), then when Python is exi

Re: Python error on Mac

2007-08-26 Thread Graham Dumpleton
X is 2.3.5. Unless you have specifically installed 2.5, it will not exist. So, if those applications have it hardwired to use Python 2.5 they will not work. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: some problems with mod_python

2007-08-27 Thread Graham Dumpleton
don't want to read the Apache documentation and learn more about it, at least read: http://www.dscpl.com.au/wiki/ModPython/Articles/SetHandlerVersusAddHandler Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: How to use os.putenv() ?

2007-08-29 Thread Graham Dumpleton
nstead, bypassing os.environ, the changes will not show in os.environ. To confirm that the global process environment is being updated, use os.getenv(). Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Module for mod_python

2007-09-05 Thread Graham Dumpleton
;t satisfied by the existing systems then people may be more interested in commenting. If you aren't aware of these existing systems then perhaps use Google to do some research on them first. Graham > rieh25 wrote: > > > I've been thinking about a module (actually I have it

Re: Python 3K or Python 2.9?

2007-09-11 Thread Graham Dumpleton
ting PHP focused Apache installations and which don't chew up huge amounts of additional resources, thereby forcing a reduction in their site densities. To that end, we still have a way to go. An older blog entry of mine where I have covered these problems is: http://blog.dscpl.com.au/2007/07/commodity-shared-hosting-and-modwsgi.html Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: How *extract* data from XHTML Transitional web pages? got xml.dom.minidom troubles..

2007-03-02 Thread James Graham
[EMAIL PROTECTED] wrote: > I'm trying to extract some data from an XHTML Transitional web page. > > What is best way to do this? May I suggest html5lib [1]? It's based on the parsing section of the WHATWG "HTML5" spec [2] which is in turn based on the behavior of major web browsers so it should

Re: re-point mod_python - is it possible?

2007-03-06 Thread Graham . Dumpleton
y and use Python library from 2.2. If this is the case, you need to ensure that the PATH environment used by Apache when started finds 'python' for 2.3 first. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Configuration: Apache + mod_python

2007-03-08 Thread Graham . Dumpleton
_FILENAME} !-d # Look here instead ... RewriteRule ^/images/(.*) /pics/$1 [PT] In this case it is causing lookups for images to be made in two places, but your case wouldn't be much different. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Configuration: Apache + mod_python

2007-03-08 Thread Graham . Dumpleton
ing similar to: > > > RewriteEngine On > > # If its not here ... > > RewriteCond %{REQUEST_FILENAME} !-f > > RewriteCond %{REQUEST_FILENAME} !-d > > # Look here instead ... > > RewriteRule ^/images/(.*) /pics/$1 [PT] > > >

Re: Configuration: Apache + mod_python

2007-03-09 Thread Graham Dumpleton
very good book "The Definitive Guide to Apache > > > > mod_rewrite", you can do something similar to: > > > > > RewriteEngine On > > > > # If its not here ... > > > > RewriteCond %{REQUEST_FI

Re: merits of Lisp vs Python

2007-03-10 Thread Graham Dumpleton
des a way to work around the problems with such third party C extension modules. If you feel that this is not the case and mod_python is still broken in some way, please properly explain what the problem is. PS. Yes I do know that forcing using of main interpreter in mod_python only helps solve this problem in mod_python 3.2 and later and did not help with older versions. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2007-03-14 Thread Graham Dumpleton
On Mar 15, 7:22 am, [EMAIL PROTECTED] (John J. Lee) wrote: > "Graham Dumpleton" <[EMAIL PROTECTED]> writes: > > On Mar 11, 12:31 pm, [EMAIL PROTECTED] (John J. Lee) wrote: > [...] > > >mod_pythonrelies on an unsupported feature of Python, namely > > &g

Re: Python C extension providing... Python's own API?

2007-03-26 Thread Graham Dumpleton
interpreter. Anyway, you have got my curiosity going again as to how hard it would be to write such a module. Personally I don't think it would be that hard at all and maybe when I get first version of mod_wsgi out I might have a play with the idea. :-) Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Python C extension providing... Python's own API?

2007-03-26 Thread Graham Dumpleton
On Mar 27, 12:41 pm, "Graham Dumpleton" <[EMAIL PROTECTED]> wrote: > On the other hand, it might be useful in a standalone Python based > WSGI web server which you have more direct control over. It might > take a bit of design work as to how to do it in practice, but you

Re: How to get IP address of client from CGI module?

2007-04-10 Thread Graham Dumpleton
ding the source, either. Ideas? > > John Nagle Read the CGI RFC. http://www.ietf.org/rfc/rfc3875 Specifically section 4.1.8. This value should be supplied by way of variable in os.environ as are all the CGI variables. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: lxml + mod_python: cannot unmarshal code objects in restricted execution mode

2007-09-13 Thread Graham Dumpleton
our application is a WSGI application and you aren't using mod_python specific features, only choice at this point would be to use mod_fastcgi or mod_wsgi instead. If using mod_wsgi, you would still need to tell it to run your code in first interpreter instance created by Python. WSGIApplicationGroup %{GLOBAL} For some details on issues related to this problem, see sections 'Python Simplified GIL State API' and 'Multiple Python Sub Interpreters' in mod_wsgi document: http://code.google.com/p/modwsgi/wiki/ApplicationIssues Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Python,SWIG and libjvm

2007-09-20 Thread Graham Dumpleton
ill tell you application to look in that directory for the shared library at run time. 3. If on Linux/Solaris, compile that library directory into the Python module .so by setting before you compile your Python module: LD_RUN_PATH=/home/sguha/mine/jdk1.6.0_02/jre/lib/amd64/server export LD_RUN_PATH This only needs to be done at compile time, but means your module will always expect it to be in that location. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: mod_python preprocess/filter before proxy

2007-09-27 Thread Graham Dumpleton
your questions to the official mod_python mailing list referenced on the mod_python site. Graham On Sep 27, 9:26 pm, David Sánchez Martín <[EMAIL PROTECTED]> wrote: > Hi! > > I've seen the message below in this python list, that seems to be > unanswered. > > I&#

Re: PYTHONPATH on OS X

2007-10-10 Thread Graham Dumpleton
thon2.5', '/usr/local/lib/ > python2.5/plat-darwin', '/usr/local/lib/python2.5/plat-mac', '/usr/ > local/lib/python2.5/plat-mac/lib-scriptpackages', '/usr/local/lib/ > python2.5/lib-tk', '/usr/local/lib/python2.5/lib-dynload', '/usr/local/ > lib/python2.5/site-packages', '/usr/local/lib/python2.5/site-packages/ > PIL'] You need to export the environment variable. export PYTHONPATH Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Paste and WSGI 2.0 [WAS: Yet another comparison of Python Web Frameworks]

2007-10-14 Thread Graham Dumpleton
ound this where decisions would need to be made or solutions developed before one could even consider calling it a draft. I certainly wouldn't necessarily go off making decisions based on what may or may not be in WSGI 2.0. :-) Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem calling python modules from python apache handler

2007-10-16 Thread Graham Dumpleton
ur mod_python handler code file, they will not be found. Place them outside of the Apache document tree and use PythonPath directive as described in documentation to indicate where they are located. Also ensure you read documentation for import_module() in: http://www.modpython.org/live/current/do

Re: MOD_PYTHON + packages reloading

2007-10-18 Thread Graham Dumpleton
t is in 3.3 as described in documentation for import_module() is as good as it gets. As long as you work within the constraints it imposes you can go a long way, but don't expect miracles. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to tell if a script has been run by Pythonw.exe instead of Python.exe?

2007-10-18 Thread Graham Dumpleton
On Oct 19, 7:56 am, Metalone <[EMAIL PROTECTED]> wrote: > In particular I want to know how to tell if reading and writing to the > console can occur. > Something like > sys.isConsolePresent() Have you tried: sys.stdin.isatty() sys.stdout.isatty() Graham -- http://mail.

Re: Monitoring external processes

2007-10-22 Thread Graham Dumpleton
5, there is also have os.wait3() and os.wait4(). See the operating system manual pages for the difference. Ie., man wait4 Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: sys.path not properly initialized (was: PyImport_ImportModule/embedding: surprising behaviors)

2007-10-25 Thread Graham Dumpleton
dding under Windows? The problem with not finding site.py on Windows will often come up when you have gone through a cycle of installing/removing different versions of Python and the registry entries get mucked. Also can be a problem where Python was not installed as administrator originally

Re: mod_python, ElementTree and Aapche 2.0

2007-10-27 Thread Graham Dumpleton
; > Has anybody ever seen this type of behavior? Try reading: http://www.dscpl.com.au/wiki/ModPython/Articles/ExpatCausingApacheCrash Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: injecting functions into a python sandbox within a python program

2007-01-11 Thread Graham Menhennitt
plying. Some of the functions are as simple as that so I can do as you described. Some are more complicated so it doesn't work. For now I'll stick with the prepending. Thanks, Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: mod_python and Content-Type

2007-01-13 Thread Graham Dumpleton
ef handler(req): ct = req.headers_in.get('Content-Type') ... The 'content_type' attribute is set by Apache based on its determination of what the content type of the response will be based on looking at the extension type used on the matched resource specified by the URL. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: xml.dom.minidom.parseString segmentation fault on mod_python

2007-01-26 Thread Graham Dumpleton
eas? I would be > > grateful.http://www.python.org/sf/1558223http://www.python.org/sf/1295808http://www.python.org/sf/1075984 > > Try to compile all your dependencies against the same version of > Expat or upgrade to python 2.5. For further information read: http://www.dscpl.com.au/wiki/ModPython/Articles/ExpatCausingApacheCrash Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Python does not play well with others

2007-02-04 Thread Graham Dumpleton
e to it and that as far as I know is also going to be an issue for other language systems for Apache such as PHP or mod_perl. Having said all that, perhaps those who are complaining about lack of support for specific features in mod_python can now clarify what actually you are talking about. At the m

Re: Python does not play well with others

2007-02-04 Thread Graham Dumpleton
On Feb 5, 9:45 am, John Nagle <[EMAIL PROTECTED]> wrote: > Graham Dumpleton wrote: > > On Feb 4, 1:05 pm, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > > >>"Paul Boddie" <[EMAIL PROTECTED]> writes: > > >>>Probably the biggest inh

Re: Python does not play well with others

2007-02-05 Thread Graham Dumpleton
On Feb 6, 4:52 am, John Nagle <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > John Nagle wrote: > > >>Graham Dumpleton wrote: > > >>>On Feb 4, 1:05 pm, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > > >>>>"Paul Bodd

Re: Python does not play well with others

2007-02-05 Thread Graham Dumpleton
t; implementation that's unlikely to be fixed earlier than 3.0. No such limitation exists with mod_python as it does all the interpreter creation and management at the Python C API level. The one interpreter per process limitation is only when using the standard 'python' runtime executable and you are doing everything in Python code. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Python does not play well with others

2007-02-05 Thread Graham Dumpleton
On Feb 6, 8:57 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Feb 5, 12:52 pm, John Nagle <[EMAIL PROTECTED]> wrote: > > > > > [EMAIL PROTECTED] wrote: > > > John Nagle wrote: > > > >>Graham Dumpleton wrote: > &g

Re: Python does not play well with others

2007-02-05 Thread Graham Dumpleton
On Feb 6, 9:15 am, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > "Graham Dumpleton" <[EMAIL PROTECTED]> writes: > > Yes, these per VirtualHost interpreter instances will only be created > > on demand in the child process when a request arrives which > >

Re: Python does not play well with others

2007-02-05 Thread Graham Dumpleton
On Feb 6, 10:15 am, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > "Graham Dumpleton" <[EMAIL PROTECTED]> writes: > > There is also much more possibility for code, if it runs up extra > > threads, to interfere with the operation of the Apache parent process. &g

Re: Python web frameworks

2007-11-20 Thread Graham Dumpleton
going on that doesn't involve Python code nor the GIL, for example initial request process and serving up of static files etc. Result is that the Python GIL is no impediment when using Apache on UNIX to making good use of multiple processors or cores, even when Apache worker MPM is used. Fo

Re: Python web frameworks

2007-11-20 Thread Graham Dumpleton
On Nov 21, 1:37 pm, BartlebyScrivener <[EMAIL PROTECTED]> wrote: > On Nov 20, 3:39 pm, Graham Dumpleton <[EMAIL PROTECTED]> > wrote: > > > This only holds if actually hosted on Apache. As Django these days > > supports WSGI interface there is nothing to stop it

Re: Python web frameworks

2007-11-22 Thread Graham Dumpleton
On Nov 23, 4:00 am, Istvan Albert <[EMAIL PROTECTED]> wrote: > On Nov 21, 12:15 am, Graham Dumpleton <[EMAIL PROTECTED]> > wrote: > > > I would say that that is now debatable. Overall mod_wsgi is probably a > > better package in terms of what it has to offer. O

Running unmodified CGI scripts persistently under mod_wsgi.

2007-11-24 Thread Graham Dumpleton
On Nov 23, 8:49 am, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Nov 23, 4:00 am, Istvan Albert <[EMAIL PROTECTED]> wrote: > > > > > On Nov 21, 12:15 am, Graham Dumpleton <[EMAIL PROTECTED]> > > wrote: > > > > I would say that that is now

Re: Different kinds of Import Errors

2007-11-27 Thread Graham Dumpleton
' might be changed. > > Any better solution? Perhaps check for the presence of the module in sys.modules. if (app_name + '.management') in sys.modules: raise If not there, module couldn't be found. If module there but exception occurred then some other import related error occurred. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Running unmodified CGI scripts persistently under mod_wsgi.

2007-11-28 Thread Graham Dumpleton
u are talking about is more in line with what Ian was talking about, but would still require the CGI script to be converted to work with SCGI directly or WSGI and then use a SCGI/WSGI adapter. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Different kinds of Import Errors

2007-11-30 Thread Graham Dumpleton
e to inspect the traceback. If the > app_name+'.management' is in it, it exists. > > Graham Dumpleton schrieb: > > > On Nov 28, 12:35 am, Thomas Guettler <[EMAIL PROTECTED]> wrote: > >> If you look at this code, you see there are two kind of ImportErrors

Re: Mod python set cookie for all subdomains

2007-12-02 Thread Graham Dumpleton
', data) > cookie.expires = time.time() + 992 > Cookie.add_cookie(req, cookie) Having created the cookie do: cookie.domain = 'domain.com' Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: weird embedding problem

2007-12-07 Thread Graham Dumpleton
ython2.5/lib-dynload/math.so: undefined symbol: > PyExc_ValueError > Failed to import math > > Any ideas of how to work around this? > > Please note - the program I'm writing *must* be built as a shared lib, so > the usual practice of 'extend, don't embed' i

Re: weird embedding problem

2007-12-08 Thread Graham Dumpleton
On Dec 7, 11:44 pm, DavidM <[EMAIL PROTECTED]> wrote: > On Fri, 07 Dec 2007 00:53:15 -0800, Graham Dumpleton wrote: > > Are you actually linking your C program against the Python library? > > Yes. Refer OP: > > >> I'm embedding python in a C prog which is buil

Re: Running unmodified CGI scripts persistently under mod_wsgi.

2007-12-08 Thread Graham Dumpleton
e this that means it may just be better to convert CGI script to work as WSGI, as more guarantee of success. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Deploying embedded Python

2007-12-17 Thread Graham Dumpleton
lation is used as source of configuration and modules. > How does > one work around/remove those dependencies? Is there any information > available about how exactly the startup works? Yes, the source code. :-) > What is being read/loaded > in which order etc? Set PYTHONVERBOSE envi

Re: More than one interpreter per process?

2007-12-18 Thread Graham Dumpleton
ich are able to cache simple Python data objects for use in multiple sub interpreters so that memory usage is reduced. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: More than one interpreter per process?

2007-12-18 Thread Graham Dumpleton
n. In theory the same should be the case for mod_python but there is currently a bug in the way that mod_python works such that some C extension modules using simplified API for the GIL still don't work even when made to run in first interpreter. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: More than one interpreter per process?

2007-12-18 Thread Graham Dumpleton
On Dec 19, 3:07 pm, Roger Binns <[EMAIL PROTECTED]> wrote: > Graham Dumpleton wrote: > > When using mod_wsgi there is no problem with C extension modules which > > use simplified GIL API provided that one configures mod_wsgi to > > delegate that specific application t

Re: Detecting memory leaks on apache, mod_python

2007-12-21 Thread Graham Dumpleton
he, to recycle Apache child processes after a set number of requests so as to restore process sizes back to a low level. So, do some research first in the correct places and then perhaps ask any additional questions in the correct place also. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: how to protect directory traversal in mod_python based custom apps

2007-12-25 Thread Graham Dumpleton
the exposed document tree, then simply move those subdirectories from the document tree outside to the additional space you have. Then refer to the files from there. If you can't do that because the document tree is all you have, then one remaining hack is to rename all the files in the subdirectories to begin with '.ht' prefix. This would generally work as default Apache configuration is to forbid access to any files starting with '.ht' prefix. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Plotting package?

2006-04-26 Thread James Graham
Andrew Koenig wrote: > This may be a foolish question, but what's the most straightforward way to > plot a bunch of data in Python? > > That is, I want to write a program that does some number crunching, and then > I want to change some parameters and watch how the changes affect the > results.

Re: python and xulrunner

2006-05-01 Thread James Graham
[EMAIL PROTECTED] wrote: > I've been trying to get xulrunner compiled with python (in windows) but > have been unsuccessful. I've been following this: > . I haven't tried it, but do the instructions at developer.mozilla.or

Nested loops confusion

2006-05-10 Thread Matthew Graham
Hi, I expect this is very obvious for anyone who knows what they're doing - but I don't understand what's the problem with the following code. I was intending that the program cycle through all i and j (ie. all possible (i,j) coordinates, but the output when I run the program shows me up to

Re: Nested loops confusion

2006-05-10 Thread Matthew Graham
Oops, I forget to reset the j after the inner loop. Always manage to work these things out just after asking for help! ;-) Matthew Graham wrote: > Hi, > > I expect this is very obvious for anyone who knows what they're doing - > but I don't understand what's the

Re: Nested loops confusion

2006-05-11 Thread Matthew Graham
Thanks very much for the advice, have tidied it up and tested and seems to be working as needed. I'm still not sure what was stopping the inner loop from working earlier - but removing the redundancy in "j=0" and so on seems to have solved it. Matt Dennis Lee Bieber wrote: > If that wor

Re: For Large Dictionaries Could One Use Separate Dictionaries Where Each Dictionary Covers an Interval of the Input Range?

2006-05-16 Thread Graham Fawcett
it doesn't matter how large the dictionary is. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: For Large Dictionaries Could One Use Separate Dictionaries Where Each Dictionary Covers an Interval of the Input Range?

2006-05-16 Thread Graham Fawcett
On 5/16/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Graham> Looking up a key in a dictionary is done in constant-time, > Graham> i.e. it doesn't matter how large the dictionary is. > > Doesn't that depend on how many keys hash to the same val

Re: Pyrex speed

2006-05-27 Thread Graham Breed
ost time in. But if that innermost function's being called from a loop it can be worth changing the loop as well so that you pass in and out C variables. HTH, Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: What is the best way to do dynamic imports ?

2007-12-30 Thread Graham Dumpleton
> > /marc If using mod_python, you should use mod_python's own dynamic module importer. See the documentation for mod_python.apache.import_module() in: http://www.modpython.org/live/current/doc-html/pyapi-apmeth.html There is no need to use __import__ directly. By using mod_python's way of doing things you

Re: Python setup not working on Windows XP

2008-01-08 Thread Graham Dumpleton
llo" is in no way going to work with mod_python. You cannot just throw an arbitrary bit of Python code in a file using 'print' statements and it will somehow magically work. You need to write your code to the mod_python APIs. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Web Interface Recommendations

2008-01-29 Thread Graham Dumpleton
kend like this also means that backend itself could be swapped out. Thus, instead of using OSE in the backend, you could use simpler XML-RPC enabled Python applications, or even use Pyro. In other words, you avoid intertwining code for front end and backend too much, thus perhaps making it easier to change and adapt as it grows. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple interpreters retaining huge amounts of memory

2008-02-02 Thread Graham Dumpleton
reters in an embedded Python application, so adding more doesn't help. Oh, it would also be nice to know exactly what embedded systems you have developed which make use of multiple sub interpreters so we can gauge with what standing you have to make such a comment. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple interpreters retaining huge amounts of memory

2008-02-03 Thread Graham Dumpleton
For example the atexit register functions being called for sub interpreters. In general what I have found is that as long as you are aware of the limitations, multiple interpreters are still usable. The one thing I would avoid is trying to recycle sub interpreters. Once they are created, only safe thing to do is to destroy them on process exit and no sooner. Otherwise you get issues that OP is seeing, but also some of the issues I describe above. Hope you have find this and the referenced document interesting. :-) Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple interpreters retaining huge amounts of memory

2008-02-03 Thread Graham Dumpleton
formation they provide isn't that good and even when you ask them to try specific things for you to test out ideas, they don't. So often one can never uncover the true problem, and it has thus become simpler to limit the source of potential problems and just tell them to avoid doing it. :-) Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple interpreters retaining huge amounts of memory

2008-02-03 Thread Graham Dumpleton
urce of potential > > problems and just tell them to avoid doing it. :-) > > You do notice that my comment in that direction (avoid using multiple > interpreters) started that subthread, right :-? I was talking about avoiding use of different versions of a C extension module in different sub interpreters, not multiple sub interpreters as a whole. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: apache/mod_wsgi daemon mode

2008-02-03 Thread Graham Dumpleton
p/modwsgi/wiki/ConfigurationIssues Since you have given a real live example error message from logs for when it goes wrong, I'll be able to include this in the documentation. That may make it easier for others to find that page when they do a Google search. At the moment the page only menti

Re: Problem with Image: Opening a file

2008-02-04 Thread Graham Dumpleton
ine 33, in > createThumb > im = Image.open(infile) > > File "/usr/lib/python2.5/site-packages/PIL/Image.py", line 1888, in > open > fp = __builtin__.open(fp, "rb") > > IOError: [Errno 2] No such file or directory: 'temp/fred.jpg' > > Richard Code under mod_python will typically run as Apache user. This means that when writing files the location you use must be writable to the Apache user. Do note though that the working directory of Apache is not guaranteed and you must always use an absolute path to the location you are saving files, you cannot reliably use relative paths like you are. BTW, do you perhaps mean '/tmp/fred.jpg'? There is no '/temp' directory on Linux boxes. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with mod_python

2008-02-17 Thread Graham Dumpleton
. You cannot just point mod_python at the Python 2.5 module directories as they are incompatible. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with mod_python

2008-02-19 Thread Graham Dumpleton
ry is used. This has in part been the fault of Python itself as build from source doesn't necessarily do that symlink. Not sure if this has changed in more recent Python versions. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: How to import custom python file in python server page (psp) ?

2008-03-14 Thread Graham Dumpleton
uot;/usr/lib/python2.5/site-packages/mod_python/psp.py", line 213, in > >> run > >>     exec code in global_scope > > >>   File "/var/www/.cyu021/.pic/index.psp", line 8, in > >>     import Helper > > >> ImportError: No module named He

Re: Apache binary error?

2008-03-17 Thread Graham Dumpleton
cate what the response content type is web browsers will often try and work it out based on the extension in the URL. This is presuming you configured Apache correctly and your code is actually being executed and you aren't just serving up your code instead. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Huge problem gettng MySQLdb to work on my mac mini running Macosx 10.5 Leopard

2008-03-18 Thread Graham Dumpleton
mp/_mysql.so, 2): no > suitable image found. Did find:, referer:http://localhost/images/ > [Tue Mar 18 23:34:25 2008] [error] [client ::1] \t/Library/ > WebServer/.python-eggs/MySQL_python-1.2.2-py2.5-macosx-10.5-i386.egg- > tmp/_mysql.so: no matching architecture in universal wrapp

Re: Huge problem gettng MySQLdb to work on my mac mini running Macosx 10.5 Leopard

2008-03-19 Thread Graham Dumpleton
On Mar 19, 9:30 pm, geert <[EMAIL PROTECTED]> wrote: > On Mar 19, 2:26 am, Graham Dumpleton <[EMAIL PROTECTED]> > wrote: > > > > > On Mar 19, 9:47 am, geert <[EMAIL PROTECTED]> wrote: > > > > On Mar 18, 6:56 pm, geert <[EMAIL PROTECTED]> wro

Re: Beta testers needed for a high performance Python application server

2008-03-25 Thread Graham Dumpleton
rand when you consider that any performance gain you may have over a competing solution may only end up resulting in somewhat less than 1% difference when one looks at overall request time. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Beta testers needed for a high performance Python application server

2008-03-25 Thread Graham Dumpleton
pplications. Anyway, because it isn't that simple is why I'd like to see some actual documentation for this new contender posted in a public place, along with code being browsable so one can evaluate it without having to sign up for some closed beta program. Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Parent module not loaded error

2009-01-14 Thread Graham Dumpleton
r anywhere else, are always done by site package root reference and not direct. Ie., such that it uses mysite.d4 and not just d4. Would that seem about right? Graham -- http://mail.python.org/mailman/listinfo/python-list

Re: Parent module not loaded error

2009-01-14 Thread Graham Dumpleton
On Jan 14, 9:41 pm, Ståle Undheim wrote: > On Jan 14, 11:31 am, Graham Dumpleton > wrote: > > > > > On Jan 14, 9:20 pm, Ståle Undheim wrote: > > > > I have a pretty strange error that I can't figure out the cause off. > > > This is in a Django ap

Re: WSGI question: reading headers before message body has been read

2009-01-18 Thread Graham Dumpleton
that 100-continue requests not always working for daemon mode. You need to apply fix in: http://code.google.com/p/modwsgi/issues/detail?id=121 For details on LimitRequestBody directive see: http://httpd.apache.org/docs/2.2/mod/core.html#limitrequestbody Graham -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   >