Hi
all,
We've just released a new
version of the Python globus-sdk package,
v4.2.0,
and it includes some new features which we think are particularly
noteworthy.
1. Support for closing clients and
closing apps.
An issue we've noticed with previous
SDK versions is that there are a number of scenarios in which resource
handles (open files, open network connections) can leak in user
applications. These are usually cleaned up correctly when applications exit
or garbage collect, but it's better to control when resources are
closed.
Globus App and Client objects have two new
APIs to support better resource management.
- Apps and clients
now provide close(), an imperative method
which closes open resources associated with the app or client.
-
Apps and clients can now be used as context managers (the with statement) and will automatically close
when exited.
Most of our examples and
documentation have been updated to show this usage. For example, if you
revisit
our
minimal script example in the tutorial, you'll now see a version of it
"with context managers".
2. Support for automatic
login in response to Globus Auth Requirements Errors
(GAREs).
One of our goals when we introduced the
GlobusApp abstraction in the SDK was to allow Python users to "someday"
automatically trigger logins. We're very excited to reach this
milestone!
When configured to "redrive" GAREs, an
app will check all HTTP errors with status code 403 to see if they can be
parsed as a GARE. If one is detected during a client's request retry cycle,
the app will immediately run a login flow based on the requirements and
signal the client to continue retrying.
Thanks,
-Stephen