Re: os.path.normpath

2006-08-16 Thread Graham Dumpleton
Hari Sekhon wrote .. > [EMAIL PROTECTED] wrote: > > [EMAIL PROTECTED] wrote: > > > >> I am using a windows box and passing a string like "../foo/../foo2" > to > >> normpath which then returns "..\\foo2". But if this string is going > >> into a webpage link it should really be "../foo". > >> > >>

Re: mod_python installation problem ..severity High

2006-11-14 Thread Graham Dumpleton
boney wrote: > On doing this and duly following the installation and testing > instructions at www.modpython.org and then pointing the url as > http://localhost/test/mptest.py, i get the following error on the > server log file: > > [Tue Nov 14 15:17:47 2006] [error] make_obcallback: could not impo

Re: Python, WSGI, legacy web application

2006-11-22 Thread Graham Dumpleton
Ben Finney wrote: > Howdy all, > > I'm working on a web application that is starting to gain a lot of > back-end code written in Python. However, all the current interface > code is written in legacy PHP. I'd like to slowly introduce new > features as Python WSGI programs. > > Is it possible to wr

Re: WSGI with mod_python (was: Python, WSGI, legacy web application)

2006-11-23 Thread Graham Dumpleton
Paul Boddie wrote: > Rob De Almeida wrote: > > Ben Finney wrote: > > > I was under the impression that WSGI in mod_python was a rather kludgy > > > way to do WSGI, but I don't know what the alternatives are. CGI? > > > Python http server (e.g. CherryPy)? Something else? > > > > You can use FastCGI

Re: Mod_python vs. application server like CherryPy?

2006-12-06 Thread Graham Dumpleton
Vincent Delporte wrote: > On 5 Dec 2006 17:05:06 -0800, "fumanchu" <[EMAIL PROTECTED]> wrote: > >In a nutshell, mod_python gives you > >access from Python to the Apache API, whereas CherryPy and friends give > >you their own API. > > I didn't know Apache had an API of its own, or that it was even

Re: Mod_python vs. application server like CherryPy?

2006-12-06 Thread Graham Dumpleton
Vincent Delporte wrote: > On 6 Dec 2006 14:55:58 -0800, "Graham Dumpleton" > <[EMAIL PROTECTED]> wrote: > >Although WSGI is an extreme case because of the level it pitches at, > >other systems such as CherryPy and Django aren't much different as they >

Re: apache & mod_python

2006-12-09 Thread Graham Dumpleton
Maxim Sloyko wrote: > m.banaouas wrote: > > > Can i install and use "Apache 2.2.3" & "mod_python 3.2.10" (most recent > > versions) without facing any known major issue ? Only that to use Apache 2.2 you must have mod_python 3.2.10 or later, older versions of mod_python do not work with the more

Re: Mod_python vs. application server like CherryPy?

2006-12-09 Thread Graham Dumpleton
Damjan wrote: > > For example, consider an extreme case such as WSGI. Through a goal of > > WSGI being portability it effectively ignores practically everything > > that Apache has to offer. Thus although Apache offers support for > > authentication and authorisation, a WSGI user would have to imp

Re: mod_python.so is garbled mod_python.so is garbled

2006-12-13 Thread Graham Dumpleton
blbmdsmith wrote: > Has anyone seen the following error while starting httpd: > > Starting httpd: httpd: Syntax error on line 54 of > /usr/local/apache2/conf/httpd.conf: API module structure > `python_module' in file /usr/local/apache/modules/mod_python.so is > garbled - perhaps this is not an Apa

Re: Apache 2.2.3 and mod_python 3.2.10

2006-12-19 Thread Graham Dumpleton
m.banaouas wrote: > sorry, I give here the right paths: > > I installed Apache 2.2.3 and mod_python 3.2.10 on WinXP plateform > I configured mod_python via httpd.conf: > LoadModule python_module modules/mod_python.so > > but my script folder configuration doesn't work correctely: > > Alias /myfold

Re: Page layouts in mod_python?

2006-12-19 Thread Graham Dumpleton
Bruno Desthuilliers wrote: > Michael a écrit : > > Hey everyone, > > > > Is it possible to automatically insert headers/footers using > > mod_python? > > I will be not be using PSP's, so I cannot use the PSP/include solution. > > Furthermore, the header will be dynamic; it won't be a static HTML >

Re: ANNOUNCE: Mod_python 3.3.0b (Beta)

2006-12-25 Thread Graham Dumpleton
derekl00 wrote: > Gregory (Grisha) Trubetskoy wrote: > > The Apache Software Foundation and The Apache HTTP Server Project are > > pleased to announce the 3.3.0b (Beta) release of mod_python. > > How long does it usually take for these things to make there way into > the Fedora (or other distro) r

Re: Mod_python

2006-12-27 Thread Graham Dumpleton
Maxim Sloyko wrote: > Lad wrote: > > In my web application I use Apache and mod_python. > > I allow users to upload huge files( via HTTP FORM , using POST method) > > I would like to store the file directly on a hard disk and not to > > upload the WHOLE huge file into server's memory first. > > C

Re: per interpreter storage for C extensions

2006-12-28 Thread Graham Dumpleton
Chris Mellon wrote: > I'm not that familiar with > mod_python but I'm surely each python interpreter is in a different > thread (if not process) than the others. No. In mod_python there can be multiple distinct interpreter instances in each Apache child process. If using a multithreaded Apache M

Re: Question about the "new" module

2006-12-29 Thread Graham Dumpleton
[EMAIL PROTECTED] wrote: > Gabriele> I'm using Python 2.5 to develop a simple MVC framework based > Gabriele> on mod_python. To load my controllers, I create new modules > Gabriele> using the "new" module like this: > > Gabriele> # > Gabriele> my_module = new.module("random_na

Re: Multiple python interpreters within the same process

2007-06-09 Thread Graham Dumpleton
On Jun 10, 9:07 am, Josiah Carlson <[EMAIL PROTECTED]> wrote: > André wrote: > > On Jun 9, 5:00 pm, "Marcin Kalicinski" <[EMAIL PROTECTED]> wrote: > >> How do I use multiple Python interpreters within the same process? > > >> I know there's a function Py_NewInterpreter. However, how do I use > >>

Re: How does mod_python know where's Python installed ?

2007-06-12 Thread Graham Dumpleton
On Jun 13, 7:03 am, arorap <[EMAIL PROTECTED]> wrote: > Hi, > > I recently setupmod_pythonsuccessfully and things work smooth. > However, I do not remember tellingmod_pythonwhere to find Python > installation. There's not environment variable which gives that > information. As such how doesmod_pyth

Re: cgi.FieldStorage() not working on Windows

2007-06-12 Thread Graham Dumpleton
On Jun 13, 1:17 am, arorap <[EMAIL PROTECTED]> wrote: > I've mod_php installed with Apache 2.2. In one of my folders, I'm > using the cgihandler as the PythonHandler as my target host runs > python only as CGI. Here cgi.FieldStorage() doesn't seem to work. I > can see the form data in sys.stdin but

Re: cgi.FieldStorage() not working on Windows

2007-06-13 Thread Graham Dumpleton
27;ll have to get someone else who has Windows to try it. You might be better off going to the mod_python mailing list to get help, or just use plain old CGI instead since using mod_python isn't really going to gain you much anyway. Graham > On Jun 12, 7:59 pm, Graham Dumpleton <[EMAIL PR

Re: Text-To-Speech for the Mac (OS X)

2007-06-20 Thread Graham Dumpleton
On Jun 21, 9:41 am, Brian <[EMAIL PROTECTED]> wrote: > Hello, > > Does anyone know how to get Python to be able to perform text-to-speech > abilities for the Mac (OS X)? I have been searching Google, but have > not found any helpful solutions or resources yet. os.system('say read the man page for

Re: Using PSE under Win32

2007-06-24 Thread Graham Dumpleton
On Jun 24, 1:13 am, Eduardo Dobay <[EMAIL PROTECTED]> wrote: > Hello, I've been playing around withmod_pythonthese days (using > Publisher and PSP), and it has been working smoothly under Windows XP > (using Apache 2.2). But when I installed PSE and went to use it > withmod_python, it didn't work.

Re: server wide variables

2007-06-25 Thread Graham Dumpleton
On Jun 26, 1:29 am, Jay Sonmez <[EMAIL PROTECTED]> wrote: > I want to be able to save some server variables as long as Apache runs > on the server (mod_python). > > How is that possible in Python? It depends on whether you expect all Apache child processes for that server to be able to access the

Re: server wide variables

2007-06-25 Thread Graham Dumpleton
On Jun 26, 10:29 am, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Jun 26, 1:29 am, Jay Sonmez <[EMAIL PROTECTED]> wrote: > > > I want to be able to save some server variables as long as Apache runs > > on the server (mod_python). > > > How is that possib

Changing default output object for

2007-06-27 Thread Graham Dumpleton
I am sure someone has probably thought of this and there are good reasons why it is a bad idea or not possible, but, is there any technical reason why one couldn't somehow replace PRINT_ITEM byte code, with combination of byte codes which inserted in a reference to a file like object and then invok

Re: mod_python & doc file system layout

2007-07-04 Thread Graham Dumpleton
On Jul 5, 12:22 am, Jan Danielsson <[EMAIL PROTECTED]> wrote: > Hello all, > >This is probably more of an apache question, but I'm guessing there > will be other mod_python-beginners who are wondering the same thing. > >Let's say I have a web app called MyApp. It uses the usual images and >

Re: Client-side cookies on Python in Mac OSX

2007-07-12 Thread Graham Dumpleton
On Jul 13, 12:14 pm, Adrian Petrescu <[EMAIL PROTECTED]> wrote: > Hi, all. I'm writing an app for OS X; therefore I'd prefer to use only > the default python install that comes with Tiger. For the moment, > however, this means: > > NaviOSX:~ adrianpetrescu$ python -V > Python 2.3.5 > > Therefore, I

Re: Installing mod_python on mac os 10.4.7

2007-07-14 Thread Graham Dumpleton
On Jul 15, 2:47 am, 7stud <[EMAIL PROTECTED]> wrote: > Themod_pythonmanual says this under section 2.1 Prerequisites: > > -- > In order to compilemod_pythonyou will need to have the include files > for both Apache and Python, as well as the Python library installed on > your system. If you inst

Re: Installing mod_python on mac os 10.4.7

2007-07-14 Thread Graham Dumpleton
On Jul 15, 10:06 am, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > On Jul 15, 2:47 am, 7stud <[EMAIL PROTECTED]> wrote: > > > > > Themod_pythonmanual says this under section 2.1 Prerequisites: > > > -- > > In order to compilemod_pythonyou will need

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. Graham On A

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

2007-04-18 Thread Graham Dumpleton
> Hi Graeme, > > Thanks for the suggestion. Unluckily for me, it doesn't seem to be > working though ... > > I've tried it a number of different ways. I guess if I put the code > after an exception, then the code won't be called. > So I ran an error in the python script and then I called the > sys

Re: python cgi problem with textarea

2007-04-22 Thread Graham Dumpleton
On Apr 22, 11:09 pm, placid <[EMAIL PROTECTED]> wrote: > On Apr 22, 4:08 pm, Adrian Smith <[EMAIL PROTECTED]> wrote: > > > > > This may be more a cgi thing than a Python one, but I'm trying to get > > this page: > > >http://adrian10.phpwebhosting.com/trial.html > > > consisting basically of this: >

Re: re-importing modules

2007-04-30 Thread Graham Dumpleton
On May 1, 2:17 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Tue, 01 May 2007 00:32:20 +, John Nagle wrote: > > [EMAIL PROTECTED] wrote: > > >>>In addition to the warning that reload() does not recursively reload > >>>modules that the reloaded module depends on, be warned that reloading a

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
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 iterable as usual > without error, but that iterable's next() method eventually raises an > exception. Since any data ther

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
On May 18, 5:31 am, Stefan Sonnenberg-Carstens <[EMAIL PROTECTED]> wrote: > IMHO WSGI is _only_ a new way of talking to webservers, like apache. > It is as low-level as (f)cgi, so don't expect too much support at this > stage - > indeed a module like the cgi one in the std lib would be nice. > As g

Re: Is wsgi ready for prime time?

2007-05-17 Thread Graham Dumpleton
On May 18, 5:31 am, Stefan Sonnenberg-Carstens <[EMAIL PROTECTED]> wrote: > IMHO WSGI is _only_ a new way of talking to webservers, like apache. > It is as low-level as (f)cgi, so don't expect too much support at this > stage - > indeed a module like the cgi one in the std lib would be nice. > As g

Re: mod_python performs several magnitudes slower than PHP?

2007-05-19 Thread Graham Dumpleton
On May 20, 10:01 am, John Nagle <[EMAIL PROTECTED]> wrote: > That's puzzling, because withmod_python, you're only invoking > the compiler once per Apache restart. With CGI programs, you pay > the loading penalty on every request. > > John Nagle > > [EMAIL PROTEC

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
On May 25, 5:24 am, aspineux <[EMAIL PROTECTED]> wrote: > On 24 mai, 19:33, Szabolcs Nagy <[EMAIL PROTECTED]> wrote: > > > > Is there a way I could code the base (core) code in Python and have > > > PHP call it? I've really liked using SQLAlchemy and there are other > > > * quick and dirty solutio

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
On Aug 8, 8:28 am, Stefan Bellon <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm generating a binding from Python to C using SWIG. On the C side I > have iterators over some data structures. On the Python side I > currently use code like the following: > > def get_data(obj): > result = []

Re: some import / namespace questions

2007-08-08 Thread Graham Dumpleton
On Aug 9, 1:11 am, stef mientki <[EMAIL PROTECTED]> wrote: > hello, > > I'm working on a rather strange program, > that is partially build dynamically, > and where users can create plugins, > without knowing any of the details of the core program. > > Of course this leads to some weird bugs, > so o

Overriding Thread.join in derived class.

2007-08-18 Thread Graham Dumpleton
If one creates a thread using threading.Thread and makes it a daemon by calling setDaemon(), then when Python is exiting it will not attempt to call join() on that thread and wait for it to complete first. The problem with this is that the daemonised thread will continue to run while atexit regist

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
On Aug 26, 12:58 pm, Clover <[EMAIL PROTECTED]> wrote: > When trying to do some things on my Mac (starting Lyx, compiling Latex > via TextMate) I get this error: > > python: execv: > /Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python: > No such file or dire

Re: some problems with mod_python

2007-08-27 Thread Graham Dumpleton
On Aug 28, 6:13 am, Johan <[EMAIL PROTECTED]> wrote: > Hi > > I have installed and tested this on centos, fedora and freebsd all > give the same problem so I guess I missed some steps. > > I have compiled bot apache (2.2.4) and mod_python (3.3.1) according to > the docs and no problem with this. >

Re: How to use os.putenv() ?

2007-08-29 Thread Graham Dumpleton
On Aug 30, 11:21 am, [EMAIL PROTECTED] wrote: > >>> import os > > >>> os.environ['PATH'] > > 'C:\\WINNT\\system32;C:\\WINNT;C:\\WINNT\\System32\\Wbem;%C:\\WINNT%\ > \system32;%C:\\WINNT%;%C:\\WINNT%\\System32\\Wbem' > > >>> os.putenv('PATH', 'C:\\WINNT\\system32') > > >>> os.environ['PATH'] > > 'C:

Re: Module for mod_python

2007-09-05 Thread Graham Dumpleton
On Sep 6, 9:32 am, rieh25 <[EMAIL PROTECTED]> wrote: > Is it such a bad idea that it doesn't deserve a reply? You only posted the question six hours ago. Maybe the people who might want to comment are asleep. BTW, have you done an analysis of the various existing database object relational mapper

Re: Python 3K or Python 2.9?

2007-09-11 Thread Graham Dumpleton
On Sep 12, 2:14 pm, Ben Finney <[EMAIL PROTECTED]> wrote: > Paul Rubin writes: > > TheFlyingDutchman <[EMAIL PROTECTED]> writes: > > > Python user and advocate Bruce Eckel is disappointed with the > > > additions (or lack of additions) in Python 3: > > > >http://www.artim

Re: re-point mod_python - is it possible?

2007-03-06 Thread Graham . Dumpleton
On Mar 7, 3:08 pm, "leland" <[EMAIL PROTECTED]> wrote: > i've upgraded my RHEL3 box to run python 2.3. problem is, mod_python > still points to the old python 2.2. is there any way to tell > mod_python that i've got a new version of python installed, and > to use that version now? > > any help woul

Re: Configuration: Apache + mod_python

2007-03-08 Thread Graham . Dumpleton
On Mar 8, 9:50 pm, "Danilo" <[EMAIL PROTECTED]> wrote: > Hi there, > > is it possible to create a rewrite rule to send every server-request > to the directory /py? But only if the file does not exists on the > server. > > This is my mod_python section of the apache config-file. > > > SetHa

Re: Configuration: Apache + mod_python

2007-03-08 Thread Graham . Dumpleton
On Mar 9, 12:02 am, "Danilo" <[EMAIL PROTECTED]> wrote: > On 8 Mrz., 12:18, [EMAIL PROTECTED] wrote: > > > > > On Mar 8, 9:50 pm, "Danilo" <[EMAIL PROTECTED]> wrote: > > > > Hi there, > > > > is it possible to create a rewrite rule to send every server-request > > > to the directory /py? But only i

Re: Configuration: Apache + mod_python

2007-03-09 Thread Graham Dumpleton
On Mar 9, 7:09 pm, "Danilo" <[EMAIL PROTECTED]> wrote: > On 8 Mrz., 22:23, [EMAIL PROTECTED] wrote: > > > > > On Mar 9, 12:02 am, "Danilo" <[EMAIL PROTECTED]> wrote: > > > > On 8 Mrz., 12:18, [EMAIL PROTECTED] wrote: > > > > > On Mar 8, 9:50 pm, "Danilo" <[EMAIL PROTECTED]> wrote: > > > > > > Hi th

Re: merits of Lisp vs Python

2007-03-10 Thread Graham Dumpleton
On Mar 11, 12:31 pm, [EMAIL PROTECTED] (John J. Lee) wrote: > John Nagle <[EMAIL PROTECTED]> writes: > > John J. Lee wrote: > > > John Nagle <[EMAIL PROTECTED]> writes: > > > [...] > > > >>Python, on the other hand, is uphill all the way. Constant trouble > > >>with version issues, especially

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
On Mar 27, 11:02 am, "Adam Atlas" <[EMAIL PROTECTED]> wrote: > On Mar 26, 4:55 pm, "Matimus" <[EMAIL PROTECTED]> wrote: > > > I think that is what the "code" module is for. Maybe not exactly what > > you were expecting, but the capability you describe is already there. > > Being able to access its

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
On Apr 11, 12:22 pm, John Nagle <[EMAIL PROTECTED]> wrote: >The documentation for Python's CGI module doesn't seem to say how to get > the IP address of the client. Don't see an obvious way to get that info > from reading the source, either. Ideas? > > J

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

2007-09-13 Thread Graham Dumpleton
On Sep 13, 11:05 pm, Dmitri Fedoruk <[EMAIL PROTECTED]> wrote: > Hello everyone, > > I'm developing a mod_python application that is based on XML\XSLT > transforming. > > I used 4Suite libraries for that, but as the speed was unacceptable > for me, I switched to lxml. Everything became much easier

Re: Python,SWIG and libjvm

2007-09-20 Thread Graham Dumpleton
On Sep 21, 9:00 am, sapsi <[EMAIL PROTECTED]> wrote: > Hello, > I'm not sure if this the correct list but here goes (and sorry for the > noise). I've been attempting to wrap python around libhdfs. > So far so good (i've attached the SWIG template at the end). The > compilation works without errors

Re: mod_python preprocess/filter before proxy

2007-09-27 Thread Graham Dumpleton
Yes, use PythonInputFilter directive to specify an input filter. http://www.modpython.org/live/current/doc-html/dir-filter-if.html Input filters which modify the length of the data may be an issue though when doing proxying however. If you cant work it out, possibly more appropriate to take yo

Re: PYTHONPATH on OS X

2007-10-10 Thread Graham Dumpleton
On Oct 11, 8:00 am, "mhearne808[insert-at-sign-here]gmail[insert-dot- here]com" <[EMAIL PROTECTED]> wrote: > I'm missing something major here. I'm trying to add a directory to my > python path using the PYTHONPATH environment variable, and it's being > ignored by the Python interactive shell. > >

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

2007-10-14 Thread Graham Dumpleton
On Oct 14, 6:46 pm, Michele Simionato <[EMAIL PROTECTED]> wrote: > Now, since you are here, there is an unrelated question that I want to > ask you, concerning the future of Paste with respect to WSGI 2.0. > I do realize that at this stage WSGI 2.0, is only a draft Hmmm, not sure where people keep

Re: Problem calling python modules from python apache handler

2007-10-16 Thread Graham Dumpleton
On Oct 17, 8:00 am, mannewalis <[EMAIL PROTECTED]> wrote: > Hi, > > I have the following setup... > > Apache 2.2.3, Python 2.5 and mod_python 3.3.1 > > I have configured apache to call a python script when fetching .py > resources...so far so good... I did the hello world script in the > mod_python

Re: MOD_PYTHON + packages reloading

2007-10-18 Thread Graham Dumpleton
On Oct 18, 6:55 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > I came across annoying problem during my fun with mod_python. I turned > > out that mod_python load package only onca and don't care about any > > changes to it. Obviously it makes sense on production server

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.python.org/mailman/li

Re: Monitoring external processes

2007-10-22 Thread Graham Dumpleton
On Oct 23, 3:09 pm, [EMAIL PROTECTED] wrote: > Hi, > > Is there a way to track external processes launched by python on the > Mac? I am using subprocess module to launch the process. > > Thanks > Sunil If using Python 2.3/2.4, you can use os.wait(). If using Python 2.5, there is also have os.wait

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

2007-10-25 Thread Graham Dumpleton
On Oct 26, 6:53 am, David Abrahams <[EMAIL PROTECTED]> wrote: > > David Abrahams wrote: > >> I'm seeing highly surprising (and different!) behaviors of > >> PyImport_ImportModule on Linux and Windows when used in a program with > >> python embedding. > > >> On Linux, ... > > > > Unfortunately, not

Re: mod_python, ElementTree and Aapche 2.0

2007-10-27 Thread Graham Dumpleton
On Oct 28, 3:02 am, Rajarshi <[EMAIL PROTECTED]> wrote: > Hi, this is a slightly vague question but I'm really puzzled as to > when I write a mod_python (3.1.3) program that makes use of > ElementTree and call it via a URL, the program simply stops when I do > something like > > s = # some XML docu

Re: mod_python and Content-Type

2007-01-13 Thread Graham Dumpleton
Paul Rudin wrote: > I'm have a little experiment with mod_python. I'm trying to figure out > how to get hold of the original Content-Type header. > > In my config file I have: > > > AddHandler mod_python .py > PythonHandler atomserv > PythonDebug On > PythonAutoReload

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

2007-01-26 Thread Graham Dumpleton
On Jan 26, 10:00 pm, "Ziga Seilnacht" <[EMAIL PROTECTED]> wrote: > On Jan 26, 10:41 am, [EMAIL PROTECTED] wrote: > > > Python 2.4.4 > >mod_python3.2.10 + Apache 2.0 > > > def index( req, **params ): > > from xml.dom.minidom import parseString > > doc = parseString( "whatever" ) > > > =>

Re: Python does not play well with others

2007-02-04 Thread Graham Dumpleton
On Feb 4, 1:05 pm, Paul Rubin wrote: > "Paul Boddie" <[EMAIL PROTECTED]> writes: >> Probably the biggest inhibitor, as far as I can see, has been the >> server technology chosen. Many hosting providers have historically >> offered no better than CGI for Python, whilst PHP

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
On Feb 6, 5:39 am, Paul Rubin wrote: > John Nagle <[EMAIL PROTECTED]> writes: > > > The GIL doesn't affect seperate processes, and any large server that > > > cares about stability is going to be running a pre-forking MPM no > > > matter what language they're supporting.

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
On Nov 21, 2:33 am, Istvan Albert <[EMAIL PROTECTED]> wrote: > On Nov 20, 9:42 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > > > 12/7. Django comes with its own little server so that you don't have > > > to set up Apache on your desktop to play with it. > > > I was rather shocked to learn t

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
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: > > 1. app_name has no attribute or file managment.py: That's OK. > 2. managment.py exists, but raises an ImportError: That's not OK: reraise > > # Import

Re: Running unmodified CGI scripts persistently under mod_wsgi.

2007-11-28 Thread Graham Dumpleton
On Nov 29, 2:36 am, Thomas Guettler <[EMAIL PROTECTED]> wrote: > Istvan Albert schrieb: > > > It will be awesome ifmod_wsgican run CGI without invoking python on > > each access. > > For SCGI there is something like this: cgi2scgi: it is small executable > written in C, > which connects to a runni

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
On Dec 3, 11:44 am, Abandoned <[EMAIL PROTECTED]> wrote: > Hi.. > I set cookie fromwww.domain.combut i'cant read this cookie from > subdomain.domain.com > How can i set cookie for all subdomains ? > > My set cookie code is: > cookie = Cookie.Cookie('Login-Data', data) > cookie.expires = time.time()

Re: weird embedding problem

2007-12-07 Thread Graham Dumpleton
On Dec 7, 5:01 pm, DavidM <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm embedding python in a C prog which is built as a linux shared lib. > > The prog is linked against libpython, and on startup, it calls > Py_Initialize(). > > The prog imports a pure-python script. The script starts up ok, but whe

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
On Dec 9, 12:26 am, Michael Ströder <[EMAIL PROTECTED]> wrote: > Jeffrey Froman wrote: > > > I'd still be interested in a mod_wsgi wrapper for 3rd-party CGI scripts. > > I doubt that this is possible, not because of the interface. But > conventional CGI scripts are implemented with the assumption o

Re: Deploying embedded Python

2007-12-17 Thread Graham Dumpleton
On Dec 18, 11:07 am, Andreas Raab <[EMAIL PROTECTED]> wrote: > Hi - > > I'm currently looking into a few deployment issues with our embedded > Python interpreter and I'm looking for any information about deploying > embedded Python that people may have. Specifically, I'm looking for the > following

Re: More than one interpreter per process?

2007-12-18 Thread Graham Dumpleton
On Dec 19, 2:37 am, sturlamolden <[EMAIL PROTECTED]> wrote: > On 18 Des, 10:24, Roger Binns <[EMAIL PROTECTED]> wrote: > > > You can. Have a look at mod_python andmod_wsgiwhich does exactly > > this. But extension modules that use the simplified GIL api don't work > > with them (well, if at all).

Re: More than one interpreter per process?

2007-12-18 Thread Graham Dumpleton
On Dec 18, 8:24 pm, Roger Binns <[EMAIL PROTECTED]> wrote: > sturlamolden wrote: > > If one can have more than one interpreter in a single process, > > You can. Have a look at mod_python andmod_wsgiwhich does exactly > this. But extension modules that use the simplified GIL api don't work > with

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
On Dec 21, 7:42 pm, Ilias Lazaridis <[EMAIL PROTECTED]> wrote: > On Dec 19, 5:40 am, Ilias Lazaridis <[EMAIL PROTECTED]> wrote: > > > > > On Dec 17, 8:41 am, Ilias Lazaridis <[EMAIL PROTECTED]> wrote: > > > > How to detect memory leaks of python programms, which run in an > > > environment like thi

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

2007-12-25 Thread Graham Dumpleton
On Dec 24, 10:34 pm, "Ravi Kumar" <[EMAIL PROTECTED]> wrote: > hi :) > I was trying to develop a custommod_pythonbased web-site, just > today. the problem I got > though i liked themod_python'sfeature of mapping and calling > functions in python script by parsing the url. > I mean,http://localhost/

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

2007-12-30 Thread Graham Dumpleton
On Dec 31, 1:24 am, [EMAIL PROTECTED] wrote: > Hi list and python gurus :-) > > I'm playing with somemod_pythonand web development. And in me code I > need to do som dynamic imports. > Right now I just do a: > > exec 'import '+some_modulename > > But it seems to easy, is there a "dark side" to doin

Re: Python setup not working on Windows XP

2008-01-08 Thread Graham Dumpleton
On Jan 8, 5:31 pm, Tim Roberts <[EMAIL PROTECTED]> wrote: > Gowri <[EMAIL PROTECTED]> wrote: > > >I am new to Python and am trying to setup Apache to serve Python using > >mod_python. I'm using a Windows XP box. here is a list of steps i > >followed for the installation: > > >1. Installed Apache 2.

  1   2   >