Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error tolerant script loading #746

Closed
davidsminor opened this issue Feb 21, 2014 · 3 comments
Closed

Error tolerant script loading #746

davidsminor opened this issue Feb 21, 2014 · 3 comments
Labels
core Issues with core Gaffer functionality

Comments

@davidsminor
Copy link
Contributor

Hello,

Using Gaffer in production, we found pretty quickly that you need to be able to load scripts with dodgy nodes in them, without the load process terminating prematurely. In my software, I've been getting round this by manually executing the scripts line by line. This has worked so far, but I've just noticed a situation where the values in path filter "paths" plugs get saved out on separate lines. This is breaking my code, as the lines no longer make sense in isolation. I imagine it's a matter of weeks before people start complaining about this in production, (I wouldn't be surprised if it's caused problems already). I could probably work around it on my side, but it'd be a workaround on top of a workaround, and it seems like high time we fixed this in Gaffer anyway, so here's a ticket.

@davidsminor
Copy link
Contributor Author

actually, it looks like my code was failing because some of the string plug values had "\n" in them (which was my fault and shouldn't typically happen). Still, something to look out for...

@johnhaddon
Copy link
Member

The ast munging discussed here sounds like it might be a relevant approach :

http://stackoverflow.com/questions/9670931/sandboxing-running-python-code-line-by-line

johnhaddon added a commit that referenced this issue May 28, 2014
- Raw pointer rather than smart pointer for plugSet(). We only use smart pointers where we need to manage ownership.
- Slightly more robust way of identifying the relevant plug.
- Removed signal handling after the correction has been applied.
- Removed unnecessary connection member variable.
- Added \todo discussing a better mechanism which relies on doing #746 first.
@andrewkaufman andrewkaufman added this to the Misc Enhancements milestone Jun 18, 2014
@ldmoser
Copy link
Contributor

ldmoser commented Jul 8, 2014

We bumped priority on this as it's already affecting us and will certainly annoy test users.

johnhaddon added a commit to johnhaddon/gaffer that referenced this issue Jul 15, 2014
Errors are reported to the user via a dialogue, but the file is no longer prevented from loading.

Fixes GafferHQ#746.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issues with core Gaffer functionality
Projects
None yet
Development

No branches or pull requests

4 participants