Skip to content

create_commits.py: dont assume utf-8#5

Open
cfal wants to merge 1 commit intoAsana:mainfrom
cfal:not-utf8
Open

create_commits.py: dont assume utf-8#5
cfal wants to merge 1 commit intoAsana:mainfrom
cfal:not-utf8

Conversation

@cfal
Copy link

@cfal cfal commented Mar 23, 2026

this allows the commits to be successfully pushed even if they are not UTF-8 - eg generated artifacts or binaries.

previously, this would fail with decoding errors:

Traceback (most recent call last):
  File "/home/runner/work/_actions/asana/push-signed-commits/d615ca88d8e1a946734c24970d1e7a6c56f34897/create_commits.py", line 572, in <module>
    main(
  File "/home/runner/work/_actions/asana/push-signed-commits/d615ca88d8e1a946734c24970d1e7a6c56f34897/create_commits.py", line 459, in main
    file_changes = get_file_changes_from_local_commit_hash(local_commit_hash)
  File "/home/runner/work/_actions/asana/push-signed-commits/d615ca88d8e1a946734c24970d1e7a6c56f34897/create_commits.py", line 193, in get_file_changes_from_local_commit_hash
    contents=get_file_contents_at_commit(commit_hash, filenames[0]),
  File "/home/runner/work/_actions/asana/push-signed-commits/d615ca88d8e1a946734c24970d1e7a6c56f34897/create_commits.py", line 111, in get_file_contents_at_commit
    text_contents = subprocess.run(
  File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/subprocess.py", line 507, in run
    stdout, stderr = process.communicate(input, timeout=timeout)
  File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/subprocess.py", line 1121, in communicate
    stdout = self.stdout.read()
  File "/opt/hostedtoolcache/Python/3.9.25/x64/lib/python3.9/codecs.py", line 322, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xdf in position 17: invalid continuation byte

@cfal
Copy link
Author

cfal commented Mar 23, 2026

@harshita-gupta can you take a look?

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant