file access in jythonc

Alan Kennedy alanmk at
Sat Aug 21 17:30:30 CEST 2004

[John Howard]
> I have the following in a jythonc program to be executed in a html
> file.
> f1 = open("filename","r")
> I get message about filePermission read error. Program compiles and
> jar file is created. Just the html code gives message.
> Any ideas?

I am presuming that when you say "executed in a html file" you mean that 
this code is to be embedded in a rendered html page as displayed in a 
browser, such as mozilla or ie, which means that your code is an 
"applet", and thus allowed to execute only in the "applet sandbox" 
inside that browser. Which significantly restricts the access rights of 
the applet to access system resources such as local files, for a range 
of very good security reasons, described here

You can approach the problem by

1. Digitally signing your applet or jar file.

2. Configuring the your browser to permit file access to local files 
(potentially opening a massive security hole in your browser).


alan kennedy
email alan:    

More information about the Python-list mailing list