Python version and Apache mod_python mismatching version
Hello, I have a Centos7 web server with python 2.7 installed and I want Apache to serve python scripts so I figure I have to install mod_python: i know that this module is deprecated, but I need it only for internal pourposes. Is the mod_python version (which is 3.5 with Python 3 support) somehow related to the python interpreter the web server? Is there any problem if the mod_python version and python version didn't match? -- https://mail.python.org/mailman/listinfo/python-list
Re: mod_python compilation error in VS 2008 for py2.7.1
Τη Τρίτη, 14 Ιουνίου 2016 - 3:36:23 μ.μ. UTC+3, ο χρήστης Pavel S έγραψε: > Have you considered to use rather WSGI-based solution? (for Apache Httpd is > mod_wsgi). Mod_python is totally obsolete. Regarding my blog post, i would like to inform you that someone helped me to overcome this error but i got another one that i do not know it's meaning: deleted #define ssize_t error: [Errno 22] invalid mode ('wb') or filename: "dist\\mod_python-'{' \x9b\x9 c\xa4 \x98\xa4\x98\x9a\xa4\xe0\xa8\xe5\x9d\x9c\xab\x98\xa0 \xe0\xaa \x9c\xa9\xe0 \xab\x9c\xa8\xa0\xa1\xe3 \xe3 \x9c\xa5\xe0\xab\x9c\xa8\xa0\xa1\xe3 \x9c\xa4\xab\ xa6\xa2\xe3,\n\x9c\xa1\xab\x9c\xa2\xe2\xa9\xa0\xa3\xa6 \xa7\xa8\xe6\x9a\xa8\x98\ xa3\xa3\x98 \xe3 \x98\xa8\xae\x9c\xe5\xa6 \x9b\xe2\xa9\xa3\x9e\xaa \x9c\xa4\x9c\ xa8\x9a\x9c\xa0\xe9\xa4..win32-py2.7.exe" Any idea would help me a lot? Attached file for more information! Regards Kostas Asimakopoulos -- https://mail.python.org/mailman/listinfo/python-list
mod_python compilation error
Regarding my blog post <http://code.activestate.com/lists/python-list/704521/>, i would like to inform you that someone helped me to overcome this error but i got another one that i do not know it's meaning: error: [Errno 22] invalid mode ('wb') or filename: "dist\\mod_python-'{' \x9b\x9 c\xa4 \x98\xa4\x98\x9a\xa4\xe0\xa8\xe5\x9d\x9c\xab\x98\xa0 \xe0\xaa \x9c\xa9\xe0 \xab\x9c\xa8\xa0\xa1\xe3 \xe3 \x9c\xa5\xe0\xab\x9c\xa8\xa0\xa1\xe3 \x9c\xa4\xab\ xa6\xa2\xe3,\n\x9c\xa1\xab\x9c\xa2\xe2\xa9\xa0\xa3\xa6 \xa7\xa8\xe6\x9a\xa8\x98\ xa3\xa3\x98 \xe3 \x98\xa8\xae\x9c\xe5\xa6 \x9b\xe2\xa9\xa3\x9e\xaa \x9c\xa4\x9c\ xa8\x9a\x9c\xa0\xe9\xa4..win32-py2.7.exe" Any idea would help me a lot? Regards Kostas Asimakopoulos -- https://mail.python.org/mailman/listinfo/python-list
Re: mod_python compilation error in VS 2008 for py2.7.1
Have you considered to use rather WSGI-based solution? (for Apache Httpd is mod_wsgi). Mod_python is totally obsolete. -- https://mail.python.org/mailman/listinfo/python-list
mod_python compilation error in VS 2008 for py2.7.1
I would like to ask you a technical question regarding python module compilation for python 2.7.1. I want to compile mod_python <https://app.box.com/s/orsffo3t4g6h9ftkq6p1>library for Apache 2.2 and py2.7 <https://www.python.org/downloads/> on Win32 in order to use it for psp - py scripts that i have written. I tried to compile it using VS 2008 (VC++) and unfortunately i get an error on pyconfig.h (Py2.7/include) error C2632: int followed by int is illegal. This problem occurs when i try to run the bat file that exists on mod_python/dist folder. Any idea or suggestion what should i do in order to run it on Win 7 Pro (win 32) environment and produce the final apache executable module (.so). I have posted the same question here <http://stackoverflow.com/questions/37696936/vc-compilation-error-in-pyconfig-h-vs-2008>, but unfortunately i had had no luck! Additionally i give you the compilation instructions that i follow (used also MinGW-w64 and get the same error) in order to produce the final output! Compiling Open a command prompt with VS2008 support. The easiest way to do this is to use "Start | All Programs | Microsoft Visual Studio 2008 | Visual Studio Tools | Visual Studio 2008 Command Prompt". (This puts the VS2008 binaries in the path and sets up the lib/include environmental variables for the Platform SDK.) 1.cd to the mod_python\dist folder. 2.Tell mod_python where Apache is: set APACHESRC=C:\Apache 3. Run build_installer.bat. If it succeeds, an installer.exe will be created in a subfolder. Run that install the module. Kind Regards Kostas Asimakopoulos -- https://mail.python.org/mailman/listinfo/python-list
[issue19797] Solaris 10. mod_python build failed.
New submission from lambrecht: Bonjour. Any idea ? mod_python 3.3.1 apache 2.2.6 ... /METHPR/tmp/apache/build/libtool --silent --mode=link gcc -o mod_python.la -rpath /METHPR/tmp/apache/modules -module -avoid-versionfinfoob ject.lo hlistobject.lo hlist.lo filterobject.lo connobject.lo serverobject.lo util.lo tableobject.lo requestobject.lo _apachemodule.lo mod_pyth on.lo -L/METHPR/data/python/lib/python2.6/config -lm -lintl -lpython2.6 -lsocket -lnsl -lrt -ldl -lm _eprintf.o _floatdidf.o _muldi3.o *** Warning: Linking the shared library mod_python.la against the non-libtool *** objects _eprintf.o _floatdidf.o _muldi3.o is not portable! Text relocation remains referenced against symbol offset in file .text (section) 0x1510 /METHPR/data/python/lib/python2.6/config/libpython2.6.a(floatobject.o) .text (section) 0x1514 /METHPR/data/python/lib/python2.6/config/libpython2.6.a(floatobject.o) .text (section) 0x1518 /METHPR/data/python/lib/python2.6/config/libpython2.6.a(floatobject.o) .text (section) 0x151c /METHPR/data/python/lib/python2.6/config/libpython2.6.a(floatobject.o) .text (section) 0x1520 /METHPR/data/python/lib/python2.6/config/libpython2.6.a(floatobject.o) .text (section) 0x1524 /METHPR/data/python/lib/python2.6/config/libpython2.6.a(floatobject.o) .../... 0x33ec /METHPR/produits/python/lib/python2.6/config/libpython2.6.a(fileobject.o) __filbuf0x33fc /METHPR/produits/python/lib/python2.6/config/libpython2.6.a(fileobject.o) ld: fatal: relocations remain against allocatable but non-writable sections collect2: ld returned 1 exit status apxs:Error: Command failed with rc=65536 . *** Error code 1 make: Fatal error: Command failed for target `mod_python.so' Current working directory /METHPR/data/mod_python-3.3.1/src *** Error code 1 The following command caused the error: cd src make make: Fatal error: Command failed for target `do_dso' -- messages: 204468 nosy: lambrechtphilippe priority: normal severity: normal status: open title: Solaris 10. mod_python build failed. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19797 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19797] Solaris 10. mod_python build failed.
Changes by lambrecht philippe.lambre...@socgen.com: -- components: +Build versions: +3rd party ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19797 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19797] Solaris 10. mod_python build failed.
Christian Heimes added the comment: Please contact the developers of mod_python. The Python bug tracker is not the right place to get support for 3rd party software. The 3rd party version is only for 3rd party code that is part of the main Python distribution (e.g. sqlite or zlib). -- nosy: +christian.heimes resolution: - invalid stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19797 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
ANN: mod_python 3.4.1
After a six year pause in development, I am pleased to announce the 3.4.1 release of mod_python. Mod_python is an Apache HTTP Server module that embeds the Python language interpreter within the server. With mod_python you can write web-based applications in Python that are fast, scalable have access to advanced features such as ability to maintain objects between requests, access to httpd internals, content filters, connection handlers and more. The 3.4.1 release mainly addresses compatibility with Python version up to 2.7.5 and Apache HTTP Server 2.4.4, addition of a WSGI handler as well as many bug fixes. Mod_python 3.4.1 is released under the Apache License version 2.0. Information about this release, download link, documentation and more is available at: http://www.modpython.org/ Many thanks to everyone who contributed to and helped test this release, without your help it would not be possible! Regards, Gregory Trubetskoy -- https://mail.python.org/mailman/listinfo/python-announce-list Support the Python Software Foundation: http://www.python.org/psf/donations/
[issue18542] httpd memory consuption increasing continously due to mod_python
Changes by Ronald Oussoren ronaldousso...@mac.com: -- stage: - committed/rejected status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18542 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18542] httpd memory consuption increasing continously due to mod_python
New submission from Sumitinder: Mod_python is used in our application and continous load of mod_python result in increase in httpd memory usage i.e upto 1.6 Gb. Packets used: mod_python-3.2.8-3.1 httpd-2.2.3-43.el5.centos Centos 5.5 OS Is there any memory leak in mod_python which is resulting in increase in memory ? -- messages: 193634 nosy: sumitinder priority: normal severity: normal status: open title: httpd memory consuption increasing continously due to mod_python type: performance versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18542 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18542] httpd memory consuption increasing continously due to mod_python
Ronald Oussoren added the comment: mod_python isn't part of the cpython std lib. As such, this isn't the right tracker to report problems with mod_python. You may have more success by asking the project itself (http://www.modpython.org). -- nosy: +ronaldoussoren resolution: - invalid status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18542 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
RE: Question regarding mod_python and a script for web.
Hi Ion thanks a bunch, for responding. The problem we seem to be running into is that When we change the forms to a post instead of a get I cannot pick up the post values using cgi: page_info = cgi.FieldStorage() is this a limitation of mod_python? Thanks. john Date: Thu, 20 Dec 2012 17:59:42 -0800 Subject: Re: Question regarding mod_python and a script for web. From: ian.doug...@iandouglas.com To: johnp...@hotmail.com CC: python-list@python.org Short answer: Use the POST method on the form instead of GET. Depending how you process the form you might need to make a few changes to the script that answers the request. -- http://mail.python.org/mailman/listinfo/python-list
Question regarding mod_python and a script for web.
Hi Everyone, I'm a linux admin that was tasked by his python programming boss to solve a problem my boss is having with a web form he wrote on our site. Unfortunately for me, I lack any experience whatsoever with python and very little with programming on the web, so my hope is someone can point me in the right direction for solving this. Basically, the problem is this. we have a webform that collects data such as, NAME, SSN, EMAIL Address etc.. when the user hits submit, the uri posts to the query string like the folllowing: https://test.uchast.com/admit/supp.py?fname=johnlname=fennmi=tedssn=123456789ssn_confirm=123456789phone=412-658-3178email=jojo%40uc.comalt_email=jojo12%40yahoo.comlsacid=grad_date=May-2013program=JDstep=2 Which is bad as we are are going to be collecting data like Social Security numbers. We are using mod_python WSGIScriptAlias /myapp /var/www/html/admit/index.pyRewriteEngine OnRewriteRule ^/admit https://test.uchast.com/admitDirectory /var/www/html/admitOrder deny,allowAllow from allSSLRequireSSLDirectoryIndex index.py AddHandler mod_python .pyPythonHandler mod_python.cgihandler ###PythonHandler mod_python.publisher PythonDebug On/Directory Does anyone have an idea how to make sure a python script doesn't put the data in the query string? Am I even making sense? Any all help would be greatly appreciated because as I mentioned I'm as new as it gets. Thanks, John -- http://mail.python.org/mailman/listinfo/python-list
Re: Question regarding mod_python and a script for web.
Short answer: Use the POST method on the form instead of GET. Depending how you process the form you might need to make a few changes to the script that answers the request. -- http://mail.python.org/mailman/listinfo/python-list
Errors installing mod_python with apache
I've tried this on both RHEL5.5 and RHEL 6.0, using the default apache that comes with the environment and itself isn't configured with mod_python. The first thing I noticed when mod_python wouldn't install was that apsx wasn't installed either. After a lot of pain, I discovered httpd-devel provided apsx and so installed that. Back to mod_python. After running ./configure --with-apxs=/usr/sbin/apxs, according to the README I need to run make dso, but that promptly blows up because it's looking for header files in /usr/include/httpd and itlooks like the apxs files are in /usr/include/apr1, so I copied all its contents to /usr/include/httpd. Now when I try to make dso, it successfully gets past finding its header files but now fails with: [root@rhel6 mod_python-2.7.10]# make dso make[1]: Entering directory `/tmp/mod_python-2.7.10/src' gcc -I/tmp/mod_python-2.7.10/src/include -I/usr/include/httpd -I/usr/include/python2.6-c -o mod_python.o mod_python.c In file included from /usr/include/python2.6/pyconfig.h:6, from /usr/include/python2.6/Python.h:8, from /tmp/mod_python-2.7.10/src/include/mod_python.h:77, from mod_python.c:54: /usr/include/python2.6/pyconfig-64.h:1031:1: warning: _POSIX_C_SOURCE redefined In file included from /usr/include/sys/types.h:26, from /usr/include/httpd/apr-x86_64.h:127, from /usr/include/httpd/apr.h:19, from /usr/include/httpd/ap_config.h:25, from /usr/include/httpd/httpd.h:43, from /tmp/mod_python-2.7.10/src/include/mod_python.h:63, from mod_python.c:54: /usr/include/features.h:213:1: warning: this is the location of the previous definition In file included from mod_python.c:54: /tmp/mod_python-2.7.10/src/include/mod_python.h:93: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â*â token /tmp/mod_python-2.7.10/src/include/mod_python.h:96: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âpython_moduleâ In file included from /tmp/mod_python-2.7.10/src/include/mod_python.h:99, from mod_python.c:54: /tmp/mod_python-2.7.10/src/include/util.h:57: error: expected â;â, â,â or â)â before â*â token In file included from /tmp/mod_python-2.7.10/src/include/mod_python.h:100, from mod_python.c:54: and a lot more. Can anyone help? -mark -- http://mail.python.org/mailman/listinfo/python-list
Re: Errors installing mod_python with apache
On Tue, Dec 27, 2011 at 13:32, Mark Seger mjse...@gmail.com wrote: I've tried this on both RHEL5.5 and RHEL 6.0, using the default apache that comes with the environment and itself isn't configured with mod_python. The first thing I noticed when mod_python wouldn't install was that apsx wasn't installed either. After a lot of pain, I discovered httpd-devel provided apsx and so installed that. Back to mod_python. After running ./configure --with-apxs=/usr/sbin/apxs, according to the README I need to run make dso, but that promptly blows up because it's looking for header files in /usr/include/httpd and itlooks like the apxs files are in /usr/include/apr1, so I copied all its contents to /usr/include/httpd. Now when I try to make dso, it successfully gets past finding its header files but now fails with: [root@rhel6 mod_python-2.7.10]# make dso make[1]: Entering directory `/tmp/mod_python-2.7.10/src' gcc -I/tmp/mod_python-2.7.10/src/include -I/usr/include/httpd -I/usr/include/python2.6 -c -o mod_python.o mod_python.c In file included from /usr/include/python2.6/pyconfig.h:6, from /usr/include/python2.6/Python.h:8, from /tmp/mod_python-2.7.10/src/include/mod_python.h:77, from mod_python.c:54: /usr/include/python2.6/pyconfig-64.h:1031:1: warning: _POSIX_C_SOURCE redefined In file included from /usr/include/sys/types.h:26, from /usr/include/httpd/apr-x86_64.h:127, from /usr/include/httpd/apr.h:19, from /usr/include/httpd/ap_config.h:25, from /usr/include/httpd/httpd.h:43, from /tmp/mod_python-2.7.10/src/include/mod_python.h:63, from mod_python.c:54: /usr/include/features.h:213:1: warning: this is the location of the previous definition In file included from mod_python.c:54: /tmp/mod_python-2.7.10/src/include/mod_python.h:93: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â*â token /tmp/mod_python-2.7.10/src/include/mod_python.h:96: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âpython_moduleâ In file included from /tmp/mod_python-2.7.10/src/include/mod_python.h:99, from mod_python.c:54: /tmp/mod_python-2.7.10/src/include/util.h:57: error: expected â;â, â,â or â)â before â*â token In file included from /tmp/mod_python-2.7.10/src/include/mod_python.h:100, from mod_python.c:54: and a lot more. Can anyone help? Is there a reason you're not using the system package manager? Does yum install mod_python not find anything? How about yum provides */mod_python.so? -- Rami Chowdhury A mind all logic is like a knife all blade - it makes the hand bleed that uses it. -- Rabindranath Tagore +44-7581-430-517 / +1-408-597-7068 / +88-0189-245544 -- http://mail.python.org/mailman/listinfo/python-list
Re: Errors installing mod_python with apache
I did try yum and got this: [root@rhel53 tmp]# yum install mod_python Loaded plugins: rhnplugin, security This system is not registered with RHN. RHN support will be disabled. Setting up Install Process Parsing package install arguments No package mod_python available. Nothing to do after further digging around I did find rh's mod_python rpm so I installed than and now seem to be ok. nevertheless it still bothers me the 'standard' tarball install didn't work. but I guess I'll leave that to others to worry about. thanks -mark On Tue, Dec 27, 2011 at 12:02 PM, Rami Chowdhury rami.chowdh...@gmail.comwrote: On Tue, Dec 27, 2011 at 13:32, Mark Seger mjse...@gmail.com wrote: I've tried this on both RHEL5.5 and RHEL 6.0, using the default apache that comes with the environment and itself isn't configured with mod_python. The first thing I noticed when mod_python wouldn't install was that apsx wasn't installed either. After a lot of pain, I discovered httpd-devel provided apsx and so installed that. Back to mod_python. After running ./configure --with-apxs=/usr/sbin/apxs, according to the README I need to run make dso, but that promptly blows up because it's looking for header files in /usr/include/httpd and itlooks like the apxs files are in /usr/include/apr1, so I copied all its contents to /usr/include/httpd. Now when I try to make dso, it successfully gets past finding its header files but now fails with: [root@rhel6 mod_python-2.7.10]# make dso make[1]: Entering directory `/tmp/mod_python-2.7.10/src' gcc -I/tmp/mod_python-2.7.10/src/include -I/usr/include/httpd -I/usr/include/python2.6-c -o mod_python.o mod_python.c In file included from /usr/include/python2.6/pyconfig.h:6, from /usr/include/python2.6/Python.h:8, from /tmp/mod_python-2.7.10/src/include/mod_python.h:77, from mod_python.c:54: /usr/include/python2.6/pyconfig-64.h:1031:1: warning: _POSIX_C_SOURCE redefined In file included from /usr/include/sys/types.h:26, from /usr/include/httpd/apr-x86_64.h:127, from /usr/include/httpd/apr.h:19, from /usr/include/httpd/ap_config.h:25, from /usr/include/httpd/httpd.h:43, from /tmp/mod_python-2.7.10/src/include/mod_python.h:63, from mod_python.c:54: /usr/include/features.h:213:1: warning: this is the location of the previous definition In file included from mod_python.c:54: /tmp/mod_python-2.7.10/src/include/mod_python.h:93: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before â*â token /tmp/mod_python-2.7.10/src/include/mod_python.h:96: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âpython_moduleâ In file included from /tmp/mod_python-2.7.10/src/include/mod_python.h:99, from mod_python.c:54: /tmp/mod_python-2.7.10/src/include/util.h:57: error: expected â;â, â,â or â)â before â*â token In file included from /tmp/mod_python-2.7.10/src/include/mod_python.h:100, from mod_python.c:54: and a lot more. Can anyone help? Is there a reason you're not using the system package manager? Does yum install mod_python not find anything? How about yum provides */mod_python.so? -- Rami Chowdhury A mind all logic is like a knife all blade - it makes the hand bleed that uses it. -- Rabindranath Tagore +44-7581-430-517 / +1-408-597-7068 / +88-0189-245544 -- http://mail.python.org/mailman/listinfo/python-list
Wing in mod_python vs wsgi?
I'm still using mod_python to deploy my framework for production (CentOS running Python 2.5.5, Apache 2.2.3, mod_python 3.3.1). I'm acutely aware of how elderly mod_python is, and I've had some frustrations using Wing to debug inside it -- at least its possible, which is not true for any other Python IDE I've tried. Does Wing do better in mod_wsgi? Is it time for me to migrate from mod_python to mod_wsgi? Has anybody tried to do this (mod_wsgi and apache) in a Windoze environment? Thx, Tom S. -- Tom Stambaugh 63 Boston Ave Somerville, MA 02144 617-776-8934 (land) 617-721-0446 (cell) -- http://mail.python.org/mailman/listinfo/python-list
Re: Wing in mod_python vs wsgi?
I don't know about your IDE, I am using the default IDLE just because it is handy. But I have made the switch from mod_python. It was a good idea, but mod_wsgi is a better idea. And as you know, mod_python is no longer supported. I am running Apache with mod_wsgi in a windows 7 environment -- I am working on implementing Pylons. Also, I have another Apache server with mod_wsgi serving a MoinMoin wiki. This one is on a good os -- Fedora. On 2/8/2011 6:57 PM, Tom Stambaugh wrote: I'm still using mod_python to deploy my framework for production (CentOS running Python 2.5.5, Apache 2.2.3, mod_python 3.3.1). I'm acutely aware of how elderly mod_python is, and I've had some frustrations using Wing to debug inside it -- at least its possible, which is not true for any other Python IDE I've tried. Does Wing do better in mod_wsgi? Is it time for me to migrate from mod_python to mod_wsgi? Has anybody tried to do this (mod_wsgi and apache) in a Windoze environment? Thx, Tom S. -- http://mail.python.org/mailman/listinfo/python-list
mod_python load cx_Oracle error
It's quite weird when I import cx_Oracle in python interactive shell, it works perfectly. but when I import cx_Oracle in a *,py script, handled by mod_python.publisher, it keep reportint : ImportError: libclntsh.so.10.1: cannot open shared object file: No such file or directory Can I anyone have a clue what's the matter, any help would be appreciated! -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python load cx_Oracle error
On Mon, 19 Jul 2010 09:12:20 -0700, li wang wrote: It's quite weird when I import cx_Oracle in python interactive shell, it works perfectly. but when I import cx_Oracle in a *,py script, handled by mod_python.publisher, it keep reportint : ImportError: libclntsh.so.10.1: cannot open shared object file: No such file or directory Can I anyone have a clue what's the matter, any help would be appreciated! That's an Oracle error, it means that you didn't set and export LD_LIBRARY_PATH like this: export LD_LIBRARY_PATH=$ORACLE_HOME/lib This is how it normally works: mgog...@nycwxp2622:~$ python Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15) [GCC 4.4.1] on linux2 Type help, copyright, credits or license for more information. import cx_Oracle And this is what happens when I unset the shell variable: mgog...@nycwxp2622:~$ unset LD_LIBRARY_PATH mgog...@nycwxp2622:~$ python Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15) [GCC 4.4.1] on linux2 Type help, copyright, credits or license for more information. import cx_Oracle Traceback (most recent call last): File stdin, line 1, in module ImportError: libclntsh.so.11.1: cannot open shared object file: No such file or directory My cx_Oracle is linked against Oracle instant client 11.2 on Ubuntu. -- http://mgogala.byethost5.com -- http://mail.python.org/mailman/listinfo/python-list
mod_python and css
Hi all, the mod_python mailing list is pretty dead so I thought I'd try asking my question here. I am using mod_python and am having trouble with my .py scripts that output HTML. the HTML comes out alright but my style sheets are not being rendered. I am sure that this has to do withe a mod handler problem. Here is what I have in httpd.conf: Directory /Library/WebServer/Documents/css AddHandler mod_python .css PythonHandler handler::handler_css PythonDebug On /Directory Here is what handler.py looks like: from mod_python import apache def _dump(req, extension): req.content_type = 'text/plain' print req, 'uri = %s' % req.uri print req, 'filename = %s' % req.filename print req, 'path_info = %s' % req.path_info print req, 'extension = %s' % extension return apache.OK def handler(req): return _dump(req, '') def handler_css(req): return _dump(req, '.css') Any ideas on what I'm doing wrong? -- Bradley J. Hintze Graduate Student Duke University School of Medicine 801-712-8799 -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python and css
On 06/24/2010 09:10 PM, Bradley Hintze wrote: Hi all, about your question, no idea. the mod_python mailing list is pretty dead so I thought I'd try asking my question here. It comes as no surprise to me that the mod_python mailing list is dead: nobody uses mod_python anymore. For all I know, it might be broken, and the API was (IIRC) never particularly nice. IMHO, you should use WSGI instead: it's an interface portable across web server boundaries, and, with mod_wsgi, it's just as high-performance on apache as was mod_python. I am using mod_python and am having trouble with my .py scripts that output HTML. the HTML comes out alright but my style sheets are not being rendered. I am sure that this has to do withe a mod handler problem. What does not being rendered mean? Do you have an exception traceback? Can you maybe a full transcript of HTTP headers and output? (by telnet'ing to the web server perhaps) Here is what I have in httpd.conf: Directory /Library/WebServer/Documents/css AddHandler mod_python .css PythonHandler handler::handler_css PythonDebug On /Directory Here is what handler.py looks like: from mod_python import apache def _dump(req, extension): req.content_type = 'text/plain' print req, 'uri = %s' % req.uri print req, 'filename = %s' % req.filename print req, 'path_info = %s' % req.path_info print req, 'extension = %s' % extension return apache.OK def handler(req): return _dump(req, '') def handler_css(req): return _dump(req, '.css') Any ideas on what I'm doing wrong? -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python and css
I had some issues with WSGI install. It was duious at best as it failed and seemed very unstable. Is this a trusted application? On Thu, Jun 24, 2010 at 3:19 PM, Thomas Jollans tho...@jollans.com wrote: On 06/24/2010 09:10 PM, Bradley Hintze wrote: Hi all, about your question, no idea. the mod_python mailing list is pretty dead so I thought I'd try asking my question here. It comes as no surprise to me that the mod_python mailing list is dead: nobody uses mod_python anymore. For all I know, it might be broken, and the API was (IIRC) never particularly nice. IMHO, you should use WSGI instead: it's an interface portable across web server boundaries, and, with mod_wsgi, it's just as high-performance on apache as was mod_python. I am using mod_python and am having trouble with my .py scripts that output HTML. the HTML comes out alright but my style sheets are not being rendered. I am sure that this has to do withe a mod handler problem. What does not being rendered mean? Do you have an exception traceback? Can you maybe a full transcript of HTTP headers and output? (by telnet'ing to the web server perhaps) Here is what I have in httpd.conf: Directory /Library/WebServer/Documents/css AddHandler mod_python .css PythonHandler handler::handler_css PythonDebug On /Directory Here is what handler.py looks like: from mod_python import apache def _dump(req, extension): req.content_type = 'text/plain' print req, 'uri = %s' % req.uri print req, 'filename = %s' % req.filename print req, 'path_info = %s' % req.path_info print req, 'extension = %s' % extension return apache.OK def handler(req): return _dump(req, '') def handler_css(req): return _dump(req, '.css') Any ideas on what I'm doing wrong? -- http://mail.python.org/mailman/listinfo/python-list -- Bradley J. Hintze Graduate Student Duke University School of Medicine 801-712-8799 -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python and css
If you send back a content type of text/plain, your output will not be rendered as HTML by a browser; it will just be displayed as plain text. Try text/html. John Nagle On 6/24/2010 12:19 PM, Thomas Jollans wrote: On 06/24/2010 09:10 PM, Bradley Hintze wrote: Hi all, about your question, no idea. the mod_python mailing list is pretty dead so I thought I'd try asking my question here. It comes as no surprise to me that the mod_python mailing list is dead: nobody uses mod_python anymore. For all I know, it might be broken, and the API was (IIRC) never particularly nice. IMHO, you should use WSGI instead: it's an interface portable across web server boundaries, and, with mod_wsgi, it's just as high-performance on apache as was mod_python. I am using mod_python and am having trouble with my .py scripts that output HTML. the HTML comes out alright but my style sheets are not being rendered. I am sure that this has to do withe a mod handler problem. What does not being rendered mean? Do you have an exception traceback? Can you maybe a full transcript of HTTP headers and output? (by telnet'ing to the web server perhaps) Here is what I have in httpd.conf: Directory /Library/WebServer/Documents/css AddHandler mod_python .css PythonHandler handler::handler_css PythonDebug On /Directory Here is what handler.py looks like: from mod_python import apache def _dump(req, extension): req.content_type = 'text/plain' print req, 'uri = %s' % req.uri print req, 'filename = %s' % req.filename print req, 'path_info = %s' % req.path_info print req, 'extension = %s' % extension return apache.OK def handler(req): return _dump(req, '') def handler_css(req): return _dump(req, '.css') Any ideas on what I'm doing wrong? -- http://mail.python.org/mailman/listinfo/python-list
Configuring apache to execute python scripts using mod_python handler
I configured apache to execute python scripts using mod_python handler. I followed below mentioned steps to configure apache. 1. In http.conf I added Directory D:/softwares/Apache2.2/htdocs AddHandler mod_python .py PythonHandler mptest PythonDebug On /Directory 2. Then I added the line LoadModule python_module modules/ mod_python.so to http.conf. Then I tried execute the python script mentioned below from browser. from mod_python import apache def handler(req): req.content_type = 'text/plain' req.write(Hello World!) return apache.OK Then I am getting the following error Traceback (most recent call last): File D:\softwares\Python25\Lib\site-packages\mod_python \importer.py, line 1537, in HandlerDispatch default=default_handler, arg=req, silent=hlist.silent) File D:\softwares\Python25\Lib\site-packages\mod_python \importer.py, line 1202, in _process_target module = import_module(module_name, path=path) File D:\softwares\Python25\Lib\site-packages\mod_python \importer.py, line 304, in import_module return __import__(module_name, {}, {}, ['*']) ImportError: No module named mptest I am using Apache 2.2.4, python 2.5 and mod_python-3.3.1.win32-py2.5- Apache2.2. I am able to execute python scripts by configuring apache to execute the cgi scripts. But I want to execute it using mod_python as it is faster compared to cgi mode. Someone please help me on this issue. -- http://mail.python.org/mailman/listinfo/python-list
Re: Configuring apache to execute python scripts using mod_python handler
On Fri, 12 Feb 2010 13:08:59 -0400, Juan Carlos Rodriguez wrote: Hello Juan Carlos, You're better off raising this on the mod_python list, however... Python is looking for a module called mptest, and cannot find it. Have you created the mptest.py module? (It should contain the handler function in your item (2)). Is it on the python path used by the webserver? See for example the last post at http://forums.devshed.com/apache-development-15/installing-python-on-apache-42184.html which shows how you can set up the path. Cheers, Kev -- http://mail.python.org/mailman/listinfo/python-list
Re: CGI vs mod_python
On Wed, Nov 11, 2009 at 3:32 PM, Dave Angel da...@ieee.org wrote: Victor Subervi wrote: snip The problem was not CGI. It turned out to be line-endings being mangled by Windoze and __invisible __ in my unix editor. Lovely. Thanks anyway, V That's twice you've blamed Windows for the line-ending problem. Windows didn't create those crlf endings, your text editor did. If your editor can't control that, you could try a different one. Komodo for example can do it either way, or it can preserve whatever is being used in the loaded file. Similarly metapad, in spite of its huge simplicity, lets you decide, and can convert an existing file in either direction. And I'm a great believer in visible control characters. I configure Komodo to show me spaces in the lines, so I can see whether it's a tab or a space. It can also be configured to show end-of-line characters, so I presume that'd work here. See whether your Unix editor can show you this sort of thing. Finally, many FTP programs can be told to automatically convert line-endings when transferring text files. There's probably some risk that it'll mangle a non-text file, but it's worth considering. Wonderful, wonderful. I'll take both of those pieces of advice. Thank you. V -- http://mail.python.org/mailman/listinfo/python-list
Re: CGI vs mod_python
On Tue, Nov 10, 2009 at 6:12 PM, John Nagle na...@animats.com wrote: sstein...@gmail.com wrote: On Nov 9, 2009, at 10:18 AM, Victor Subervi wrote: Yes, obviously. But if CGI is enabled, it should work anyway, should it not? Depends on what CGI is enabled means. Usually, web servers are not set to just handle cgi scripts from anywhere, but only from specific file system locations. Otherwise, an an anonymous upload could be executed as CGI and wreak havoc. If it won't work as a CGI program, which is relatively straightforward, it probably won't work at all. First, write some trivial CGI program in Python and make sure the environment works - Python loads, the Python program loads, and you can get a response back. Bear in mind that most hosting services don't make much of an attempt to support Python. Expect important libraries to be missing or obsolete. The problem was not CGI. It turned out to be line-endings being mangled by Windoze and __invisible __ in my unix editor. Lovely. Thanks anyway, V -- http://mail.python.org/mailman/listinfo/python-list
Re: CGI vs mod_python
Victor Subervi wrote: snip The problem was not CGI. It turned out to be line-endings being mangled by Windoze and __invisible __ in my unix editor. Lovely. Thanks anyway, V That's twice you've blamed Windows for the line-ending problem. Windows didn't create those crlf endings, your text editor did. If your editor can't control that, you could try a different one. Komodo for example can do it either way, or it can preserve whatever is being used in the loaded file. Similarly metapad, in spite of its huge simplicity, lets you decide, and can convert an existing file in either direction. And I'm a great believer in visible control characters. I configure Komodo to show me spaces in the lines, so I can see whether it's a tab or a space. It can also be configured to show end-of-line characters, so I presume that'd work here. See whether your Unix editor can show you this sort of thing. Finally, many FTP programs can be told to automatically convert line-endings when transferring text files. There's probably some risk that it'll mangle a non-text file, but it's worth considering. DaveA -- http://mail.python.org/mailman/listinfo/python-list
Re: CGI vs mod_python
sstein...@gmail.com wrote: On Nov 9, 2009, at 10:18 AM, Victor Subervi wrote: Yes, obviously. But if CGI is enabled, it should work anyway, should it not? Depends on what CGI is enabled means. Usually, web servers are not set to just handle cgi scripts from anywhere, but only from specific file system locations. Otherwise, an an anonymous upload could be executed as CGI and wreak havoc. If it won't work as a CGI program, which is relatively straightforward, it probably won't work at all. First, write some trivial CGI program in Python and make sure the environment works - Python loads, the Python program loads, and you can get a response back. Bear in mind that most hosting services don't make much of an attempt to support Python. Expect important libraries to be missing or obsolete. John Nagle -- http://mail.python.org/mailman/listinfo/python-list
CGI vs mod_python
Hi; I've been told by a server farm that they're having trouble getting my scripts to work because they're written with cgi calls as opposed to mod_python. Is there a basis for their complaint? These pages serve fine on another server. TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list
Re: CGI vs mod_python
On Nov 9, 2009, at 9:32 AM, Victor Subervi wrote: Hi; I've been told by a server farm that they're having trouble getting my scripts to work because they're written with cgi calls as opposed to mod_python. Is there a basis for their complaint? These pages serve fine on another server. Does the server they're working fine on use CGI? Yes, they're different. S -- http://mail.python.org/mailman/listinfo/python-list
Re: CGI vs mod_python
Yes, obviously. But if CGI is enabled, it should work anyway, should it not? V On Mon, Nov 9, 2009 at 9:46 AM, sstein...@gmail.com sstein...@gmail.comwrote: On Nov 9, 2009, at 9:32 AM, Victor Subervi wrote: Hi; I've been told by a server farm that they're having trouble getting my scripts to work because they're written with cgi calls as opposed to mod_python. Is there a basis for their complaint? These pages serve fine on another server. Does the server they're working fine on use CGI? Yes, they're different. S -- http://mail.python.org/mailman/listinfo/python-list
Re: CGI vs mod_python
On Nov 9, 2009, at 10:18 AM, Victor Subervi wrote: Yes, obviously. But if CGI is enabled, it should work anyway, should it not? Depends on what CGI is enabled means. Usually, web servers are not set to just handle cgi scripts from anywhere, but only from specific file system locations. Otherwise, an an anonymous upload could be executed as CGI and wreak havoc. And it should work anyway, should it not is already answered by they're having trouble getting my scripts to work. S -- http://mail.python.org/mailman/listinfo/python-list
Re: CGI vs mod_python
Uuuuh. Thanks! V On Mon, Nov 9, 2009 at 10:45 AM, sstein...@gmail.com sstein...@gmail.comwrote: On Nov 9, 2009, at 10:41 AM, Victor Subervi wrote: On Mon, Nov 9, 2009 at 10:29 AM, sstein...@gmail.com sstein...@gmail.comwrote: On Nov 9, 2009, at 10:18 AM, Victor Subervi wrote: Yes, obviously. But if CGI is enabled, it should work anyway, should it not? Depends on what CGI is enabled means. Usually, web servers are not set to just handle cgi scripts from anywhere, but only from specific file system locations. Otherwise, an an anonymous upload could be executed as CGI and wreak havoc. Of course, yes. And it should work anyway, should it not is already answered by they're having trouble getting my scripts to work. They're having _all_sorts_of_trouble_ getting my scripts to work, not just this issue. These scripts worked fine on another server. I don't understand what the problems are, and I'm trying to parameterize. Gotcha. Do you have access to and have you given them the old httpd.conf? That could certainly give them some clues about what's different. Also, there is (on apache 2.x+ anyway) a whole directory tree full of included files that get sucked in as the configuration is getting built so that whole tree would give them everything they would need (if they know how to work from it which they should if they're running a server farm). S -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python: Permission denied
Thanks Graham. Let me contact Admin. -- http://mail.python.org/mailman/listinfo/python-list
mod_python: Permission denied
Hello, I googled online however I did not find a clue my question. So I post it here. I created a mod_python CGI to upload a file and saves it in folder / var/www/keyword-query/files/. My code runs in root. fileitem = req.form['file'] # Test if the file was uploaded if fileitem.filename: # strip leading path from file name to avoid directory traversal attacks fname = os.path.basename(fileitem.filename) # build absolute path to files directory dir_path = os.path.join(os.path.dirname(req.filename), 'files') f = open(os.path.join(dir_path, fname), 'wb', 1) # Read the file in chunks for chunk in fbuffer(fileitem.file): f.write(chunk) f.close() message = 'The file %s was uploaded successfully' % fname I got: File /var/www/keyword-query/upload.py, line 30, in upload f = open(os.path.join(dir_path, fname), 'wb', 1) IOError: [Errno 13] Permission denied: '/var/www/keyword-query/files/ Defrosting.rtf' Defrosting.rtf is a file on the desktop of my Windows XP computer. Anybody knows what the problem is? Thanks for your replies. -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python: Permission denied
On Aug 26, 8:43 am, David ww...@yahoo.com wrote: Hello, I googled online however I did not find a clue my question. So I post it here. I created a mod_python CGI to upload a file and saves it in folder / var/www/keyword-query/files/. My code runs in root. fileitem = req.form['file'] # Test if the file was uploaded if fileitem.filename: # strip leading path from file name to avoid directory traversal attacks fname = os.path.basename(fileitem.filename) # build absolute path to files directory dir_path = os.path.join(os.path.dirname(req.filename), 'files') f = open(os.path.join(dir_path, fname), 'wb', 1) # Read the file in chunks for chunk in fbuffer(fileitem.file): f.write(chunk) f.close() message = 'The file %s was uploaded successfully' % fname I got: File /var/www/keyword-query/upload.py, line 30, in upload f = open(os.path.join(dir_path, fname), 'wb', 1) IOError: [Errno 13] Permission denied: '/var/www/keyword-query/files/ Defrosting.rtf' Defrosting.rtf is a file on the desktop of my Windows XP computer. Anybody knows what the problem is? Thanks for your replies. Apache service likely running as a special user which doesn't have write permission to your directory. Graham -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python: Permission denied
A little more info: Defrosting.rtf is a file that I wanted to upload. This file was supposed to upload to folder '/var/www/keyword- query/files/'. My code runs in root. -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python: Permission denied
disclaimer: i did not write this code. i copied it and inserted into my cgi code. it is from http://webpython.codepoint.net/mod_python_publisher_big_file_upload. -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python: Permission denied
On Aug 25, 4:00 pm, David ww...@yahoo.com wrote: Thanks Graham. Let me contact Admin. Hi Graham: you are right. it's fixed now. Thanks again. -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python and xml.dom.minidom
Were you getting this issue with xml.dom showing on first request all the time, or only occasionally occurring? If the latter, were you running things in a multithreaded configuration and was the server being loaded with lots of concurrent requests? It was the former. For your particular Python installation, does the '_xmlplus' module exist? Ie., can you import it as '_xmlplus' or 'xml.doc._xmlplus'? No, it appears I don't have _xmlplus; neither 'import _xmlplus' nor 'import xml.doc._xmlplus' works. My python installation is the default which came with debian 5.0 (i.e., I didn't build it from source with unorthodox configuration options, or use apt). As a final note, I wound up switching to cElementTree for parsing the xml (not only for performance but also because the code is much more concise), and I found that I don't need a full package path with that module. I.e, the import statement is: from cElementTree import ElementTree, Element, SubElement, iterparse, tostring, fromstring and within each function I can simply refer to Element, SubElement, etc. w/o the full path prefix. -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python and xml.dom.minidom
On May 12, 1:59 am, dpapathanasiou denis.papathanas...@gmail.com wrote: For the record, and in case anyone else runs into this particular problem, here's how resolved it. My original xml_utils.py was written this way: from xml.dom import minidom def parse_item_attribute (item, attribute_name): item_doc = minidom.parseString(item) ... That version worked under the python interpreter, but failed under both mod_python andmod_wsgiapache modules with an error (Parent module 'xml.dom' not loaded). I found that changing the import statement and the minidom reference within the function resolved the problem. I.e., after rewriting xml_utils.py this way, it works under both apache modules as well as in the python interpreter: import xml.dom.minidom def parse_item_attribute (item, attribute_name): item_doc = xml.dom.minidom.parseString(item) ... FWIW, have just seen someone else raising an issue where something caused problems unless a full package path was used. In that case it was the 'email' package. The common thing between these two packages is that they do funny stuff with sys.modules as part of import. For 'email' package it is implementing some sort of lazy loader and aliasing thing to support old names. For 'xml.dom' it seems to replace the current module with a C extension variant on the fly if the C extension exists. Were you getting this issue with xml.dom showing on first request all the time, or only occasionally occurring? If the latter, were you running things in a multithreaded configuration and was the server being loaded with lots of concurrent requests? For your particular Python installation, does the '_xmlplus' module exist? Ie., can you import it as '_xmlplus' or 'xml.doc._xmlplus'? Graham -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python and xml.dom.minidom
His problem is therefore likely to be something completely different. You are correct. As per the earlier advice, I switched from mod_python to mod_wsgi but I still see the same error: [Mon May 11 10:30:21 2009] [notice] Apache/2.2.11 (Unix) mod_wsgi/2.4 Python/2.5.2 configured -- resuming normal operations [Mon May 11 10:30:26 2009] [error] Traceback (most recent call last): [Mon May 11 10:30:26 2009] [error] File ../db/items_db.py, line 38, in lambda [Mon May 11 10:30:26 2009] [error] db_object.associate(sdb_object, (lambda primary_key, primary_data:xml_utils.parse_item_attribute (primary_data, attribute))) [Mon May 11 10:30:26 2009] [error] File ../common/xml_utils.py, line 80, in parse_item_attribute [Mon May 11 10:30:26 2009] [error] item_doc = minidom.parseString (item) [Mon May 11 10:30:26 2009] [error] File /usr/lib/python2.5/xml/dom/ minidom.py, line 1924, in parseString [Mon May 11 10:30:26 2009] [error] from xml.dom import expatbuilder [Mon May 11 10:30:26 2009] [error] SystemError: Parent module 'xml.dom' not loaded [Mon May 11 10:30:26 2009] [error] Traceback (most recent call last): [Mon May 11 10:30:26 2009] [error] File ../db/items_db.py, line 38, in lambda [Mon May 11 10:30:26 2009] [error] db_object.associate(sdb_object, (lambda primary_key, primary_data:xml_utils.parse_item_attribute (primary_data, attribute))) [Mon May 11 10:30:26 2009] [error] File ../common/xml_utils.py, line 80, in parse_item_attribute [Mon May 11 10:30:26 2009] [error] item_doc = minidom.parseString (item) [Mon May 11 10:30:26 2009] [error] File /usr/lib/python2.5/xml/dom/ minidom.py, line 1924, in parseString [Mon May 11 10:30:26 2009] [error] from xml.dom import expatbuilder [Mon May 11 10:30:26 2009] [error] SystemError: Parent module 'xml.dom' not loaded The odd thing is that when xml_utils.py is run outside of either apache module, xml.dom does load, and the minidom parsing works. I'm not sure why this is happening, but the next thing I'll do is try replacing minidom with ElementTree, and see if that has any issues running under either apache module. -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python and xml.dom.minidom
For the record, and in case anyone else runs into this particular problem, here's how resolved it. My original xml_utils.py was written this way: from xml.dom import minidom def parse_item_attribute (item, attribute_name): item_doc = minidom.parseString(item) ... That version worked under the python interpreter, but failed under both mod_python and mod_wsgi apache modules with an error (Parent module 'xml.dom' not loaded). I found that changing the import statement and the minidom reference within the function resolved the problem. I.e., after rewriting xml_utils.py this way, it works under both apache modules as well as in the python interpreter: import xml.dom.minidom def parse_item_attribute (item, attribute_name): item_doc = xml.dom.minidom.parseString(item) ... -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python and xml.dom.minidom
On May 10, 3:40 am, Paul Boddie p...@boddie.org.uk wrote: On 9 Mai, 01:36, dpapathanasiou denis.papathanas...@gmail.com wrote: Apache's configure utility (I'm using httpd version 2.2.11) doesn't explicitly describe an expat library option. Also, if libexpat is version 1.95.2, wouldn't I have to get version 2.0 to be compatible with pyexpat? The aim would be to persuade Apache to configure itself against the same Expat library that pyexpat is using, which would involve the headers and libraries referenced during the pyexpat configuration process, although I seem to recall something about pyexpat bundling its own version of Expat - that would complicate matters somewhat. If anyone has any advice or suggestions, I'd appreciate hearing them. Expat might be getting brought into Apache via mod_dav: http://www.webdav.org/mod_dav/install.html Perhaps disabling mod_dav when configuring Apache might drop Expat from Apache's library dependencies. The OP was using Python 2.5, so shouldn't be an issue because pyexpat properly name space prefixes its version of expat. See: http://code.google.com/p/modwsgi/wiki/IssuesWithExpatLibrary where explicitly says that only applies to Python prior to Python 2.5. His problem is therefore likely to be something completely different. Graham -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python and xml.dom.minidom
On 9 Mai, 01:36, dpapathanasiou denis.papathanas...@gmail.com wrote: Apache's configure utility (I'm using httpd version 2.2.11) doesn't explicitly describe an expat library option. Also, if libexpat is version 1.95.2, wouldn't I have to get version 2.0 to be compatible with pyexpat? The aim would be to persuade Apache to configure itself against the same Expat library that pyexpat is using, which would involve the headers and libraries referenced during the pyexpat configuration process, although I seem to recall something about pyexpat bundling its own version of Expat - that would complicate matters somewhat. If anyone has any advice or suggestions, I'd appreciate hearing them. Expat might be getting brought into Apache via mod_dav: http://www.webdav.org/mod_dav/install.html Perhaps disabling mod_dav when configuring Apache might drop Expat from Apache's library dependencies. Paul -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python and xml.dom.minidom
My only advice is, don't use mod_python. The project is dead, you should use mod_wsgi instead: http://code.google.com/p/modwsgi/ To echo what Daniel said, mod_wsgi is really the way to go. It might still not work in embedded mode where like mod_python the Python interpreter is in the Apache instance thus there might be binary linking conflicts, but you can use it in daemon mode where it launches external python processes and passes requests back and forth through them. That's not as slow as it sounds too :) Also maybe check out lxml or ElementTree (cElementTree); minidom is about *the* slowest way to parse XML in Python I believe. And is terribly unpythonic-- which may be why you made xml_utils, I dunno. Check out lxml/ElementTree :) --S -- http://mail.python.org/mailman/listinfo/python-list
mod_python and xml.dom.minidom
I wrote a python script called xml_utils.py which parses xml using minidom. It works when it's run on its own, but when I try to import it and run it inside a mod_python handler, I get this error: File ../common/xml_utils.py, line 80, in parse_item_attribute File /usr/lib/python2.5/xml/dom/minidom.py, line 1924, in parseString from xml.dom import expatbuilder SystemError: Parent module 'xml.dom' not loaded Basically, it's the same problem I found in this post: http://mail.python.org/pipermail/python-list/2007-January/424018.html This site (http://www.dscpl.com.au/wiki/ModPython/Articles/ ExpatCausingApacheCrash) goes through a detailed explanation, and I found that the version of pyexpat is newer than libexpat: # ldd /usr/local/apache2/bin/httpd | grep expat libexpat.so.0 = /usr/local/apache2/lib/libexpat.so.0 (0xb7f71000) # strings /usr/local/apache2/lib/libexpat.so.0 | grep expat_ expat_1.95.2 $ python Python 2.5.2 (r252:60911, Jan 4 2009, 17:40:26) [GCC 4.3.2] on linux2 Type help, copyright, credits or license for more information. import pyexpat pyexpat.version_info (2, 0, 0) But this is where I'm stuck: the article suggests recompiling apache with the newer version of expat. Apache's configure utility (I'm using httpd version 2.2.11) doesn't explicitly describe an expat library option. Also, if libexpat is version 1.95.2, wouldn't I have to get version 2.0 to be compatible with pyexpat? If anyone has any advice or suggestions, I'd appreciate hearing them. -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python and xml.dom.minidom
On 5/8/09, dpapathanasiou denis.papathanas...@gmail.com wrote: I wrote a python script called xml_utils.py which parses xml using minidom. It works when it's run on its own, but when I try to import it and run it inside a mod_python handler, I get this error: File ../common/xml_utils.py, line 80, in parse_item_attribute File /usr/lib/python2.5/xml/dom/minidom.py, line 1924, in parseString from xml.dom import expatbuilder SystemError: Parent module 'xml.dom' not loaded Basically, it's the same problem I found in this post: http://mail.python.org/pipermail/python-list/2007-January/424018.html This site (http://www.dscpl.com.au/wiki/ModPython/Articles/ ExpatCausingApacheCrash) goes through a detailed explanation, and I found that the version of pyexpat is newer than libexpat: # ldd /usr/local/apache2/bin/httpd | grep expat libexpat.so.0 = /usr/local/apache2/lib/libexpat.so.0 (0xb7f71000) # strings /usr/local/apache2/lib/libexpat.so.0 | grep expat_ expat_1.95.2 $ python Python 2.5.2 (r252:60911, Jan 4 2009, 17:40:26) [GCC 4.3.2] on linux2 Type help, copyright, credits or license for more information. import pyexpat pyexpat.version_info (2, 0, 0) But this is where I'm stuck: the article suggests recompiling apache with the newer version of expat. Apache's configure utility (I'm using httpd version 2.2.11) doesn't explicitly describe an expat library option. Also, if libexpat is version 1.95.2, wouldn't I have to get version 2.0 to be compatible with pyexpat? If anyone has any advice or suggestions, I'd appreciate hearing them. My only advice is, don't use mod_python. The project is dead, you should use mod_wsgi instead: http://code.google.com/p/modwsgi/ Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python and xml.dom.minidom
Daniel Fetchinson wrote: On 5/8/09, dpapathanasiou wrote: I wrote a python script called xml_utils.py which parses xml using minidom. My only advice is, don't use mod_python. The project is dead, you should use mod_wsgi instead: http://code.google.com/p/modwsgi/ Now that we're at it anyway: don't use minidom, either. It's rather slow and very memory expensive. The stdlib comes with ElementTree since Python 2.5. http://effbot.org/zone/celementtree.htm#benchmarks Stefan -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python form upload: permission denied sometimes...
In message 0fc15bee-003a-45ca- b6b6-21ed0645b...@q2g2000vbr.googlegroups.com, psaff...@googlemail.com wrote: I have a mod_python application that takes a POST file upload from a form. It works fine from my machine, other machines in my office and my home machine. It does not work from my bosses machine in a different city - he gets You don't have permission to access this on this server. In the logs, it's returned 403. I also have this error in error.log: Cannot traverse upload in /pythonapps/wiggle/form/upload because function form at 0x7fe7568e31b8 is not a traversable object, referer: ... Sounds like a bug in your code. Have you tried uploading a smaller file? What's different about the setup on your boss's machine? OS? Browser? Addons? -- http://mail.python.org/mailman/listinfo/python-list
mod_python form upload: permission denied sometimes...
I have a mod_python application that takes a POST file upload from a form. It works fine from my machine, other machines in my office and my home machine. It does not work from my bosses machine in a different city - he gets You don't have permission to access this on this server. In the logs, it's returned 403. I also have this error in error.log: Cannot traverse upload in /pythonapps/wiggle/form/upload because function form at 0x7fe7568e31b8 is not a traversable object, referer: ... Could this be a network level problem? If so, why does it work from my home machine but not my bosses machine?? The file to upload is quite large - 7MB. -- http://mail.python.org/mailman/listinfo/python-list
[mod_python] Knowing the encoding of the URI
Hello everybody. I am using mod_python, and I am confronted with a problem I don't know how to solve in an elegant way... The problem is that I don't know what is the encoding of the req.unparsed_uri strings... My script runs in China, and I receive requests coded in both utf-8 and gb18030 encoding... The way I handle that is the following: uri = req.unparsed_uri try: uri_utf8 = uri.decode(utf-8).encode(utf-8) found_encoding = (uri_utf8 == uri) except: found_encoding = False if not found_encoding: uri_gb18030 = try: uri_gb18030 = uri.decode(gb18030).encode(gb18030) found_encoding = (uri_gb18030 == uri) except: found_encoding = False if found_encoding: uri = uri.decode(gb18030).encode(utf-8) else: raise ### Failed to find encoding for uri '%s'... % (uri) I am not very pleased by that. So, is there a way to know in which encoding the unparsed_uri is coded? Is there a better way to determine the encoding? I noticed the content_encoding member of the request, but it is always set to None... Thanks for your attention, Daniel -- http://mail.python.org/mailman/listinfo/python-list
Mod_python, jsonrpc and sessions
Hi, I've got a python web-application being served by apache via mod_python, in which the users sessions are tracked via the mod_python Session module. Some of websites generated contain a java-script function which starts a jsonrpc call to the same server and gets further data or stores something to a database (AJAX). The server-sided jsonrpc functions are written in python as ServiceMethods. As I need to identify the user issuing the rpc call, I'm wondering if there is any possibility to access the session created by the previosly called mod_python Handler-method. In mod_python it is accessed using the mod_python request object, but in the rpc servicemethod I don't have such an object. So how can I track the rpc caller? Any ideas and hints appreciated. Peter -- http://mail.python.org/mailman/listinfo/python-list
Mod_python, jsonrpc and sessions
Hi, I've got a python web-application being served by apache via mod_python, in which the users sessions are tracked via the mod_python Session module. Some of websites generated contain a java-script function which starts a jsonrpc call to the same server and gets further data or stores something to a database (AJAX). The server-sided jsonrpc functions are written in python as ServiceMethods. As I need to identify the user issuing the rpc call, I'm wondering if there is any possibility to access the session created by the previosly called mod_python Handler-method. In mod_python it is accessed using the mod_python request object, but in the rpc servicemethod I don't have such an object. So how can I track the rpc caller? Any ideas and hints appreciated. Peter -- http://mail.python.org/mailman/listinfo/python-list
Re: Mod_python, jsonrpc and sessions
On Jan 14, 4:47 pm, p3dda.a...@googlemail.com wrote: Hi, I've got a python web-application being served by apache via mod_python, in which the users sessions are tracked via the mod_python Session module. Some of websites generated contain a java-script function which starts a jsonrpc call to the same server and gets further data or stores something to a database (AJAX). The server-sided jsonrpc functions are written in python as ServiceMethods. As I need to identify the user issuing the rpc call, I'm wondering if there is any possibility to access the session created by the previosly called mod_python Handler-method. In mod_python it is accessed using the mod_python request object, but in the rpc servicemethod I don't have such an object. So how can I track the rpc caller? the only way to store session info reliably is: cookies. therefore, the code in one part of the application _will_ have to store a session cookie as an identifier, and you can track the name of that cookie through the source code that created it. or look in the source code for anything beginning with the word session. grep - ril is your friend. also, if the app stores its session authentication information in a database, you can look through the app for the database table name. if you don't _know_ the database table name, and are having difficulty finding out because the design of the app is SHITE then you can do a dump of the database _before_ a session login, and a dump afterwards, and then diff is your friend. if the database is mysql, add --extended-insert=no (something like that) to the mysqldump command otherwise you will have a bitch-awful job identifying the right line. i've done this when working with fricking-joomla, integrating it with django. fireboard. i had to hunt through the php code looking for the database user-session. once you have the session info, that's your user tracking function in the rpc calls. none of the above is particularly rocket science - or actually anything to do with python: it's a simple matter of applying investigative techniques logically working from how the technology _should_ work and then bludgeoning it into submission to tell you what the hell's going on. l. -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python: delay in files changing after alteration
On 6 Jan, 23:31, Graham Dumpleton graham.dumple...@gmail.com wrote: Thus, any changes to modules/packages installed on sys.path require a full restart of Apache to ensure they are loaded by all Apache child worker processes. That will be it. I'm pulling in some libraries of my own from elsewhere, which are still being modified to accommodate the web app. These are the changes that are causing the problems. An Apache restart isn't too onerous - I'll just start doing that. Thanks, Peter -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python: delay in files changing after alteration
On Jan 6, 2:39 am, psaff...@googlemail.com psaff...@googlemail.com wrote: Maybe this is an apache question, in which case apologies. I am runningmod_python3.3.1-3 on apache 2.2.9-7. It works fine, but I find that when I alter a source file during development, it sometimes takes 5 seconds or so for the changes to be seen. This might sound trivial, but when debugging tens of silly errors, it's annoying that I have to keep hitting refresh on my browser waiting for the change to take. I'm guessing this is just a caching issue of some kind, but can't figure out how to switch it off. Any suggestions? The entry in my apache2.conf looks like this: Directory /var/www/pythonapps SetHandlermod_python PythonHandlermod_python.publisher PythonDebug On /Directory If the change is to a Python module installed on sys.path the change would never be reloaded by a process. If you are seeing a delay, it is probably only because the request is being handled by a different Apache child process that has never loaded the code before. This is all because Apache is a multiprocess web server on UNIX. Thus, any changes to modules/packages installed on sys.path require a full restart of Apache to ensure they are loaded by all Apache child worker processes. So, which code files are you actually modifying, ie., where do they exist and how are they imported? Graham -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python: delay in files changing after alteration
I have never noticed any such delay. After making a change I just hit F5 on my browser and its fine. Maybe its a browser issue On 1/5/09, psaff...@googlemail.com psaff...@googlemail.com wrote: Maybe this is an apache question, in which case apologies. I am running mod_python 3.3.1-3 on apache 2.2.9-7. It works fine, but I find that when I alter a source file during development, it sometimes takes 5 seconds or so for the changes to be seen. This might sound trivial, but when debugging tens of silly errors, it's annoying that I have to keep hitting refresh on my browser waiting for the change to take. I'm guessing this is just a caching issue of some kind, but can't figure out how to switch it off. Any suggestions? The entry in my apache2.conf looks like this: Directory /var/www/pythonapps SetHandler mod_python PythonHandler mod_python.publisher PythonDebug On /Directory Thanks, Peter -- http://mail.python.org/mailman/listinfo/python-list -- Sent from Gmail for mobile | mobile.google.com -- http://mail.python.org/mailman/listinfo/python-list
mod_python: delay in files changing after alteration
Maybe this is an apache question, in which case apologies. I am running mod_python 3.3.1-3 on apache 2.2.9-7. It works fine, but I find that when I alter a source file during development, it sometimes takes 5 seconds or so for the changes to be seen. This might sound trivial, but when debugging tens of silly errors, it's annoying that I have to keep hitting refresh on my browser waiting for the change to take. I'm guessing this is just a caching issue of some kind, but can't figure out how to switch it off. Any suggestions? The entry in my apache2.conf looks like this: Directory /var/www/pythonapps SetHandler mod_python PythonHandler mod_python.publisher PythonDebug On /Directory Thanks, Peter -- http://mail.python.org/mailman/listinfo/python-list
Apache/mod_python: Registering a request handler dynamically
Hi, Is there a way to dynamically overwrite the request handler from within mod_python scripts? Something along those lines: --- from mod_python import apache def myhandler(request): request.content_type = 'text/plain' request.write('Hello world') apache.set_default_handler(myhandler) --- I specifically want to avoid changing the Apache directive, as this code is supposed to function in a place where the user has no permission to override the Apache directive. The reason is that I am trying to hide the difference between different environments (such as mod_python or CGI) from the developer, such that the following is possible: --- #!/usr/bin/python import os, os.path os.chdir(os.path.dirname(__file__)) from PleaseHideMyEnvironment import RequestHandler def index(request): request.write('Hello World') RequestHandler(index) --- So at the time at which RequestHandler() is created, I need a way to make sure that mod_python calls to the RequestHandler instead of the normal handler, whenever a new request is made. Any idea? -Samuel -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python resources
On Dec 20, 2:47 pm, Anjanesh Lekshminarayanan m...@anjanesh.net wrote: Same requirement here. But isnt there any mod_python for Python 3.0 ? Or do we need to build it from source ourselves ? I was hoping there would bemod_wsgibinaries for Python 3.0. At this stage it looks like there will not be a mod_python for Python 3.0. If you want the ability to run Python embedded in Apache like mod_python did, use a framework that can host on top of WSGI and host it on mod_wsgi instead. The version of mod_wsgi in subversion repository already supports Python 3.0. Graham -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python resources
Here's my problem (it's a conceptual one). Coming from the world of mod_php, each file can represent a page with no intervention. I was not able to achieve the same with mod_python when I tried, and for that matter, couldn't put the pieces together in a usable way. Let me start simply: If I wanted to create a trivial site, (Home, About, Contact) with a header and footer included, in PHP, it would be done as such: each page (index.php, about.php, contact.php) includes the template bits (header.php, footer.php). Is this simplicity achievable using Python? And by simplicity, I'm referring to simplicity in execution; not necessarily an identical approach. Thanks, Thomas On Dec 17, 4:25 am, Graham Dumpleton graham.dumple...@gmail.com wrote: On Dec 17, 11:10 am, Дамјан Георгиевски gdam...@gmail.com wrote: I'm trying again because I'm stubborn. Maybe the fourth time will be the charm... Are there any good tutorials out there for setting up Apache with mod_python? mod_python is depreceated, nobody uses it. usemod_wsgihttp://www.modwsgi.org/ The mod_python package is not deprecated, although it could be said to be sleeping at the moment. You'll also probably still find that more new people choose mod_python over mod_wsgi. This is because it has the more obvious name to look for when Googling. It also has publisher and PSP high level handler which are still attractive to many as they are more lightweight and easier to get into than the large WSGI frameworks. Finally, the Django folks still recommend in their documentation to use mod_python. Anyway, if wanting to host a WSGI capable application, using mod_wsgi would be the more obvious choice. If wanting to write your own framework, or work at low level, basing it on WSGI rather than mod_python specific APIs would certainly be a better long term direction to take. Graham -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python resources
Here's my problem (it's a conceptual one). Coming from the world of mod_php, each file can represent a page with no intervention. I was not able to achieve the same with mod_python when I tried, and for that matter, couldn't put the pieces together in a usable way. Let me start simply: If I wanted to create a trivial site, (Home, About, Contact) with a header and footer included, in PHP, it would be done as such: each page (index.php, about.php, contact.php) includes the template bits (header.php, footer.php). Is this simplicity achievable using Python? And by simplicity, I'm referring to simplicity in execution; not necessarily an identical approach. Yes, it is possible. As already advised by several posters, reading the documentation actually helps. You may want to have a look at: http://www.modpython.org/live/current/doc-html/pyapi-psp.html The spyce project you may also find helpful: http://spyce.sourceforge.net/ Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python resources
Same requirement here. But isnt there any mod_python for Python 3.0 ? Or do we need to build it from source ourselves ? I was hoping there would be mod_wsgi binaries for Python 3.0. -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python resources
On Dec 17, 11:10 am, Дамјан Георгиевски gdam...@gmail.com wrote: I'm trying again because I'm stubborn. Maybe the fourth time will be the charm... Are there any good tutorials out there for setting up Apache with mod_python? mod_python is depreceated, nobody uses it. usemod_wsgihttp://www.modwsgi.org/ The mod_python package is not deprecated, although it could be said to be sleeping at the moment. You'll also probably still find that more new people choose mod_python over mod_wsgi. This is because it has the more obvious name to look for when Googling. It also has publisher and PSP high level handler which are still attractive to many as they are more lightweight and easier to get into than the large WSGI frameworks. Finally, the Django folks still recommend in their documentation to use mod_python. Anyway, if wanting to host a WSGI capable application, using mod_wsgi would be the more obvious choice. If wanting to write your own framework, or work at low level, basing it on WSGI rather than mod_python specific APIs would certainly be a better long term direction to take. Graham -- http://mail.python.org/mailman/listinfo/python-list
mod_python resources
I'm trying again because I'm stubborn. Maybe the fourth time will be the charm... Are there any good tutorials out there for setting up Apache with mod_python? Thanks, Thomas -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python resources
On Tue, Dec 16, 2008 at 8:22 PM, tmallen thomasmal...@gmail.com wrote: Are there any good tutorials out there for setting up Apache with mod_python? Apart from the (clear and concise) information in the mod_python documentation? Starts here: http://www.modpython.org/live/current/doc-html/installation.html Compiling is as easy as: $ ./configure --with-apxs=/usr/local/apache/bin/apxs $ make $ sudo make install (if you have sudo) Configuring Apache is as easy as adding the lines in the apache config file: LoadModule python_module libexec/mod_python.so Alias /py /somedirectory Directory /somedirectory AllowOverride None Order allow,deny Allow from all AddHandler mod_python .py PythonHandler mod_python.publisher PythonDebug On /Directory That's about it.. For testing, continue reading the mod_python manual. -- a lex 13 x http://www.a13x.info -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python resources
I'm trying again because I'm stubborn. Maybe the fourth time will be the charm... Are there any good tutorials out there for setting up Apache with mod_python? mod_python is depreceated, nobody uses it. use mod_wsgi http://www.modwsgi.org/ -- дамјан ( http://softver.org.mk/damjan/ ) Today we create the legacy of tomorrow. -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python and files directory
On Monday 08 December 2008 10:31:28 Gabriel Genellina wrote: os.path.dirname(os.path.abspath(__file__)) thanks a lot it's working. -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python and files directory
En Sat, 06 Dec 2008 09:26:40 -0200, mete [EMAIL PROTECTED] escribió: but i want to take it somewhere else...i want to it work some other path in other system. os.path.dirname(os.path.abspath(__file__)) returns the directory where the current file resides. Execute it early in your code. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python and files directory
En Sat, 06 Dec 2008 09:26:40 -0200, mete [EMAIL PROTECTED] escribió: but i want to take it somewhere else...i want to it work some other path in other system. os.path.dirname(os.path.abspath(__file__)) returns the directory where the current file resides. Execute it early in your code. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python and files directory
On Dec 6, 1:52 am, mete bilgin [EMAIL PROTECTED] wrote: Hi all, I try to make a websevice with python and mod_python. İ try to make a po files, but i can not reach them in the page. When i ask the page like os.listdir('.') but i want to get files directory, what can i do? sorry for my bad describe of that. Thanks a lot... The current working directory in Apache can be anything. You must supply an absolute path to all directories/files you are trying to access/use. Graham -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python and files directory
but i want to take it somewhere else...i want to it work some other path in other system. On Saturday 06 December 2008 12:34:07 Graham Dumpleton wrote: On Dec 6, 1:52 am, mete bilgin [EMAIL PROTECTED] wrote: Hi all, I try to make a websevice with python and mod_python. İ try to make a po files, but i can not reach them in the page. When i ask the page like os.listdir('.') but i want to get files directory, what can i do? sorry for my bad describe of that. Thanks a lot... The current working directory in Apache can be anything. You must supply an absolute path to all directories/files you are trying to access/use. Graham -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
mod_python and files directory
Hi all, I try to make a websevice with python and mod_python. İ try to make a po files, but i can not reach them in the page. When i ask the page like os.listdir('.') but i want to get files directory, what can i do? sorry for my bad describe of that. Thanks a lot... -- http://mail.python.org/mailman/listinfo/python-list
Re: Apache mod_python: I don't receive anything with POST method
On 26 nov, 23:22, Graham Dumpleton [EMAIL PROTECTED] wrote: On Nov 27, 12:21 am, [EMAIL PROTECTED] wrote: Hi, I'm using a simple form to make possible the users of our site upload files. html headmeta http-equiv=Content-Type content=text/html; charset=iso-8859-1/head body form method=post enctype=multipart/form-data action=/ws/ upload.py/ input name=upfile type=file size=50/br input type=submit value=send/ /form /body /html The upload.py looks like this: from mod_python import apache, util; def index(req): form = util.FieldStorage(req, keep_blank_values=1) try: # form is empty here # return form -- I get {} ufile = form.get('upfile', None) if not form.has_key('upfile'): return :( No 'upfile' key # some checks. I never get beyond here ufile = form['upfile'] if ufile.file: return ufile.file.name else: return :( It's not a file except Exception, e: return 'Fail: ' + str(e) I'm getting an empty 'form'. No 'upfile' key at all. I've tried to add some other text fields but the result is the same: empty. If I use GET method with text fields, it works properly. Currently I'm using: Apache 2.2.9 (initially I used Apache 2.2.3 too) mod_python 3.3.1 (initially I used mod_python 3.2.10 too) Python 2.5.2 Which is the correct result for the code you are using. The problem is that you appear to be using mod_python.publisher which does its own form handling before you are even getting a chance, thus it is consuming the request content. For how to handle forms in mod_python.publisher see: http://webpython.codepoint.net/mod_python_publisher_forms Graham Hi, I should get a non-empty form. With the following html html headmeta http-equiv=Content-Type content=text/html; charset=iso-8859-1/head body form method=get action=/ws/upload.py/ input type=text name=some_text size=50/br input type=submit value=enviar/ /form /body /html ...and the following upload.py: from mod_python import util, apache def index(req): form = util.FieldStorage(req, keep_blank_values=1) try: some_text = form.get('some_text', None); return form.items except Exception, e: return 'Fail: ' + str(e) ...I get (writting Python in the text box) [('some_text', Field('some_text', 'Python'))] So, I have a form with a non-empty structure of (key, value), and I'm able to get the value I'm looking for: ... some_text = form.get('some_text', None) # It's not empty anymore ... Thanks León -- http://mail.python.org/mailman/listinfo/python-list
Re: Apache mod_python: I don't receive anything with POST method
On 27 nov, 15:13, [EMAIL PROTECTED] wrote: On 26 nov, 23:22, Graham Dumpleton [EMAIL PROTECTED] wrote: On Nov 27, 12:21 am, [EMAIL PROTECTED] wrote: Hi, I'm using a simple form to make possible the users of our site upload files. html headmeta http-equiv=Content-Type content=text/html; charset=iso-8859-1/head body form method=post enctype=multipart/form-data action=/ws/ upload.py/ input name=upfile type=file size=50/br input type=submit value=send/ /form /body /html The upload.py looks like this: from mod_python import apache, util; def index(req): form = util.FieldStorage(req, keep_blank_values=1) try: # form is empty here # return form -- I get {} ufile = form.get('upfile', None) if not form.has_key('upfile'): return :( No 'upfile' key # some checks. I never get beyond here ufile = form['upfile'] if ufile.file: return ufile.file.name else: return :( It's not a file except Exception, e: return 'Fail: ' + str(e) I'm getting an empty 'form'. No 'upfile' key at all. I've tried to add some other text fields but the result is the same: empty. If I use GET method with text fields, it works properly. Currently I'm using: Apache 2.2.9 (initially I used Apache 2.2.3 too) mod_python 3.3.1 (initially I used mod_python 3.2.10 too) Python 2.5.2 Which is the correct result for the code you are using. The problem is that you appear to be using mod_python.publisher which does its own form handling before you are even getting a chance, thus it is consuming the request content. For how to handle forms in mod_python.publisher see: http://webpython.codepoint.net/mod_python_publisher_forms Graham Hi, I should get a non-empty form. With the following html html headmeta http-equiv=Content-Type content=text/html; charset=iso-8859-1/head body form method=get action=/ws/upload.py/ input type=text name=some_text size=50/br input type=submit value=enviar/ /form /body /html ...and the following upload.py: from mod_python import util, apache def index(req): form = util.FieldStorage(req, keep_blank_values=1) try: some_text = form.get('some_text', None); return form.items except Exception, e: return 'Fail: ' + str(e) ...I get (writting Python in the text box) [('some_text', Field('some_text', 'Python'))] So, I have a form with a non-empty structure of (key, value), and I'm able to get the value I'm looking for: ... some_text = form.get('some_text', None) # It's not empty anymore ... Thanks León I got an alternative solution here http://codepoint.net/index.php/topic,118.msg507.html#msg507 Regards -- http://mail.python.org/mailman/listinfo/python-list
Apache mod_python: I don't receive anything with POST method
Hi, I'm using a simple form to make possible the users of our site upload files. html headmeta http-equiv=Content-Type content=text/html; charset=iso-8859-1/head body form method=post enctype=multipart/form-data action=/ws/ upload.py/ input name=upfile type=file size=50/br input type=submit value=send/ /form /body /html The upload.py looks like this: from mod_python import apache, util; def index(req): form = util.FieldStorage(req, keep_blank_values=1) try: # form is empty here # return form -- I get {} ufile = form.get('upfile', None) if not form.has_key('upfile'): return :( No 'upfile' key # some checks. I never get beyond here ufile = form['upfile'] if ufile.file: return ufile.file.name else: return :( It's not a file except Exception, e: return 'Fail: ' + str(e) I'm getting an empty 'form'. No 'upfile' key at all. I've tried to add some other text fields but the result is the same: empty. If I use GET method with text fields, it works properly. Currently I'm using: Apache 2.2.9 (initially I used Apache 2.2.3 too) mod_python 3.3.1 (initially I used mod_python 3.2.10 too) Python 2.5.2 Thanks Best regards, León -- http://mail.python.org/mailman/listinfo/python-list
Re: Apache mod_python: I don't receive anything with POST method
On Nov 27, 12:21 am, [EMAIL PROTECTED] wrote: Hi, I'm using a simple form to make possible the users of our site upload files. html headmeta http-equiv=Content-Type content=text/html; charset=iso-8859-1/head body form method=post enctype=multipart/form-data action=/ws/ upload.py/ input name=upfile type=file size=50/br input type=submit value=send/ /form /body /html The upload.py looks like this: from mod_python import apache, util; def index(req): form = util.FieldStorage(req, keep_blank_values=1) try: # form is empty here # return form -- I get {} ufile = form.get('upfile', None) if not form.has_key('upfile'): return :( No 'upfile' key # some checks. I never get beyond here ufile = form['upfile'] if ufile.file: return ufile.file.name else: return :( It's not a file except Exception, e: return 'Fail: ' + str(e) I'm getting an empty 'form'. No 'upfile' key at all. I've tried to add some other text fields but the result is the same: empty. If I use GET method with text fields, it works properly. Currently I'm using: Apache 2.2.9 (initially I used Apache 2.2.3 too) mod_python 3.3.1 (initially I used mod_python 3.2.10 too) Python 2.5.2 Which is the correct result for the code you are using. The problem is that you appear to be using mod_python.publisher which does its own form handling before you are even getting a chance, thus it is consuming the request content. For how to handle forms in mod_python.publisher see: http://webpython.codepoint.net/mod_python_publisher_forms Graham -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python and file not found
Simo D wrote: Hello, I'm trying to configure the apache to handle the python scripts. My platform is a CentOs server. I wrote these directives in the conf.d/python.conf: Directory /var/www/html/my/dir Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all AddHandler mod_python .py PythonHandler mod_python.publisher PythonDebug On /Directory The results are that if the script writes something on the server it works fine but if the script contains only html like this: print Content-type: text/html\n print html print body print pok/p print /body print /html it returns url not found on this server. It seems that I can't send info back to the browser. Can you help me? Thanks a lot. Simone In the mod_python environment you aren't expected to write to standard output. How you create your output will depend on the way you have set mod_python up to handle requests. In your case, using the Publisher handler, you should return the HTML you want to see in your browser: see http://webpython.codepoint.net/mod_python_publisher_hello_world for a simple example. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list
mod_python and file not found
Hello, I'm trying to configure the apache to handle the python scripts. My platform is a CentOs server. I wrote these directives in the conf.d/python.conf: Directory /var/www/html/my/dir Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all AddHandler mod_python .py PythonHandler mod_python.publisher PythonDebug On /Directory The results are that if the script writes something on the server it works fine but if the script contains only html like this: print Content-type: text/html\n print html print body print pok/p print /body print /html it returns url not found on this server. It seems that I can't send info back to the browser. Can you help me? Thanks a lot. Simone -- View this message in context: http://www.nabble.com/mod_python-and-file-not-found-tp20417611p20417611.html Sent from the Python - python-list mailing list archive at Nabble.com. -- http://mail.python.org/mailman/listinfo/python-list
Mod_python permission denied
Hi, I'm using a script.py to write a file in a dir on the server. Mod_python work but i get: Mod_python error: PythonHandler mod_python.publisher Traceback (most recent call last): File /usr/lib64/python2.4/site-packages/mod_python/apache.py, line 299, in HandlerDispatch result = object(req) File /usr/lib64/python2.4/site-packages/mod_python/publisher.py, line 204, in handler module = page_cache[req] File /usr/lib64/python2.4/site-packages/mod_python/cache.py, line 82, in __getitem__ return self._checkitem(name)[2] File /usr/lib64/python2.4/site-packages/mod_python/cache.py, line 124, in _checkitem value = self.build(key, name, opened, entry) File /usr/lib64/python2.4/site-packages/mod_python/publisher.py, line 77, in build return ModuleCache.build(self, key, req, opened, entry) File /usr/lib64/python2.4/site-packages/mod_python/cache.py, line 371, in build exec opened in module.__dict__ File /var/www/html/flood/py/flood_pdf.py, line 18, in ? c.save() File /usr/lib64/python2.4/site-packages/reportlab/pdfgen/canvas.py, line 881, in save self._doc.SaveToFile(self._filename, self) File /usr/lib64/python2.4/site-packages/reportlab/pdfbase/pdfdoc.py, line 218, in SaveToFile f = open(filename, wb) IOError: [Errno 13] Permission denied: 'wms.pdf' The dir has the read, write and execute permissions and SELinux is disabled. Can you help me? Thanks in advance. Simone -- View this message in context: http://www.nabble.com/Mod_python-permission-denied-tp20377387p20377387.html Sent from the Python - python-list mailing list archive at Nabble.com. -- http://mail.python.org/mailman/listinfo/python-list
Re: Mod_python permission denied
Ok, solved: apache is unable to follow relative paths from the script. Putting ol absolute paths it's ok! Simo D wrote: Hi, I'm using a script.py to write a file in a dir on the server. Mod_python work but i get: Mod_python error: PythonHandler mod_python.publisher Traceback (most recent call last): File /usr/lib64/python2.4/site-packages/mod_python/apache.py, line 299, in HandlerDispatch result = object(req) File /usr/lib64/python2.4/site-packages/mod_python/publisher.py, line 204, in handler module = page_cache[req] File /usr/lib64/python2.4/site-packages/mod_python/cache.py, line 82, in __getitem__ return self._checkitem(name)[2] File /usr/lib64/python2.4/site-packages/mod_python/cache.py, line 124, in _checkitem value = self.build(key, name, opened, entry) File /usr/lib64/python2.4/site-packages/mod_python/publisher.py, line 77, in build return ModuleCache.build(self, key, req, opened, entry) File /usr/lib64/python2.4/site-packages/mod_python/cache.py, line 371, in build exec opened in module.__dict__ File /var/www/html/flood/py/flood_pdf.py, line 18, in ? c.save() File /usr/lib64/python2.4/site-packages/reportlab/pdfgen/canvas.py, line 881, in save self._doc.SaveToFile(self._filename, self) File /usr/lib64/python2.4/site-packages/reportlab/pdfbase/pdfdoc.py, line 218, in SaveToFile f = open(filename, wb) IOError: [Errno 13] Permission denied: 'wms.pdf' The dir has the read, write and execute permissions and SELinux is disabled. Can you help me? Thanks in advance. Simone -- View this message in context: http://www.nabble.com/Mod_python-permission-denied-tp20377387p20378315.html Sent from the Python - python-list mailing list archive at Nabble.com. -- http://mail.python.org/mailman/listinfo/python-list
mod_python and updated files
I have mod_python running on my server, but when I chance a Python file on the server, Apache needs to be restarted in order to have the changes take effect. I assume this is so mod_python can run persistently, but it's becoming quite a headache for development. Is there a way to turn off the persistence, or a way to force mod_python to compile and run the new version of the file? -- http://mail.python.org/mailman/listinfo/python-list
Re: mod_python and updated files
On Mon, 18 Aug 2008 09:16:13 -0700 (PDT), Aaron Scott [EMAIL PROTECTED] wrote: I have mod_python running on my server, but when I chance a Python file on the server, Apache needs to be restarted in order to have the changes take effect. I assume this is so mod_python can run persistently, but it's becoming quite a headache for development. Is there a way to turn off the persistence, or a way to force mod_python to compile and run the new version of the file? Add this to your Apache httpd.conf: MaxRequestsPerChild 1 Not something you want to leave set on a production server. Dan -- http://mail.python.org/mailman/listinfo/python-list
Getting mod_python to Work
Hi, all... I am hoping that someone can help me with the magic incantation to get mod_python working on my local machine. Set up: Apache 2.2.9, mod_python 3.3.1 on Windows Vista (yes, pity me). I've gotten the basic mptest.py handler to work with no problem. I am now trying to use the mod_python.publisher, but when I do, I get a 404 Not Found error for any file I try to access. If I switch back to my simple mptest,py handler, everything works fine. What do I need to do so that I can use the mod_python.publisher? Here is the relevant section from my httpd.conf file: LoadModule python_module modules/mod_python.so Directory C:\Program Files\Apache Software Foundation\Apache2.2\cgi- bin/ AddHandler mod_python .py #PythonHandler mptest --- works if I uncomment this line and comment next line PythonHandler mod_python.publisher PythonDebug On /Directory Many thanks, jpuopolo -- http://mail.python.org/mailman/listinfo/python-list
Re: Getting mod_python to Work
On Aug 5, 8:44 am, jpuopolo [EMAIL PROTECTED] wrote: Hi, all... I am hoping that someone can help me with the magic incantation to get mod_python working on my local machine. Set up: Apache 2.2.9, mod_python 3.3.1 on Windows Vista (yes, pity me). I've gotten the basic mptest.py handler to work with no problem. I am now trying to use the mod_python.publisher, but when I do, I get a 404 Not Found error for any file I try to access. If I switch back to my simple mptest,py handler, everything works fine. What do I need to do so that I can use the mod_python.publisher? Here is the relevant section from my httpd.conf file: LoadModule python_module modules/mod_python.so Directory C:\Program Files\Apache Software Foundation\Apache2.2\cgi- bin/ AddHandler mod_python .py #PythonHandler mptest --- works if I uncomment this line and comment next line PythonHandler mod_python.publisher PythonDebug On /Directory Many thanks,jpuopolo All: As it turns out, it was the URL I was using that made the difference - and the URL that worked was http://localhost/cgi-bin/helloworld.py/handler Note the /handler at the end of the URL --- this made all the difference. I found the answer here: http://mohitsuley.wordpress.com/2008/07/31/my-mod_python-101/ So, in summary, to have mod_python work: 1. Add the following to your httpd.conf file: #Start of section pasted in by YOURNAME LoadModule python_module modules/mod_python.so Directory C:\Program Files\Apache Software Foundation\Apache2.2\cgi- bin/ AddHandler mod_python .py PythonHandler mod_python.publisher PythonDebug On /Directory #End of section pasted in by YOURNAME I put this at the end of the other LoadModule entries in the httpd.conf file. 2. Save your httpd.conf file. 3. Restart Apache (either close/restart or restart the Windows service, depending on your configuration). 4. Ensure the URL to your .py files in your cgi-bin directory (or whatever directory you've configured, see above) end in /handler I hope this helps someone... Thank you, jpuopolo -- http://mail.python.org/mailman/listinfo/python-list
[issue2951] ElementTree parsing bus error (but only from mod_python)
Jack Diederich [EMAIL PROTECTED] added the comment: It is a common apache problem. Elementree imports an expat parser (presumably cElementree doesn't) and different versions of expat play together very poorly. Lots of apache modules load one xml lib version or another and they tend to step on each others toes .. and then segfault. IIRC the only way to resolve this is to figure out which loaded apache modules are using expat and recompile them all against the same version. Not fun. -- nosy: +jackdied resolution: - invalid status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2951 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Error importing modules with mod_python
On Jul 22, 3:30 am, Aaron Scott [EMAIL PROTECTED] wrote: I've installedmod_python, and everything seems to be working, but it fails when I try to import another file into the file that's actually producing the output. I have these lines at the top of index.py: frommod_pythonimport apache from storylab import * ... and in the directory where index.py resides (/htdocs/python/), I have a directory called storylab. Inside that directory is __init__.py. When I try to execute /htdocs/python/index.py, I get the following error: --- MOD_PYTHONERROR ProcessId: 828 Interpreter: 'localhost' ServerName: 'localhost' DocumentRoot: 'C:/htdocs' URI: '/python/index.py' Location: None Directory: 'C:/htdocs/python/' Filename: 'C:/htdocs/python/index.py' PathInfo: '' Phase: 'PythonHandler' Handler: 'index' Traceback (most recent call last): File C:\Python25\lib\site-packages\mod_python\importer.py, line 1537, in HandlerDispatch default=default_handler, arg=req, silent=hlist.silent) File C:\Python25\lib\site-packages\mod_python\importer.py, line 1202, in _process_target module = import_module(module_name, path=path) File C:\Python25\lib\site-packages\mod_python\importer.py, line 296, in import_module log, import_path) File C:\Python25\lib\site-packages\mod_python\importer.py, line 680, in import_module execfile(file, module.__dict__) File C:\htdocs\python\index.py, line 2, in module from storylab import * ImportError: No module named storylab --- What am I doing wrong? Any insight would be greatly appreciated. You can't put Python packages in same directory as handler scripts managed by mod_python. See documentation for import_module() in: http://www.modpython.org/live/current/doc-html/pyapi-apmeth.html Graham -- http://mail.python.org/mailman/listinfo/python-list
[issue2951] ElementTree parsing bus error (but only from mod_python)
nicodotti [EMAIL PROTECTED] added the comment: Thanks for logging this bug Kathy I had the same problem for 2 days! I used the cElementTree as you mentioned and it worked fine -- nosy: +nicodotti ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2951 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2951] ElementTree parsing bus error (but only from mod_python)
Benjamin Peterson [EMAIL PROTECTED] added the comment: This is probably a mod_python problem. -- nosy: +benjamin.peterson ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2951 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2951] ElementTree parsing bus error (but only from mod_python)
Kathy Van Stone [EMAIL PROTECTED] added the comment: Does ElementTree do anything unusual in importing? That is one area where mod_python is different from standard python. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2951 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Problem with MySQLdb and mod_python
On Jul 18, 3:28 pm, John Nagle [EMAIL PROTECTED] wrote: Cyril Bazin wrote: Thanks for your reply The apache log contains lines like : [Tue Jul 15 23:31:01 2008] [notice]mod_python(pid=11836, interpreter='www.toto.fr'):Importing module '/usr/local/apache2/htdocs/intranet/courrier/test.py' [Tue Jul 15 23:31:02 2008] [notice] child pid 11836 exit signal Segmentation fault (11) [Tue Jul 15 23:31:19 2008] [notice]mod_python(pid=11764, interpreter='www.toto.fr'):Importing module '/usr/local/apache2/htdocs/intranet/courrier/test.py' [Tue Jul 15 23:31:19 2008] [notice] child pid 11764 exit signal Segmentation fault (11) I think the problem comes from the MySQLdb module. If I can't find another solution, I think I will downgrade the MySQLdb version to 1.2.1 Sounds like version hell. mod_python and MySQLdb have to be compiled with exactly the same compiler for this to work. Use of compatible compilers applies to anything you want to use together. This is nothing specific to mod_python, so this comment is a bit misleading. These days with with GNU C everywhere, it is hardly and issue, and was usually only an issue with C++ code and not C code anyway. mod_python is usually troublesome. Python doesn't really have quite enough isolation to run multiple unrelated instances reliably. The isolation issue is nothing to do with Python itself. Isolation is an issue in this case, but most likely comes about because the OP is trying to use both PHP and mod_python together in the same Apache instance. In particular, the PHP package is likely loading a MySQL module and it is linked against a different version of the MySQL client libraries than what the Python MySQL package is wanting. People like to blame mod_python for these problems, but it can equally be attributed to PHP. In practice the reason it shows up as a mod_python issue is that PHP tries to preload a lot of stuff and so manages to load its version of shared libraries first. Python with its lazy loading comes in second, and so conflicts will occur. If mod_python preloaded stuff like PHP did and this was occurring before PHP got a chance, it would be the other way around and mod_python would work fine and PHP would instead be what crashes all the time. We use FCGI, which has the isolation of CGI but doesn't reload the application for every transaction. Also, it's easier to debug if CPython is crashing. With the reason that FCGI works being that the processes, even if they are spawned by Apache, use a fork/exec, thus meaning they have a clean memory space when starting up. In summary, look at what version of MySQL libraries are used by PHP modules and ensure that Python MySQL module is compiled against the same version. Graham -- http://mail.python.org/mailman/listinfo/python-list
Re: Problem with MySQLdb and mod_python
Thanks for your reply The apache log contains lines like : [Tue Jul 15 23:31:01 2008] [notice] mod_python (pid=11836, interpreter='www.toto.fr'): Importing module '/usr/local/apache2/htdocs/intranet/courrier/test.py' [Tue Jul 15 23:31:02 2008] [notice] child pid 11836 exit signal Segmentation fault (11) [Tue Jul 15 23:31:19 2008] [notice] mod_python (pid=11764, interpreter='www.toto.fr'): Importing module '/usr/local/apache2/htdocs/intranet/courrier/test.py' [Tue Jul 15 23:31:19 2008] [notice] child pid 11764 exit signal Segmentation fault (11) I think the problem comes from the MySQLdb module. If I can't find another solution, I think I will downgrade the MySQLdb version to 1.2.1 Cyril On Thu, Jul 17, 2008 at 7:27 AM, Lawrence D'Oliveiro [EMAIL PROTECTED] wrote: In message [EMAIL PROTECTED], Cyril Bazin wrote: But it seems, after many tests, that the script stops at the instruction : c.execute(requete) What's the error message? This should be in Apache's error_log file. -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: Problem with MySQLdb and mod_python
Cyril Bazin wrote: Thanks for your reply The apache log contains lines like : [Tue Jul 15 23:31:01 2008] [notice] mod_python (pid=11836, interpreter='www.toto.fr'): Importing module '/usr/local/apache2/htdocs/intranet/courrier/test.py' [Tue Jul 15 23:31:02 2008] [notice] child pid 11836 exit signal Segmentation fault (11) [Tue Jul 15 23:31:19 2008] [notice] mod_python (pid=11764, interpreter='www.toto.fr'): Importing module '/usr/local/apache2/htdocs/intranet/courrier/test.py' [Tue Jul 15 23:31:19 2008] [notice] child pid 11764 exit signal Segmentation fault (11) I think the problem comes from the MySQLdb module. If I can't find another solution, I think I will downgrade the MySQLdb version to 1.2.1 Sounds like version hell. mod_python and MySQLdb have to be compiled with exactly the same compiler for this to work. mod_python is usually troublesome. Python doesn't really have quite enough isolation to run multiple unrelated instances reliably. We use FCGI, which has the isolation of CGI but doesn't reload the application for every transaction. Also, it's easier to debug if CPython is crashing. John Nagle -- http://mail.python.org/mailman/listinfo/python-list
Problem with MySQLdb and mod_python
Hi, I installed an apache server with mod_python. I have got a problem with the mysql connection of my python script. In fact I tried this file : - import os os.environ[PYTHON_EGG_CACHE] = /tmp import MySQLdb from mod_python import apache def test(req): db=MySQLdb.connect(user=xxx,passwd=xxx,host=xxx.xxx,db=xxx) c = db.cursor() requete = SELECT * FROM document nbRows = c.execute(requete) req.write(Result : %s%repr(nbRows)) return apache.OK - But it seems, after many tests, that the script stops at the instruction : c.execute(requete) The script works if I am logged on the server as root or www. I use : - Python 2.4.4 (#1, Oct 23 2006, 13:58:00) [GCC 4.1.1 20061011 (Red Hat 4.1.1-30)] on linux2 Type help, copyright, credits or license for more information. import MySQLdb MySQLdb.__version__ '1.2.2' import mod_python mod_python.version '3.3.1' - If someone has any information that can help me... Thanks in advance, Cyril BAZIN -- http://mail.python.org/mailman/listinfo/python-list
mod_wsgi vs mod_python interfaces
Hi list, I remember red into this list that mod_wsgi is more faster than mod_python. Why ? WSIG it's only a true specification for deploy and performance Python applications running into web servers, mod python it's like mod wsgi but it's only a not official specification between Apache and Python aplications or frameworks. Therefore the real difference between both module are a kind of protocol/interface for talk with Python Aplication. mod_wsgi and mod_python are written in C and only how their internal data structures and memory managment and other issues can justify a different performance. Or WSGI interface it's more efficient than mod_python interface ? What do you think about this ? -- Pau Freixes Linux GNU/User -- http://mail.python.org/mailman/listinfo/python-list