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

file handling in a server (.py) file using xmlrpc

uwb

I've got a call to glob in a .py file sitting in an apache cgi-bin directory
which refuses to work while the exact same code works from a python console
session.

I'm guessing that in order to read or write files from any sort of a script
file sitting in the cgi-bin directory on a server, something has to be set
to allow such activity. I'd appreciate it if anybody with as clue as to
what that was could tell me about it.

Jul 21 '05 #1
4 1648
uwb wrote:
I've got a call to glob in a .py file sitting in an apache cgi-bin directory
which refuses to work while the exact same code works from a python console
session.

I'm guessing that in order to read or write files from any sort of a script
file sitting in the cgi-bin directory on a server, something has to be set
to allow such activity. I'd appreciate it if anybody with as clue as to
what that was could tell me about it.


So, what do you mean "refuses to work"? Is the cgi script not executing
at all? Spitting out an error? If so, what error? (And is it an error
to the browser calling the cgi script, or in your apache logs?)

Jeremy Jones
Jul 21 '05 #2
uwb
Jeremy Jones wrote:
uwb wrote:
I've got a call to glob in a .py file sitting in an apache cgi-bin
directory which refuses to work while the exact same code works from a
python console session.

I'm guessing that in order to read or write files from any sort of a
script file sitting in the cgi-bin directory on a server, something has to
be set
to allow such activity. I'd appreciate it if anybody with as clue as to
what that was could tell me about it.


So, what do you mean "refuses to work"? Is the cgi script not executing
at all? Spitting out an error? If so, what error? (And is it an error
to the browser calling the cgi script, or in your apache logs?)

Jeremy Jones

The script executes, no error messages, but the glob call turns up nothing
while the identical call running from a console does in fact turn up files
names as expected.
Jul 21 '05 #3
uwb wrote:
Jeremy Jones wrote:
uwb wrote:
I've got a call to glob in a .py file sitting in an apache cgi-bin
directory which refuses to work while the exact same code works from a
python console session.

I'm guessing that in order to read or write files from any sort of a
script file sitting in the cgi-bin directory on a server, something has to
be set
to allow such activity. I'd appreciate it if anybody with as clue as to
what that was could tell me about it.


So, what do you mean "refuses to work"? Is the cgi script not executing
at all? Spitting out an error? If so, what error? (And is it an error
to the browser calling the cgi script, or in your apache logs?)

Jeremy Jones

The script executes, no error messages, but the glob call turns up nothing
while the identical call running from a console does in fact turn up files
names as expected.

Wild guess, but I'm thinking your webserver process doesn't have
permissions to look in your directory.

Following is alternating root shell and IPython shell:

root@qiwi:~ # chmod 777 /bam
root@qiwi:~ # ls -ld /bam
drwxrwxrwx 2 root root 96 Jul 8 14:53 /bam

In [4]: glob.glob("/bam/*txt")
Out[4]: ['/bam/foo.txt', '/bam/bar.txt']

root@qiwi:~ # chmod 000 /bam
root@qiwi:~ # ls -ld /bam
d--------- 2 root root 96 Jul 8 14:53 /bam

In [5]: glob.glob("/bam/*txt")
Out[5]: []
HTH,

Jeremy Jones
Jul 21 '05 #4
uwb
Jeremy Jones wrote:
The script executes, no error messages, but the glob call turns up nothing
while the identical call running from a console does in fact turn up files
names as expected.

Wild guess, but I'm thinking your webserver process doesn't have
permissions to look in your directory.

Following is alternating root shell and IPython shell:

root@qiwi:~ # chmod 777 /bam
root@qiwi:~ # ls -ld /bam
drwxrwxrwx 2 root root 96 Jul 8 14:53 /bam

In [4]: glob.glob("/bam/*txt")
Out[4]: ['/bam/foo.txt', '/bam/bar.txt']

root@qiwi:~ # chmod 000 /bam
root@qiwi:~ # ls -ld /bam
d--------- 2 root root 96 Jul 8 14:53 /bam

In [5]: glob.glob("/bam/*txt")
Out[5]: []
HTH,

Jeremy Jones

Thanks! Thing does work when I do globs of the local apache directories.

Jul 21 '05 #5

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

Similar topics

0
by: glin | last post by:
Hi I am trying to integrate the xmlrpc server into a class, does anyone know how to get it working? test.html: <html> <head> <title>XMLRPC Test</title> <script src="jsolait/init.js"></script>...
0
by: Juan Carlos CORUÑA | last post by:
Hello all, I'm trying to create a COM Server with an embedded xmlrpc server. Here is way it must work: - The client application (programmed with a COM capable language) instantiates my COM...
19
by: Patrick Useldinger | last post by:
Hi all, after my unsuccessful try to run Apache 2 with mod_python and Python 2.3, I am looking for an alternative approach. My aim is to write a small web-based application: Python - the...
3
by: J Poirier | last post by:
Hi All, I'm hoping that someone might have some pointers or examples on how to proceed with a solution to the following problem: A test application, which produces a trace file, is being run...
2
by: john14 | last post by:
Hi, I have an xmlrpc server. I using the python package xmlrpc. Here is what I am doing: s = xmlrpc.server() s.addMethods(method_hash) s.bindAndListen(PORT) while 1: try:
1
by: fortepianissimo | last post by:
I have a simple xmlrpc server/client written in Python, and the client throws a list of lists to the server and gets back a list of lists. This runs without a problem. I then wrote a simple Java...
3
by: seb | last post by:
Hi, I am writing to a file some basic information using the logging module. It is working but in the log file some line are printed several time. I had put some print debugging messages in the...
7
by: viscanti | last post by:
Hi, I'm trying to create an XMLRPC server using apache + python (cgi). It's not too difficult to configure everything, but I would like to tune it in order to receive up to 2000 calls per minute...
4
by: care02 | last post by:
I have implemented a simple Python XMLRPC server and need to call it from a C/C++ client. What is the simplest way to do this? I need to pass numerical arrays from C/C++ to Python. Yours, Carl
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.