Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ggshield scan docker <imagename>:<tag> is generating a UnicodeEncodeError #160

Closed
1 task done
testworksau opened this issue Jan 17, 2022 · 3 comments
Closed
1 task done
Labels
status:new This issue needs to be reviewed type:bug Something isn't working

Comments

@testworksau
Copy link

testworksau commented Jan 17, 2022

GitGuardian Shield Version 1.10.7

Successfully installed certifi-2021.10.8 charset-normalizer-2.0.10 click-8.0.3 colorama-0.4.4 
ggshield-1.10.7 idna-3.3 marshmallow-3.14.1 pygitguardian-1.3.1 python-dotenv-0.19.2 
pyyaml-6.0 requests-2.27.1 termcolor-1.1.0 urllib3-1.26.8 yaspin-2.1.0
  • I can reproduce this bug in the latest version

Command executed

Successfully built 63dccaba0eeb
Successfully tagged artifactory.our.domain.name/our-docker/our-dotnet-framework-build:1.0
...
ggshield scan docker artifactory.our.domain.name/our-docker/our-dotnet-framework-build:1.0

Describe the bug

We are seeing an error when attempting to scan docker images for one of our Windows containers

Expected behavior

No error occurs

Traceback

  Exception in thread Thread-3 (_spin):
  Traceback (most recent call last):
  File "C:\Python310\lib\threading.py", line 1009, in _bootstrap_inner
  self.run()
  File "C:\Python310\lib\threading.py", line 946, in run
  self._target(*self._args, **self._kwargs)
  File "C:\agent\builds\build-windows-i-04d123e69160d89e5-1\ourorg\docker-image-builder\ggshield\lib\site-packages\yaspin\core.py", line 360, in _spin
  sys.stdout.write(out)
  File "C:\Python310\lib\encodings\cp1252.py", line 19, in encode
  return codecs.charmap_encode(input,self.errors,encoding_table)[0]
  UnicodeEncodeError: 'charmap' codec can't encode character '\u280b' in position 1: character maps to <undefined>
@testworksau testworksau added type:bug Something isn't working status:new This issue needs to be reviewed labels Jan 17, 2022
@agateau-gg
Copy link
Collaborator

Hi Glenn, thanks for your report.

This looks like a bug in one of our dependencies (yaspin). Can you try with this branch: workaround-yaspin-bug?

@testworksau
Copy link
Author

No worries @agateau-gg - thanks for assessing the issue so quickly!

I can confirm that the workaround-yaspin-bug branch resolves the error 🎉

agateau-gg added a commit that referenced this issue Jan 20, 2022
Replace yaspin with click.echo() calls, since yaspin fails on Windows.
agateau-gg added a commit that referenced this issue Jan 21, 2022
Replace yaspin with click.echo() calls, since yaspin fails on Windows.
@agateau-gg
Copy link
Collaborator

This is now fixed in main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:new This issue needs to be reviewed type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants