473,385 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Odd error by mod_python

I have mod_python 2.7.10 running with python 2.3.4 and am getting an odd
error. The error is happening on the production machine, and not on my
development machine.

I am using the publisher handler and am calling the index function with this
code:
----------------------------------
from mod_python import apache
import random

def index(req):
return "hello world"
--------------------------------------
I am getting the following error:
----------------------------------------
File
"/usr/local/python/lib/python2.3/site-packages/mod_python/publisher.py",
line 130, in handler
module = apache.import_module(module_name, _req, [path])

File "/usr/local/python/lib/python2.3/site-packages/mod_python/apache.py",
line 335, in import_module
module = imp.load_module(mname, f, p, d)

File "/var/www/html/test.py", line 2, in ?
import random

File "/usr/local/python/lib/python2.3/random.py", line 54, in ?
LOG4 = _log(4.0)

ValueError: (84, 'Invalid or incomplete multibyte or wide character')
------------------------------------------------

Does anybody know what may cause this? I have searched the error in google
and have little success. I am thinking it is some sort of encoding error
or something, but I don't know why this is only happening in production.

Note that this error is only occuring when I import the random module, and
if I comment that out everything works fine. However I need the random
module for some of my other code.

Also if I run the following from the command line it works fine:
-------------------------------------------------
import random
print "hello world"
-------------------------------------------------

I don't know if it matters but I am running:
apache 1.3.27
redhat 7.2

Thanks,

Charliek

Jul 18 '05 #1
0 965

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Lorenz Köhl | last post by:
hi, I've python 2.3 and apache 2.0.47 installed on my SuSE8.2. when trying to compile modpython into apache, make stops with the error ---- In file included from...
0
by: Armand Federico - INFO | last post by:
I received an error when i try htmlgen on winxp, apapche, mysql, mod_python THIS IS THE ERROR Mod_python error: "PythonHandler mod_python.publisher" Traceback (most recent call last): File...
4
by: Michele Petrazzo | last post by:
I'm using PyChart like a module for create charts into a little web site, but when I try to create one, I have this error: /var/www/html/lgt/draw.py:19, in draw: can =...
0
by: Julien Cigar | last post by:
Hello, I'm using mod_python 3.1.3 with Apache 2.0.54 on a Debian box with the publisher handler and the Clearsilver template engine, and from time to time apache returns an 500 error code...
6
by: Anthony L. | last post by:
I am writing a web application that is comparable to a content management system used in blogging. I really want to use Python after having done some evaluation coding using Python 2.3.5 with...
5
by: m.banaouas | last post by:
Hi, bonjour, witch versions are suitable to use for apache & mod_python ? Can i install and use "Apache 2.2.3" & "mod_python 3.2.10" (most recent versions) without facing any known major...
3
by: Michael | last post by:
Hey everyone, Is it possible to automatically insert headers/footers using mod_python? I will be not be using PSP's, so I cannot use the PSP/include solution. Furthermore, the header will be...
1
by: deepak | last post by:
I installed apache 2.2.4 and modPython 3.3.1 on Fc6 while starting the apache server the following error occurs: httpd: Syntax error on line 54 of /usr/local/apache2/conf/httpd.conf: Cannot load...
2
by: Aaron Scott | last post by:
I've installed mod_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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.