Errors when system-calling script, otherwise fine

This is the place for queries that don't fit in any of the other categories.

Errors when system-calling script, otherwise fine

Postby tnknepp » Wed May 08, 2013 11:21 am

I'm running a system call on a script I wrote to generate daily figures for data we are collecting. When I run the plotting script by itself it runs without any errors, but when I do the system call I get:

Traceback (most recent call last):
File "C:\Python27\lib\site-packages\matplotlib\backends\", line 156, in <lambda>
lambda: self.close_event())
File "C:\Python27\lib\site-packages\matplotlib\", line 1564, in close_event
self.callbacks.process(s, event)
RuntimeError: wrapped C/C++ object of type FigureCanvasQTAgg has been deleted

This error does not halt the process, rather the plotting script continues to execute (and generate figures!) quite happily otherwise. While it seems to be working, I am concerned about these errors (benign as they seem). Unfortunately, there are no lines in the plotting script being flagged as being in error. The script that is calling the plotting script is posted below. Since the plotting script is rather long (really it is just the same thing being done for four different gases) I add it as an attachment in .txt. I give the whole script here for the sake of being thorough, though I don't expect anyone to read the whole thing (actually, I suspect the issue is with the system call and has nothing to do with the plotting script, which makes the need to post it moot...).

Does anyone have any idea regarding why this error is occurring?

Code: Select all
import os, time
import datetime as dt

def waitToTomorrow():
    """Forces the code to sleep until tomorrow morning at 06:00."""
    print 'Sleeping...'
    today = time.localtime()
    today = time.mktime(today[:3] + (0,0,0) + today[6:]) # Midnight time. 
    time.sleep(today + 24*3600 + 6*3600 - time.time())
    print '\n'*5
while True:
    # Print current date.
    print dt.datetime.strftime(,'%Y %m %d %H:%M:%S')
    # Run code to grab data from remote machine.
    print 'Grabbing/unzipping data.'
    # Run code to process data. 
    print 'Processing to l2/3.'
    # Run code to create plots. 
    print 'Creating plots.'
    # Run code to make posting data files. 
    print 'Creating data files for posting.'
    # Post data. 
    print 'Posting data to web.'

(12.03 KiB) Downloaded 95 times
Python: 2.7 via Anaconda
Numpy: 1.7
Pandas: 0.11
OS: Windows 7
IDE: Spyder/IPython
User avatar
Posts: 153
Joined: Mon Mar 11, 2013 7:41 pm

Return to General Coding Help

Who is online

Users browsing this forum: No registered users and 16 guests