質問

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'
役に立ちましたか?

解決 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

他のヒント

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top