add an --evalargs option to python remote scripts, and change --stdin
add an --evalargs option to python remote scripts, and change --stdin

Summary:
This changes the behavior of the --stdin argument added recently in D4872896,
and also adds a new --evalargs option.

The original intent of the --stdin argument was to support inputing binary
string arguments that may contain nul bytes.  However, the underlying issue was
really that the remote script did not process string arguments through `eval()`
as it does for all other types of arguments.  The new --evalargs flag added in
this diff makes the remote script pass all arguments through `eval()`.  This
effectively supports passing in arbitrary binary data through python string
literal encoding.

This also changes the behavior of `eval()` so that the `__future__` import
statements at the top of remote.py do not apply to the arguments being
evaluated.  In particular this means that string arguments are treated as
binary data rather than unicode by default.

I did leave the --stdin argument in place, since it still seems potentially
useful for supporting very large arguments.  However, I changed it to use json
for encoding the input, rather than python pickling.  Given that all the
arguments are strings and not python objects, there is no strong reason to use
pickle.  Using json makes this mechanism easier to use from non-python code.

Reviewed By: wez

Differential Revision: D4948872

fbshipit-source-id: d67dd16722984ad924227d9eaa3c40b5ae3e77bf

getyourguide/fbthrift,SergeyMakarenko/fbthrift,getyourguide/fbthrift,SergeyMakarenko/fbthrift,getyourguide/fbthrift,facebook/fbthrift,SergeyMakarenko/fbthrift,getyourguide/fbthrift,facebook/fbthrift,getyourguide/fbthrift,getyourguide/fbthrift,SergeyMakarenko/fbthrift,SergeyMakarenko/fbthrift,SergeyMakarenko/fbthrift,SergeyMakarenko/fbthrift,getyourguide/fbthrift,SergeyMakarenko/fbthrift,SergeyMakarenko/fbthrift,getyourguide/fbthrift,getyourguide/fbthrift,SergeyMakarenko/fbthrift,facebook/fbthrift,SergeyMakarenko/fbthrift,facebook/fbthrift,getyourguide/fbthrift,facebook/fbthrift,SergeyMakarenko/fbthrift,getyourguide/fbthrift,getyourguide/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift,facebook/fbthrift