As mentioned in irc, you're trying to execute the image as a command,
from the python os.system documentation:
os.system(command)
Execute the command (a string) in a subshell. This is implemented
by calling the Standard C function system(), and has the same
limitations. Changes to sys.stdin, etc. are not reflected in the
environment of the executed command.
I believe you just want
db(db.comment.title==session.new_image_title).update(newimage =
'applications/turtle_art_images/uplodates/%s.png' %
session.new_image[:-3])
On Fri, Jun 11, 2010 at 7:00 AM, Aaron Crowe <[email protected]> wrote:
> I'm working on an application that takes a Turtle Art (.ta) file, runs
> it, creates a .png of the result, and displays it in a table. So far I
> can create the .png and it's placed in the uploads folder with the
> same name as the original .ta file but when i try to run
>
> session.new_image = form.vars.file
> session.new_image_title = form.vars.title
>
> file_name_length = len(session.new_image)
> os.system('python applications/turtle_art_images/modules/
> PngGenerator.py applications/turtle_art_images/
> uploads/'+session.new_image)
>
> db(db.comment.title==session.new_image_title).update(newimage=os.system('applications/
> turtle_art_images/uploads/'+session.new_image[0:(file_name_length-2)]
> +'png'))
> return dict()
>
> where form.vars.file is the uploaded .ta file
>
> I get the errors:
>
> ERROR:Rocket.Errors.ThreadPool:Traceback (most recent call last):
> File "/home/acrowe/lib/python/web2py/gluon/rocket.py", line 297, in
> start
> listeners = [poll_dict[x[0]] for x in poll.poll(POLL_TIMEOUT)]
> IOError: [Errno 4] Interrupted system call
>
> sh: applications/turtle_art_images/uploads/
> comment.file.b6b8aa42563d3b8c.747572746c65617274746573742e7461.png:
> Permission denied
> ERROR:Rocket.Errors.ThreadPool:Traceback (most recent call last):
> File "/home/acrowe/lib/python/web2py/gluon/rocket.py", line 297, in
> start
> listeners = [poll_dict[x[0]] for x in poll.poll(POLL_TIMEOUT)]
> IOError: [Errno 4] Interrupted system call
>
>
> and I'm totally lost as to why. Any ideas?