From: Dean M. B. <mik...@gm...> - 2008-09-23 10:52:37
|
I've only now been able to run the localhost test scripts in Linux and after trying to remedy the situation on my own, I recognize that I don't have enough Python kung fu to deal with this. Apparently HTTP_ALL_HEADERS is not set when the echo_headers and echo_body script executes in Linux. Can we fix this before I merge to trunk and release 0.3? -- Dean Michael C. Berris Software Engineer, Friendster, Inc. |
From: K. G. <kim...@gm...> - 2008-09-23 11:39:18
|
Hi Dean, On Tue, Sep 23, 2008 at 12:52, Dean Michael Berris <mik...@gm...> wrote: > > Apparently HTTP_ALL_HEADERS is not set when the echo_headers and > echo_body script executes in Linux. Can you test from a regular browser on Linux, and see whether you get any output at all from echo_headers.py? I wonder if it's a line-ending thing again. - Kim |
From: Divye K. <div...@gm...> - 2008-09-23 16:37:15
|
Hello Dean, On Tue, Sep 23, 2008 at 4:22 PM, Dean Michael Berris <mik...@gm... > wrote: > I've only now been able to run the localhost test scripts in Linux and > after trying to remedy the situation on my own, I recognize that I > don't have enough Python kung fu to deal with this. > > Apparently HTTP_ALL_HEADERS is not set when the echo_headers and > echo_body script executes in Linux. > Do all python scripts in the cgi-bin directory have execute permissions for *all* users? I seem to remember that the linux version of CGIHTTPServer runs the CGI scripts with a uid of nobody and that might create permission issues in some cases. Also, are there any errors in the python log window? > > Can we fix this before I merge to trunk and release 0.3? > Hopefully yes, HTH, Divye -- An idealist is one who, on noticing that a rose smells better than a cabbage, concludes that it will also make better soup. H. L. Mencken (1880 - 1956) My official web site: http://people.iitr.ernet.in/shp/061305/ Webmaster: http://www.drkapoorsclinic.com Blog: http://divyekapoor.blogspot.com |
From: Glyn M. <gly...@gm...> - 2008-09-23 20:51:48
|
Hi, 2008/9/23 Divye Kapoor <div...@gm...> > > Do all python scripts in the cgi-bin directory have execute permissions for > *all* users? I seem to remember that the linux version of CGIHTTPServer runs > the CGI scripts with a uid of nobody and that might create permission issues > in some cases. Also, are there any errors in the python log window? > > This is the trace I get: localhost - - [23/Sep/2008 22:30:38] "GET / HTTP/1.0" 200 - localhost - - [23/Sep/2008 22:30:38] "GET / HTTP/1.0" 200 - localhost - - [23/Sep/2008 22:30:38] "GET /boost.jpg HTTP/1.0" 200 - localhost - - [23/Sep/2008 22:30:38] "GET /test.xml HTTP/1.0" 200 - localhost - - [23/Sep/2008 22:30:38] "GET /test.xml HTTP/1.0" 200 - localhost - - [23/Sep/2008 22:30:38] "GET /boost.jpg HTTP/1.0" 200 - localhost - - [23/Sep/2008 22:30:38] "GET /cgi-bin/requestinfo.py?query=1 HTTP/1.0" 200 - localhost - - [23/Sep/2008 22:30:38] "GET /cgi-bin/multiline-header.py?query=1 HTTP/1.0" 200 - localhost - - [23/Sep/2008 22:30:38] code 404, message File not found localhost - - [23/Sep/2008 22:30:38] "GET /file_not_found HTTP/1.0" 404 - localhost - - [23/Sep/2008 22:30:38] "HEAD /test.xml HTTP/1.0" 200 - localhost - - [23/Sep/2008 22:30:38] "POST /cgi-bin/echo_headers.py HTTP/1.0" 200 - Traceback (most recent call last): File "/usr/lib/python2.5/CGIHTTPServer.py", line 251, in run_cgi os.execve(scriptfile, args, os.environ) OSError: [Errno 13] Permission denied localhost - - [23/Sep/2008 22:30:38] CGI script exit status 0x7f00 Running 15 test cases... libs/network/test/localhost_tests.cpp(269): fatal error in "post_with_explicit_headers": exception thrown by r = c.post(req) localhost - - [23/Sep/2008 22:30:38] "POST /cgi-bin/echo_headers.py HTTP/1.0" 200 - Traceback (most recent call last): File "/usr/lib/python2.5/CGIHTTPServer.py", line 251, in run_cgi os.execve(scriptfile, args, os.environ) OSError: [Errno 13] Permission denied localhost - - [23/Sep/2008 22:30:38] CGI script exit status 0x7f00 libs/network/test/localhost_tests.cpp(287): fatal error in "post_with_implicit_headers": exception thrown by r = c.post(req, postdata) localhost - - [23/Sep/2008 22:30:38] "POST /cgi-bin/echo_headers.py HTTP/1.0" 200 - Traceback (most recent call last): File "/usr/lib/python2.5/CGIHTTPServer.py", line 251, in run_cgi os.execve(scriptfile, args, os.environ) OSError: [Errno 13] Permission denied localhost - - [23/Sep/2008 22:30:38] CGI script exit status 0x7f00 libs/network/test/localhost_tests.cpp(306): fatal error in "post_with_explicit_content_type": exception thrown by r = c.post(req, content_type, postdata) localhost - - [23/Sep/2008 22:30:38] "POST /cgi-bin/echo_body.py HTTP/1.0" 200 - Traceback (most recent call last): File "/usr/lib/python2.5/CGIHTTPServer.py", line 251, in run_cgi os.execve(scriptfile, args, os.environ) OSError: [Errno 13] Permission denied localhost - - [23/Sep/2008 22:30:38] CGI script exit status 0x7f00 libs/network/test/localhost_tests.cpp(324): fatal error in "post_body_default_content_type": exception thrown by r = c.post(req, postdata) localhost - - [23/Sep/2008 22:30:38] "POST /cgi-bin/echo_headers.py HTTP/1.0" 200 - Traceback (most recent call last): File "/usr/lib/python2.5/CGIHTTPServer.py", line 251, in run_cgi os.execve(scriptfile, args, os.environ) OSError: [Errno 13] Permission denied localhost - - [23/Sep/2008 22:30:38] CGI script exit status 0x7f00 libs/network/test/localhost_tests.cpp(339): fatal error in "post_with_custom_headers": exception thrown by r = c.post(req, std::string()) I think I missed why you're setting the HTTP_ALL_HEADERS environment variable. How is this supposed to work? Glyn |
From: Divye K. <div...@gm...> - 2008-09-23 21:05:12
|
On Wed, Sep 24, 2008 at 2:21 AM, Glyn Matthews <gly...@gm...>wrote: > Hi, > > 2008/9/23 Divye Kapoor <div...@gm...> > >> >> Do all python scripts in the cgi-bin directory have execute permissions >> for *all* users? I seem to remember that the linux version of CGIHTTPServer >> runs the CGI scripts with a uid of nobody and that might create permission >> issues in some cases. Also, are there any errors in the python log window? >> >> > > This is the trace I get: > <log snipped> > > > Traceback (most recent call last): > File "/usr/lib/python2.5/CGIHTTPServer.py", line 251, in run_cgi > os.execve(scriptfile, args, os.environ) > </log snipped> Permissions problem. Make sure that all cgi-bin scripts are world readable and world executable. Also, all directories in their path are world readable and executable. These scripts are accessed with a userid of "nobody" (uid usually ~65000) so the .py files have to be executable by the "others" permission group and the directory in which they are contained has to have permissions for "others" to access them. Basically you have to allow everybody to access them so that "nobody" can execute them. Rather a bad pun, I must say... :-) > > I think I missed why you're setting the HTTP_ALL_HEADERS environment > variable. How is this supposed to work? > HTTP_ALL_HEADERS is being set so that we can echo the headers back to the user in their raw form. The new http_server simply concatenates the headers received in the raw form into an env. variable before handing over processing to the python library's CGIHTTPServer. This env. variable is accessed in the echo_headers.py and echoed back to the client. > Glyn > > Hope that helped, Divye -- An idealist is one who, on noticing that a rose smells better than a cabbage, concludes that it will also make better soup. H. L. Mencken (1880 - 1956) My official web site: http://people.iitr.ernet.in/shp/061305/ Webmaster: http://www.drkapoorsclinic.com Blog: http://divyekapoor.blogspot.com |
From: Dean M. B. <mik...@gm...> - 2008-09-23 22:02:45
|
Hi Kim, On Tue, Sep 23, 2008 at 7:39 PM, Kim Gräsman <kim...@gm...> wrote: > Hi Dean, > > On Tue, Sep 23, 2008 at 12:52, Dean Michael Berris > <mik...@gm...> wrote: >> >> Apparently HTTP_ALL_HEADERS is not set when the echo_headers and >> echo_body script executes in Linux. > > Can you test from a regular browser on Linux, and see whether you get > any output at all from echo_headers.py? > > I wonder if it's a line-ending thing again. > I don't see how this is relevant though, it works fine with requestinfo.py -- why shouldn't it work in echo_headers and echo_body? -- Dean Michael C. Berris Software Engineer, Friendster, Inc. |
From: K. G. <kim...@gm...> - 2008-09-24 06:57:18
|
Hi Dean, On Wed, Sep 24, 2008 at 00:02, Dean Michael Berris <mik...@gm...> wrote: > On Tue, Sep 23, 2008 at 7:39 PM, Kim Gräsman <kim...@gm...> wrote: >> >> Can you test from a regular browser on Linux, and see whether you get >> any output at all from echo_headers.py? >> >> I wonder if it's a line-ending thing again. >> > > I don't see how this is relevant though, it works fine with > requestinfo.py -- why shouldn't it work in echo_headers and echo_body? I didn't mean the same line-ending issue as last time, but I figure the parsing of HTTP_ALL_HEADERS could be thrown if I made any Windows-specific assumptions about line endings. requestinfo.py doesn't use HTTP_ALL_HEADERS, so that's why it could differ... - Kim |
From: Dean M. B. <mik...@gm...> - 2008-09-23 22:08:06
|
Hi Divye, On Wed, Sep 24, 2008 at 12:37 AM, Divye Kapoor <div...@gm...> wrote: > Hello Dean, > > On Tue, Sep 23, 2008 at 4:22 PM, Dean Michael Berris > <mik...@gm...> wrote: >> >> I've only now been able to run the localhost test scripts in Linux and >> after trying to remedy the situation on my own, I recognize that I >> don't have enough Python kung fu to deal with this. >> >> Apparently HTTP_ALL_HEADERS is not set when the echo_headers and >> echo_body script executes in Linux. > > Do all python scripts in the cgi-bin directory have execute permissions for > *all* users? I seem to remember that the linux version of CGIHTTPServer runs > the CGI scripts with a uid of nobody and that might create permission issues > in some cases. Also, are there any errors in the python log window? > Yes, they do. Let me paste the log of the errors below: gcc.compile.c++ bin/gcc-4.2.3/debug/link-static/localhost_tests.o gcc.link bin/gcc-4.2.3/debug/link-static/localhost_tests testing.unit-test bin/gcc-4.2.3/debug/link-static/localhost_tests.passed localhost - - [24/Sep/2008 06:04:28] "GET / HTTP/1.0" 200 - localhost - - [24/Sep/2008 06:04:28] "GET / HTTP/1.0" 200 - localhost - - [24/Sep/2008 06:04:28] "GET /boost.jpg HTTP/1.0" 200 - localhost - - [24/Sep/2008 06:04:28] "GET /test.xml HTTP/1.0" 200 - localhost - - [24/Sep/2008 06:04:28] "GET /test.xml HTTP/1.0" 200 - localhost - - [24/Sep/2008 06:04:28] "GET /boost.jpg HTTP/1.0" 200 - localhost - - [24/Sep/2008 06:04:28] "GET /cgi-bin/requestinfo.py?query=1 HTTP/1.0" 200 - localhost - - [24/Sep/2008 06:04:28] "GET /cgi-bin/multiline-header.py?query=1 HTTP/1.0" 200 - localhost - - [24/Sep/2008 06:04:28] code 404, message File not found localhost - - [24/Sep/2008 06:04:28] "GET /file_not_found HTTP/1.0" 404 - localhost - - [24/Sep/2008 06:04:28] "HEAD /test.xml HTTP/1.0" 200 - localhost - - [24/Sep/2008 06:04:28] "POST /cgi-bin/echo_headers.py HTTP/1.0" 200 - Traceback (most recent call last): File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/echo_headers.py", line 17, in <module> hdrs = cgisupport.http_headers(os.environ.get('HTTP_ALL_HEADERS')) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 11, in __init__ self.parse(header_str) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 24, in parse self.headers = self.__parse_headers(header_str) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 31, in __parse_headers lines = str.split('\n') AttributeError: 'NoneType' object has no attribute 'split' localhost - - [24/Sep/2008 06:04:28] CGI script exit status 0x100 Running 15 test cases... localhost_tests.cpp(272): error in "post_with_explicit_headers": check headers["content-length"] == content_length failed [ != 5] localhost_tests.cpp(273): error in "post_with_explicit_headers": check headers["content-type"] == content_type failed [ != application/x-www-form-urlencoded] localhost - - [24/Sep/2008 06:04:28] "POST /cgi-bin/echo_headers.py HTTP/1.0" 200 - Traceback (most recent call last): File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/echo_headers.py", line 17, in <module> hdrs = cgisupport.http_headers(os.environ.get('HTTP_ALL_HEADERS')) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 11, in __init__ self.parse(header_str) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 24, in parse self.headers = self.__parse_headers(header_str) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 31, in __parse_headers lines = str.split('\n') AttributeError: 'NoneType' object has no attribute 'split' localhost - - [24/Sep/2008 06:04:28] CGI script exit status 0x100 localhost_tests.cpp(290): error in "post_with_implicit_headers": check headers["content-length"] == get_content_length(postdata) failed [ != 5] localhost_tests.cpp(291): error in "post_with_implicit_headers": check headers["content-type"] == "x-application/octet-stream" failed [ != x-application/octet-stream] localhost - - [24/Sep/2008 06:04:28] "POST /cgi-bin/echo_headers.py HTTP/1.0" 200 - Traceback (most recent call last): File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/echo_headers.py", line 17, in <module> hdrs = cgisupport.http_headers(os.environ.get('HTTP_ALL_HEADERS')) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 11, in __init__ self.parse(header_str) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 24, in parse self.headers = self.__parse_headers(header_str) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 31, in __parse_headers lines = str.split('\n') AttributeError: 'NoneType' object has no attribute 'split' localhost - - [24/Sep/2008 06:04:28] CGI script exit status 0x100 localhost_tests.cpp(309): error in "post_with_explicit_content_type": check headers["content-length"] == get_content_length(postdata) failed [ != 5] localhost_tests.cpp(310): error in "post_with_explicit_content_type": check headers["content-type"] == content_type failed [ != application/x-my-content-type] localhost - - [24/Sep/2008 06:04:28] "POST /cgi-bin/echo_body.py HTTP/1.0" 200 - localhost - - [24/Sep/2008 06:04:28] "POST /cgi-bin/echo_headers.py HTTP/1.0" 200 - Traceback (most recent call last): File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/echo_headers.py", line 17, in <module> hdrs = cgisupport.http_headers(os.environ.get('HTTP_ALL_HEADERS')) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 11, in __init__ self.parse(header_str) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 24, in parse self.headers = self.__parse_headers(header_str) File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", line 31, in __parse_headers lines = str.split('\n') AttributeError: 'NoneType' object has no attribute 'split' localhost - - [24/Sep/2008 06:04:28] CGI script exit status 0x100 localhost_tests.cpp(342): error in "post_with_custom_headers": check headers["x-cpp-netlib"] == "rocks!" failed [ != rocks!] *** 7 failures detected in test suite "http 1.0 localhost tests" LD_LIBRARY_PATH=/usr/bin:/usr/lib:/usr/lib32:/usr/lib64:$LD_LIBRARY_PATH export LD_LIBRARY_PATH bin/gcc-4.2.3/debug/link-static/localhost_tests && touch bin/gcc-4.2.3/debug/link-static/localhost_tests.passed ...failed testing.unit-test bin/gcc-4.2.3/debug/link-static/localhost_tests.passed... ...failed updating 1 target... ...updated 2 targets... >> >> Can we fix this before I merge to trunk and release 0.3? > > Hopefully yes, > Sounds promising. You don't encounter this problem in Linux? -- Dean Michael C. Berris Software Engineer, Friendster, Inc. |
From: Allister L. S. <all...@gm...> - 2008-09-23 23:20:45
|
Hi, Just a quick comment on the errors... Yes, they do. Let me paste the log of the errors below: > > gcc.compile.c++ bin/gcc-4.2.3/debug/link-static/localhost_tests.o > gcc.link bin/gcc-4.2.3/debug/link-static/localhost_tests > testing.unit-test bin/gcc-4.2.3/debug/link-static/localhost_tests.passed > localhost - - [24/Sep/2008 06:04:28] "GET / HTTP/1.0" 200 - > localhost - - [24/Sep/2008 06:04:28] "GET / HTTP/1.0" 200 - > localhost - - [24/Sep/2008 06:04:28] "GET /boost.jpg HTTP/1.0" 200 - > localhost - - [24/Sep/2008 06:04:28] "GET /test.xml HTTP/1.0" 200 - > localhost - - [24/Sep/2008 06:04:28] "GET /test.xml HTTP/1.0" 200 - > localhost - - [24/Sep/2008 06:04:28] "GET /boost.jpg HTTP/1.0" 200 - > localhost - - [24/Sep/2008 06:04:28] "GET > /cgi-bin/requestinfo.py?query=1 HTTP/1.0" 200 - > localhost - - [24/Sep/2008 06:04:28] "GET > /cgi-bin/multiline-header.py?query=1 HTTP/1.0" 200 - > localhost - - [24/Sep/2008 06:04:28] code 404, message File not found > localhost - - [24/Sep/2008 06:04:28] "GET /file_not_found HTTP/1.0" 404 - > localhost - - [24/Sep/2008 06:04:28] "HEAD /test.xml HTTP/1.0" 200 - > localhost - - [24/Sep/2008 06:04:28] "POST /cgi-bin/echo_headers.py > HTTP/1.0" 200 - > Traceback (most recent call last): > File > "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/echo_headers.py", > line 17, in <module> > hdrs = cgisupport.http_headers(os.environ.get('HTTP_ALL_HEADERS')) > File > "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", > line 11, in __init__ > self.parse(header_str) > File > "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", > line 24, in parse > self.headers = self.__parse_headers(header_str) > File > "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", > line 31, in __parse_headers > lines = str.split('\n') > AttributeError: 'NoneType' object has no attribute 'split' Apparently, the parsing of the headers from HTTP_ALL_HEADERS is not yet perfect. I hope I can find time this week to improve cgisupport.py > localhost - - [24/Sep/2008 06:04:28] CGI script exit status 0x100 > Running 15 test cases... > localhost_tests.cpp(272): error in "post_with_explicit_headers": check > headers["content-length"] == content_length failed [ != 5] Obviously, HTTP_ALL_HEADERS does not give you the proper content length through this method. In fact, HTTP_ALL_HEADERS doesn't contain the string "content-length". But you can still get it with os.environ["CONTENT_LENGTH"]. > localhost_tests.cpp(273): error in "post_with_explicit_headers": check > headers["content-type"] == content_type failed [ != > application/x-www-form-urlencoded] Same with content length, use os.environ["CONTENT_TYPE"]. The rest of the errors are of the same type of error. So basically we'll need better parsing of headers in cgisupport.py. Basically, it would be best to try to understand how the parsing is done in CGIHTTPRequestHandler. There one will see that it's not as straightforward as splitting lines with colons as a line could contain more than one colon. I tried inserting these lines into http_test_server.py (line 20, at the beginning of run_cgi function): print '********DEBUG self.headers!!!' print self.headers print '********END DEBUG' The server's console output when I use Firefox to access the server is: ********DEBUG self.headers!!! Host: localhost:8000 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-gb,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive ********END DEBUG So, as we can see, Content-Type and Content-Length are obtained differently by CGIHTTPRequestHandler. It'd also help if one understands how the headers are parsed in $PYTHON_HOME/Lib/rfc822.py. Unfortunately, I'm rather pressed these days so maybe Kim or someone else can do the improvements based on these observations. Cheers, Allister |
From: Divye K. <div...@gm...> - 2008-09-24 07:13:59
|
Hi Dean, On Wed, Sep 24, 2008 at 3:37 AM, Dean Michael Berris <mik...@gm... > wrote: > Yes, they do. Let me paste the log of the errors below: > > > <snip> > localhost - - [24/Sep/2008 06:04:28] "POST /cgi-bin/echo_headers.py > HTTP/1.0" 200 - > Traceback (most recent call last): > File > "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/echo_headers.py", > line 17, in <module> > hdrs = cgisupport.http_headers(os.environ.get('HTTP_ALL_HEADERS')) > File > "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", > line 11, in __init__ > self.parse(header_str) > File > "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", > line 24, in parse > self.headers = self.__parse_headers(header_str) > File > "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", > line 31, in __parse_headers > lines = str.split('\n') > AttributeError: 'NoneType' object has no attribute 'split' > localhost - - [24/Sep/2008 06:04:28] CGI script exit status 0x100 > > <snip> > This is a different set of errors than those faced by Glyn. This requires investigation, but unfortunately, my linux box is shot due to a driver issue. It will take me some time to check this out. :( > > >> > >> Can we fix this before I merge to trunk and release 0.3? > > > > Hopefully yes, > > > > Sounds promising. > > You don't encounter this problem in Linux? > Linux box down :( > > -- > Dean Michael C. Berris > Software Engineer, Friendster, Inc. > Divye -- An idealist is one who, on noticing that a rose smells better than a cabbage, concludes that it will also make better soup. H. L. Mencken (1880 - 1956) My official web site: http://people.iitr.ernet.in/shp/061305/ Webmaster: http://www.drkapoorsclinic.com Blog: http://divyekapoor.blogspot.com |
From: K. G. <kim...@gm...> - 2008-09-24 07:02:21
|
Hello, On Wed, Sep 24, 2008 at 00:07, Dean Michael Berris <mik...@gm...> wrote: > > localhost - - [24/Sep/2008 06:04:28] "POST /cgi-bin/echo_headers.py > HTTP/1.0" 200 - > Traceback (most recent call last): > File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/echo_headers.py", > line 17, in <module> > hdrs = cgisupport.http_headers(os.environ.get('HTTP_ALL_HEADERS')) This is where I get the value HTTP_ALL_HEADERS from the env vars. > File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", > line 11, in __init__ > self.parse(header_str) > File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", > line 24, in parse > self.headers = self.__parse_headers(header_str) > File "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", > line 31, in __parse_headers > lines = str.split('\n') > AttributeError: 'NoneType' object has no attribute 'split' Apparently the object returned from there is not a string, maybe it's just empty? Could you check that your http_test_server.http actually calls http_test_server.py and not cgi_server.py? Oh! I see now, the C++ facade is not correctly updated -- it checks whether http_test_server.py exists, but executes cgi_server.py, in the Unix case. I'll fix that and commit. - Kim |
From: Divye K. <div...@gm...> - 2008-09-24 07:16:30
|
Hello, On Wed, Sep 24, 2008 at 12:32 PM, Kim Gräsman <kim...@gm...> wrote: > Hello, > > On Wed, Sep 24, 2008 at 00:07, Dean Michael Berris > <mik...@gm...> wrote: > > > > localhost - - [24/Sep/2008 06:04:28] "POST /cgi-bin/echo_headers.py > > HTTP/1.0" 200 - > > Traceback (most recent call last): > > File > "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/echo_headers.py", > > line 17, in <module> > > hdrs = cgisupport.http_headers(os.environ.get('HTTP_ALL_HEADERS')) > > This is where I get the value HTTP_ALL_HEADERS from the env vars. > > > File > "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", > > line 11, in __init__ > > self.parse(header_str) > > File > "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", > > line 24, in parse > > self.headers = self.__parse_headers(header_str) > > File > "/home/dean/Source/C++/cpp-netlib-http_integration/libs/network/test/server/cgi-bin/cgisupport.py", > > line 31, in __parse_headers > > lines = str.split('\n') > > AttributeError: 'NoneType' object has no attribute 'split' > > Apparently the object returned from there is not a string, maybe it's > just empty? > None type indicates that the env var was empty. > > Could you check that your http_test_server.http actually calls > http_test_server.py and not cgi_server.py? Oh! I see now, the C++ > facade is not correctly updated -- it checks whether > http_test_server.py exists, but executes cgi_server.py, in the Unix > case. I'll fix that and commit. > Thanks Kim. > > - Kim > > Divye -- An idealist is one who, on noticing that a rose smells better than a cabbage, concludes that it will also make better soup. H. L. Mencken (1880 - 1956) My official web site: http://people.iitr.ernet.in/shp/061305/ Webmaster: http://www.drkapoorsclinic.com Blog: http://divyekapoor.blogspot.com |