Python3 TypeError: __init__() got an unexpected keyword argument 'tls_maximum_version'

3,387 views
Skip to first unread message

Dierk Polzin

unread,
Sep 23, 2019, 6:10:02 PM9/23/19
to GAM for G Suite
I have been trying to upgrade to python3.6 to work with GAM..

After many issues I am stuck with this error.



/usr/bin/python3 /home/dpolzin/GAM/GAM-4.94/src/gam.py info user dpolzin

Traceback (most recent call last):

File "/home/dpolzin/GAM/GAM-4.94/src/gam.py", line 14898, in <module>

sys.exit(ProcessGAMCommand(sys.argv))

File "/home/dpolzin/GAM/GAM-4.94/src/gam.py", line 14266, in ProcessGAMCommand

doGetUserInfo()

File "/home/dpolzin/GAM/GAM-4.94/src/gam.py", line 10123, in doGetUserInfo

cd = buildGAPIObject('directory')

File "/home/dpolzin/GAM/GAM-4.94/src/gam.py", line 1362, in buildGAPIObject

credentials = getValidOauth2TxtCredentials()

File "/home/dpolzin/GAM/GAM-4.94/src/gam.py", line 1295, in getValidOauth2TxtCredentials

credentials.refresh(google_auth_httplib2.Request(_createHttpObj()))

File "/home/dpolzin/GAM/GAM-4.94/src/gam.py", line 113, in _createHttpObj

cache=cache, timeout=timeout)

TypeError: __init__() got an unexpected keyword argument 'tls_maximum_version'

Any ideas..?

I have a script to get the full list of google groups and then check and change the group settings.. But I cannot get any simple connection to work.

I installed these packages..exit
google-api-python-client 1.7.11
google-auth 1.6.3
google-auth-httplib2 0.0.3
google-auth-oauthlib 0.4.0

Ross Scroggs

unread,
Sep 23, 2019, 6:12:27 PM9/23/19
to google-ap...@googlegroups.com
Dierk,

Why are you running the source version? What's wrong with using the executable version?

Ross

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/61f83088-8c91-43fe-80ae-dec1ab3f5ac2%40googlegroups.com.


--

Dierk Polzin

unread,
Sep 23, 2019, 6:14:59 PM9/23/19
to GAM for G Suite
I thought that was the only way to get it to work with a python script.

Dierk Polzin

unread,
Sep 23, 2019, 6:16:06 PM9/23/19
to GAM for G Suite
PYTHON_PATH = '/usr/bin/python3'
GAM_PATH = '/home/dpolzin/GAM/GAM-4.65/src/gam.py'
GAM_PATH = '/home/dpolzin/GAM/GAM-4.40/src/gam.py'
GAM_PATH = '/home/dpolzin/GAM/GAM-4.94/src/gam.py'
BASE_DIR = '/home/dpolzin/GAM_GooGroups'

def get_now():
    now = datetime.datetime.now()
    nowStr = now.strftime("%Y-%m-%d %H:%M:%S")
    return nowStr


def test_dpolzin(gam_path=GAM_PATH, python_ver=PYTHON_PATH):
    # get the full LC Google Gruoups with all settings (big)
    # gam print groups settings > all_groups_settings.csv
    cmd = '%s %s info user dpolzin' % (python_ver, gam_path)
    args = shlex.split(cmd)
    proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    out, err = proc.communicate()
    return out, err


On Monday, September 23, 2019 at 3:10:02 PM UTC-7, Dierk Polzin wrote:

Dierk Polzin

unread,
Sep 23, 2019, 6:39:41 PM9/23/19
to GAM for G Suite
The solution is just to use the binary executable, rather than the source code.


On Monday, September 23, 2019 at 3:10:02 PM UTC-7, Dierk Polzin wrote:

Samuel

unread,
Sep 24, 2019, 2:21:18 AM9/24/19
to GAM for G Suite
Hello,
Like you, I was using the source version, in order to use version 3 of python, not available on the linux distributions of my work, I switched to binaries that embed python 3
Reply all
Reply to author
Forward
0 new messages