Python 2 has a slightly different traceback but seems to be hitting the same issue lkocman@deadrat:~/Workspace/md2workflow> python2 -m twine upload --repository-url https://test.pypi.org/legacy/ dist/* Uploading distributions to https://test.pypi.org/legacy/ Enter your username: lkocman Enter your password: TypeError: expected string or buffer