Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
should
should
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 26
    • Issues 26
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 4
    • Merge Requests 4
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • vidjil
  • shouldshould
  • Issues
  • #47

Closed
Open
Opened Feb 28, 2020 by Mikaël Salson@mikael-sOwner
  • Report abuse
  • New issue
Report abuse New issue

Issue with Unicode characters in the test description

With some setups when the test description (after the $) contains Unicode characters (such as accents), should.py fails with the following error:

Traceback (most recent call last):
  File "should.py", line 1151, in <module>
    status = fs.test(variables = variables, cd = args.cd, cd_same = args.cd_same, output = args.output, verbose = args.verbose, only = only)
  File "should.py", line 1024, in test
    s.test(open(f), variables, verbose - 1, only=only)
  File "should.py", line 735, in test
    for l in list(should_lines) + [DIRECTIVE_SCRIPT]:
  File "/usr/lib/python3.5/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 16: ordinal not in range(128)

For instance it fails with Debian docker images (Debian 7, 8 or 9, but not with version 10).

Here is a Dockerfile to reproduce the bug:

from debian:9-slim

run apt-get update && apt-get install -y python3 wget
run wget -O should.py https://gitlab.bioinfo-diag.fr/vidjil/should/raw/master/src/should.py?inline=false

run echo 'ls should.py\n\n$ ÉÀ\n1:should.py' > test.should

And then

# Build the image
docker build -t should/issue:47 - < Dockerfile
# Launch the test
docker run should/issue:47 python3 should.py test.should

This script is used with CI which can rely on such Debian images.

To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: vidjil/should#47