Bug #911
closed
Added by Gabriel Lander about 14 years ago.
Updated about 14 years ago.
Category:
Python scripting
Affected Version:
Appion/Leginon 2.1.0
Description
I've run into problems with webcaller.py not being able to make subdirectories.
if "/path/glander/align" doesn't exist, then "/path/glander/align/maxlike1" can't be created and webcaller.py fails.
I changed webcaller.py to use "mkdir -p" from a subprocess call instead of "os.mkdir", since this will create necessary subdirectories
- Status changed from Assigned to In Code Review
- Assignee changed from Amber Herold to Gabriel Lander
- Target version set to Appion/Leginon 2.1.0
Nice catch Gabe. We've been hoping to change all our shell commands to use the absolute path to avoid any problems that could occur if the command has been modified on the specific machine. Christopher and I found that os actually has a function that should create the needed subdirectories, so I have replaced the shell command with it.
Take a look at it and let me know what you think. I will try to merge this into the 2.1 branch before release as well...seems this could be a very annoying problem.
- Status changed from In Code Review to In Test
aha! This is great - I didn't know that os had this function. And we should indeed always use the absolute path in shell commands. I tested & this works fine at my end.
- Status changed from In Test to Merge
- Assignee changed from Gabriel Lander to Amber Herold
- Status changed from Merge to Closed
Also available in: Atom
PDF