Skip to content

Specify UTF-8 encoding when reading token file - #78

Open
Eddy12597 wants to merge 1 commit into
Kaggle:mainfrom
Eddy12597:main
Open

Eddy12597 wants to merge 1 commit into
Kaggle:mainfrom
Eddy12597:main

Conversation

@Eddy12597

Copy link
Copy Markdown
PS C:\Users\Eddy z> kaggle auth print-access-token
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\Python\Python313\Scripts\kaggle.exe\__main__.py", line 5, in <module>
    sys.exit(main())
             ~~~~^^
  File "D:\Python\Python313\Lib\site-packages\kaggle\cli.py", line 83, in main
    api.authenticate()
    ~~~~~~~~~~~~~~~~^^
  File "D:\Python\Python313\Lib\site-packages\kaggle\api\kaggle_api_extended.py", line 1496, in authenticate
    if self._authenticate_with_access_token():
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "D:\Python\Python313\Lib\site-packages\kaggle\api\kaggle_api_extended.py", line 1563, in _authenticate_with_access_token
    access_token, source = get_access_token_from_env()
                           ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "D:\Python\Python313\Lib\site-packages\kagglesdk\kaggle_env.py", line 106, in get_access_token_from_env
    access_token = _get_access_token_from_file(os.path.expanduser("~/.kaggle/access_token"))
  File "D:\Python\Python313\Lib\site-packages\kagglesdk\kaggle_env.py", line 83, in _get_access_token_from_file
    token_value = token_path.read_text().strip()
                  ~~~~~~~~~~~~~~~~~~~~^^
  File "D:\Python\Python313\Lib\pathlib\_local.py", line 546, in read_text
    return PathBase.read_text(self, encoding, errors, newline)
           ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\Python\Python313\Lib\pathlib\_abc.py", line 633, in read_text
    return f.read()
           ~~~~~~^^
  File "<frozen codecs>", line 325, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

@google-cla

google-cla Bot commented Nov 1, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant