Unicode errors when creating a new operator-framework charm.
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
Research direction
Start in charmtools/templates/operator_python/template.py, especially _template_file, and reproduce the failure with charm create using the operator-framework template. Check the Cheetah template loading shown in the traceback; done means creating the charm directory succeeds when the template contains the reported non-ASCII text.
Written by the indexing model from the issue text.
Description
Checklist
- Confirmed this is an issue with charm-tools, not charmstore-client
- Provide versions of tools used
- Described the feature or ways to replicate the issue
What version am I running?
I ran the following command: snap info charm and got the following ouput:
name: charm
summary: charm and charm-tools
publisher: Canonical✓
contact: https://discourse.juju.is/c/charming
license: unset
description: |
charmstore-client and charm-tools
commands:
- charm
snap-id: 2Rryoc2ylScfbFl4eQtpntHD9iuZuMvt
tracking: stable
refresh-date: today at 01:03 AEST
channels:
stable: 2.7.7 2020-07-20 (502) 117MB classic
candidate: 2.7.7 2020-07-20 (502) 117MB classic
beta: 2.7.7 2020-07-20 (502) 117MB classic
edge: 2.7.7 2020-07-20 (502) 117MB classic
installed: 2.7.7 (502) 117MB classic
I am using: Arch Linux
Issue/Feature
I expect/expected the following
Successfully creating a new charm dir for operator framework
What I got
/var/lib/snapd/snap/charm/502/bin/wrappers/charm: line 8: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8): No such file or directory
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8)
INFO: Generating charm for test1 in ./test1
INFO: No test1 in apt cache; creating an empty charm instead.
User-friendly name for this charm: test1
Developer contact email: [email protected]
Developer name: tlm
URL where bugs can be filed for this Charm: github.com
Cloning into '/tmp/tmpmzvy_wcg'...
warning: templates not found /snap/charm/502/share/git-core/templates
remote: Enumerating objects: 104, done.
remote: Counting objects: 100% (104/104), done.
remote: Compressing objects: 100% (57/57), done.
remote: Total 104 (delta 35), reused 98 (delta 30), pack-reused 0
Receiving objects: 100% (104/104), 14.95 KiB | 14.95 MiB/s, done.
Resolving deltas: 100% (35/35), done.
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8)
Traceback (most recent call last):
File "/snap/charm/502/bin/charm-create", line 33, in <module>
sys.exit(load_entry_point('charm-tools==2.7.7', 'console_scripts', 'charm-create')())
File "/snap/charm/502/lib/python3.6/site-packages/charmtools/create.py", line 98, in main
generator.create_charm()
File "/snap/charm/502/lib/python3.6/site-packages/charmtools/generators/generator.py", line 82, in create_charm
self.plugin.create_charm(user_config, tempdir)
File "/snap/charm/502/lib/python3.6/site-packages/charmtools/templates/operator_python/template.py", line 74, in create_charm
self._template_file(config, path.join(root, outfile))
File "/snap/charm/502/lib/python3.6/site-packages/charmtools/templates/operator_python/template.py", line 90, in _template_file
template = Template(file=outfile, searchList=(config))
File "/snap/charm/502/lib/python3.6/site-packages/Cheetah/Template.py", line 1281, in __init__
self._compile(source, file, compilerSettings=compilerSettings)
File "/snap/charm/502/lib/python3.6/site-packages/Cheetah/Template.py", line 1573, in _compile
keepRefToGeneratedCode=True)
File "/snap/charm/502/lib/python3.6/site-packages/Cheetah/Template.py", line 752, in compile
settings=(compilerSettings or {}))
File "/snap/charm/502/lib/python3.6/site-packages/Cheetah/Compiler.py", line 1551, in __init__
source = f.read()
File "/snap/charm/502/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 79: ordinal not in range(128)
- Dominant language
- Python
- Stars
- 44
- Forks
- 65
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from juju/charm-tools
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
juju/charm-tools#684 · 1 comment ·
-
`No module named 'cgi'` under py3.13Possibly taken @branchv claimed this 719 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
juju/charm-tools#681 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
juju/charm-tools#677 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
juju/charm-tools#673 · 4 comments ·
-
charm-tools 2.8.x snap only releases for amd64; need arm64, ppc64el and s390x releasesPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
juju/charm-tools#666 · 4 comments ·
All issues in juju/charm-tools
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
snap-stanford/Biomni#380 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
microsoft/playwright-python#3361 ·
Maintainers usually reply within 1 day
-
documentation priority: low size: S status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
cubrid-lab/sqlalchemy-cubrid#1397 ·
Maintainers usually reply within 1 day
-
documentation priority: low size: S status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cubrid-lab/pycubrid#1307 ·
Maintainers usually reply within 1 day
-
[Bug]: Installer hides SSL certificate errors as bare URLError, and the suggested fix can't workOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
ShaftHQ/chaosengine-harness#143 ·
Maintainers usually reply within 1 day