Python error in sample choices


#1

In my sandbox version of the matrix, I’ve got an error showing up on the main page. I’ve copied the text of the error to the end of this message, but you should be able to see it by going to http://matrix.ling.washington.edu/ekayen/matrix.cgi. The thing that is causing it, as far as I can tell, is the fact that I generated a few grammars from the choices files in trunk/web/sample-choices, and then tried reinstalling the matrix to my sandbox location without deleting the grammar files – that’s why it’s telling me ‘web/sample-choices/uma is a directory.’ The thing is, I have deleted the files in question, and it’s still giving me the error messages. I never checked the files into svn, and I don’t think the install script would care either way. I’ve tried clearing my cookies and accessing the site from another computer, and the issue persists. Anyone know what is causing this?

/home2/www-matrix/html/ekayen/matrix.cgi in ()
233 matrixdef.sub_page(form_data[‘subpage’].value, cookie, vr)
234 else:
235 matrixdef.cookie_error_page()
236 else:
237 matrixdef.main_page(cookie, vr)
matrixdef = <gmcs.deffile.MatrixDefFile instance>, matrixdef.main_page = <bound method MatrixDefFile.main_page of <gmcs.deffile.MatrixDefFile instance>>, cookie = ‘8928’, vr = <gmcs.validate.ValidationResult instance>
/home2/www-matrix/html/ekayen/gmcs/deffile.py in main_page(self=<gmcs.deffile.MatrixDefFile instance>, cookie=‘8928’, vr=<gmcs.validate.ValidationResult instance>)
812 for f in globlist:
813 f = f.replace(’\’, ‘/’)
814 lang = choices.get_choice(‘language’,f) or ‘(empty questionnaire)’
815 if lang == ‘minimal-grammar’:
816 lang = ‘(minimal grammar)’
lang undefined, global choices = <module ‘gmcs.choices’ from ‘/home2/www-matrix/html/ekayen/gmcs/choices.pyc’>, choices.get_choice = , f = ‘web/sample-choices/uma’
/home2/www-matrix/html/ekayen/gmcs/choices.py in get_choice(choice=‘language’, choices=‘web/sample-choices/uma’)
246 choice_lines = choices
247 if type(choices) is str:
248 choice_lines = open(choices).readlines()
249 elif type(choices) is file:
250 choice_lines = choices.readlines()
choice_lines = ‘web/sample-choices/uma’, builtin open = , choices = ‘web/sample-choices/uma’, ).readlines undefined

<type ‘exceptions.IOError’>: [Errno 21] Is a directory: ‘web/sample-choices/uma’
args = (21, ‘Is a directory’)
errno = 21
filename = ‘web/sample-choices/uma’
message = ‘’
strerror = ‘Is a directory’


#2

Can you delete everything entirely and install from scratch?

You can also always try just another folder, e.g. http://matrix.ling.washington.edu/ekayen2/ as a fresh location.

(The install script actually will copy all sorts of things to the install location unless you list the locations to be ignored explicitly for it;

exclude={CVS/,.svn/,delphin/…
).


#3

Exactly. The install process copies everything not specifically excluded; more importantly it doesn’t delete anything that is no longer in your local directory.