Add some logics to have a default config section
Add some logics to have a default config section

ConfigParser is very picky about this for no good reason. It wants every config
file to absolutely, no exceptions, have section headings for every value, even
though it has a notion of a default section and all other kinds of fanciness.
It doesn't even have options to tweak this behavior.
To fix, subclass ConfigParser, wrap config file objects in StringIOs, and
prepend '[general]\n' to the file if it fails to meet the ever-so-lofty
constraints of ConfigParser. That way, 'general' becomes a de-facto default
section heading, and we can have config files (which are still valid INI, btw)
in which there is no section heading.
For most users of the SDK, being able to specify raw config options and walk
away is preferrable, and we'll even be able to recommend that you install the
CLI and run

    echo "auth_token = $(globus nexus get-goauth-token -F TEXT)" \
        > ~/.globus.cfg

or an equivalent command to get yourself started.
By contrast, consider the messiness of

    echo "[general]\nauth_token = ..."

which makes it harder to read without changing the meaning or content at all.

There is a very real danger that ConfigParser._read() / configparser._read()
will be modified in an incompatible way or even removed in a future Python,
especially because it's not part of the "public API" for that class. However,
things are more effortful if we want to override read() and readfp() instead,
and it's at least stable enough that it survived the 2/3 transition intact.
I'm not genuinely worried about this, although it's something of a violation
of the ConfigParser class' encapsulation.

globusonline/globus-sdk-python,aaschaer/globus-sdk-python,sirosen/globus-sdk-python,globus/globus-sdk-python,globus/globus-sdk-python