473,396 Members | 2,009 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,396 software developers and data experts.

Weird cgi error

I uploaded the following script, called "test.py", to my webhost.
It works find except when I input the string "python ". Note that's
the word "python" followed by a space. If I submit that I get a 403
error. It seems to work fine with any other string.
What's going on here?

Here's the script in action: http://crookedgames.com/cgi-bin/test.py

Here's the code:

#!/usr/bin/python
print "Content-Type: text/html\n"
print """
<html>
<body>
<form action="test.py" method="post">
<textarea name="data">
</textarea>
<INPUT type="submit" value="Submit">
</form>
</body>
</html>
"""
Feb 25 '08 #1
6 997
Jesse Aldridge wrote:
>I uploaded the following script, called "test.py", to my webhost.
It works find except when I input the string "python ". Note that's
the word "python" followed by a space. If I submit that I get a 403
error. It seems to work fine with any other string.
What's going on here?

Here's the script in action: http://crookedgames.com/cgi-bin/test.py

Here's the code:

#!/usr/bin/python
print "Content-Type: text/html\n"
print """
<html>
<body>
<form action="test.py" method="post">
<textarea name="data">
</textarea>
<INPUT type="submit" value="Submit">
</form>
</body>
</html>
"""

If you cant have access to the apache (?) error_log, you can put this in
your code:
import cgitb
cgitb.enable()

Which should trap what is being writed on the error stream and put it on
the cgi output.

Gerardo
Feb 25 '08 #2
If you cant have access to the apache (?) error_log, you can put this in
your code:
import cgitb
cgitb.enable()

Which should trap what is being writed on the error stream and put it on
the cgi output.

Gerardo
I added that. I get no errors. It still doesn't work. Well, I do
get several errors about the missing favicon, but I'm pretty sure
that's unrelated.
Feb 25 '08 #3
On Feb 25, 11:42 am, Jesse Aldridge <JesseAldri...@gmail.comwrote:
If you cant have access to the apache (?) error_log, you can put this in
your code:
import cgitb
cgitb.enable()
Which should trap what is being writed on the error stream and put it on
the cgi output.
Gerardo

I added that. I get no errors. It still doesn't work. Well, I do
get several errors about the missing favicon, but I'm pretty sure
that's unrelated.
Oh, and yeah, the server's running Apache.
Feb 25 '08 #4
Jesse Aldridge wrote:
I uploaded the following script, called "test.py", to my webhost.
It works find except when I input the string "python ". Note that's
the word "python" followed by a space. If I submit that I get a 403
error. It seems to work fine with any other string.
What's going on here?

Here's the script in action: http://crookedgames.com/cgi-bin/test.py

Here's the code:

#!/usr/bin/python
print "Content-Type: text/html\n"
print """
<html>
<body>
<form action="test.py" method="post">
<textarea name="data">
</textarea>
<INPUT type="submit" value="Submit">
</form>
</body>
</html>
"""
This is some kind of crooked game, right? Your code works fine on a
local server, and there's no reason why it shouldn't work just fine on
yours either. All you are changing is the standard input to the process.

Since you claim to have spotted this specific error, perhaps you'd like
to explain just exactly how you came across it. I mean that's a pretty
specific input to test with ...

Frankly I am not sure you are telling the truth about the code behind
that page. If you *are* then you'd better provide specifics: Python
version, Apache version, httpd.conf file, and so on. April 1 is still
over a month away.

regards
Steve

PS: consider closing the <textareatag on the same line as the opening
tag to avoid spurious spaces in your pristine form.
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/

Feb 25 '08 #5
This is some kind of crooked game, right? Your code works fine on a
local server, and there's no reason why it shouldn't work just fine on
yours either. All you are changing is the standard input to the process.

Since you claim to have spotted this specific error, perhaps you'd like
to explain just exactly how you came across it. I mean that's a pretty
specific input to test with ...

Frankly I am not sure you are telling the truth about the code behind
that page. If you *are* then you'd better provide specifics: Python
version, Apache version, httpd.conf file, and so on. April 1 is still
over a month away.

regards
Steve

PS: consider closing the <textareatag on the same line as the opening
tag to avoid spurious spaces in your pristine form.
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
Thanks for the reply.

No, it's not a game, crookedgames.com is a mostly defunct games site
that I was working on for a while. I'm just hosting the script
there. What I am actually working on is a tool used to compare
various things. Check it out here: http://crookedgames.com/cgi-bin/Language_Comparison.py
Here's some input you can use to test with:

Cats
+2 Fuzzy
-1 Medium Maintenance

Fish
+1 Low Maintenance
-1 Stupid

Dogs
+2 Fuzzy
-2 High Maintenance

(note that there's supposed to be two spaces before the +/- symbols --
in case my formatting doesn't go through)

I originally created that tool because I wanted to compare programming
languages, python among them, thus leading me discover this issue.

Now, I'm very new to this web development stuff (this is my first real
app), so it's quite likely that I'm just doing something stupid, but I
can't figure out what.

I'm using LunarPages. CPanel reports my Apache version as: 1.3.37
(Unix)

I added the line "print sys.version" to the test script, and that
spits out: "2.3.4 (#1, Dec 11 2007, 05:27:57) [GCC 3.4.6 20060404 (Red
Hat 3.4.6-9)]"

I can't find any file called httpd.conf. It would be in /etc, right?
I guess I don't have one.

Still having the same problem.

Here's the new contents of test.py:

#!/usr/bin/python
import cgitb, sys
cgitb.enable()

print "Content-Type: text/html\n"
print sys.version
print """
<html>
<body>
<form action="test.py" method="post">
<textarea name="data"</textarea>
<input type="submit" value="Submit">
</form>
</body>
</html>
"""

It's not a joke, honest :)
Feb 25 '08 #6
>
>This is some kind of crooked game, right? Your code works fine on a
local server, and there's no reason why it shouldn't work just fine on
yours either. All you are changing is the standard input to the process.

Since you claim to have spotted this specific error, perhaps you'd like
to explain just exactly how you came across it. I mean that's a pretty
specific input to test with ...

Frankly I am not sure you are telling the truth about the code behind
that page. If you *are* then you'd better provide specifics: Python
version, Apache version, httpd.conf file, and so on. April 1 is still
over a month away.

regards
Steve

PS: consider closing the <textareatag on the same line as the opening
tag to avoid spurious spaces in your pristine form.
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/

Thanks for the reply.

No, it's not a game, crookedgames.com is a mostly defunct games site
that I was working on for a while. I'm just hosting the script
there. What I am actually working on is a tool used to compare
various things. Check it out here:
http://crookedgames.com/cgi-bin/Language_Comparison.py
Here's some input you can use to test with:

Cats
+2 Fuzzy
-1 Medium Maintenance

Fish
+1 Low Maintenance
-1 Stupid

Dogs
+2 Fuzzy
-2 High Maintenance

(note that there's supposed to be two spaces before the +/- symbols --
in case my formatting doesn't go through)

I originally created that tool because I wanted to compare programming
languages, python among them, thus leading me discover this issue.

Now, I'm very new to this web development stuff (this is my first real
app), so it's quite likely that I'm just doing something stupid, but I
can't figure out what.

I'm using LunarPages. CPanel reports my Apache version as: 1.3.37
(Unix)

I added the line "print sys.version" to the test script, and that
spits out: "2.3.4 (#1, Dec 11 2007, 05:27:57) [GCC 3.4.6 20060404 (Red
Hat 3.4.6-9)]"

I can't find any file called httpd.conf. It would be in /etc, right?
I guess I don't have one.

Still having the same problem.

Here's the new contents of test.py:

#!/usr/bin/python
import cgitb, sys
cgitb.enable()

print "Content-Type: text/html\n"
print sys.version
print """
<html>
<body>
<form action="test.py" method="post">
<textarea name="data"</textarea>
<input type="submit" value="Submit">
</form>
</body>
</html>
"""

It's not a joke, honest :)
--
It just doesnt make sense to me. I guess we all agree that is not a python
problem, because that code does actually nothing but showing the form.

Feb 25 '08 #7

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

Similar topics

3
by: redneck_kiwi | last post by:
Hi all: I have a really weird problem. I am developing a customer catalog system for my company and as such have delved into sessions for authentication and access levels. So far, I have managed...
5
by: NanQuan | last post by:
I'm hoping someone can help me solve this error since I am at a total loss here. Usually I don't bother posting on any forums or groups on the internet and prefer to solve stuff myself but this is...
1
by: amit | last post by:
I am trying to compile the sample program genwin.sqc, using nsqlprep which is used to precompile embedded sql in C. I am getting weird errors and that is because windows.h is included in the...
2
by: Kathy Houtami | last post by:
Hi there I've been encountered with weird compile error using Access 97. The error message is "Member or data member is not found" and it highlighted a line of code that has not be changed and...
6
by: gh0st54 | last post by:
Hi I have a weird javascript error that only happens on my live server when i open the page http://www.imrated.co.uk/reg.aspx i get the error 'Problems with this page ... blablabla Line : 3...
0
by: Alan Silver | last post by:
Hello, I have two weird problems here. I have a master page file that works absolutely fine. When I load it up in VWD, I get a couple of weird (to me) errors. First, I get the error...
0
by: P Pulkkinen | last post by:
Dear all, sorry, i know this code is far little too long to debug here, but there is really annoying logical error. If someone debugs this, I really offer warm virtual handshake. What this...
7
by: dtschoepe | last post by:
Hi, I am working on a project for school and I am trying to get my head around something weird. I have a function setup which is used to get an input from stdin and a piece of memory is created...
6
by: =?Utf-8?B?amVmZmVyeQ==?= | last post by:
i need help with a combo box and this same code works on my first tab with a combo box. The error or problem i have is this code causes an index out of range error when i run it on my second combo...
4
by: d3vkit | last post by:
I recently had a friend pass along some web work for me; a simple update. I for some reason decided I would do some overhauling of the page (he had been doing straight html and I figured some php...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.