Question

How are you supposed to set this programatically for the oauth2 module? I have tried the following, but get a key error:

from oauth2client.client import OAuth2Credentials
import gflags

gflags.FLAGS['--positional_parameters_enforcement'] = 'EXCEPTION'
Was it helpful?

Solution 2

More reliably, this can be set in the following way:

import oauth2client.util
oauth2client.util.positional_parameter_enforcement = \
    oauth2client.util.POSITIONAL_IGNORE

from oauth2client.client import OAuth2Credentials

OTHER TIPS

After consulting help(glfags.Flag) I identified that you set the value property like so:

import gflags

gflags['positional_parameters_enforcement'].value = 'EXCEPTION'

Excellent! Although, now contrary to the documentation, the warnings are being suppressed and I have no exceptions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top