Support unicode in resource refs
Open
Nobody has claimed this yet.
complexity:hard
enhancement
- Dominant language
- Python
- Stars
- 6.5k
- Forks
- 787
- PR merge metrics
- No merged PRs in 30d
Description
Unicode characters break bootstrap code:
2017-11-22 00:56:10,611 WARNING [-] Failed to register actions: Failed to register action "/opt/stackstorm/packs/testpack/actions/pythontest.meta.yaml" from pack "testpack": 'ascii' codec can't encode character u'\u2021' in position 10: ordinal not in range(128)
Traceback (most recent call last):
File "./st2common/bin/st2-register-content", line 22, in <module>
sys.exit(content_loader.main(sys.argv[1:]))
File "/home/vagrant/st2/st2common/st2common/content/bootstrap.py", line 388, in main
register_content()
File "/home/vagrant/st2/st2common/st2common/content/bootstrap.py", line 338, in register_content
register_actions()
File "/home/vagrant/st2/st2common/st2common/content/bootstrap.py", line 219, in register_actions
raise e
ValueError: Failed to register action "/opt/stackstorm/packs/testpack/actions/pythontest.meta.yaml" from pack "testpack": 'ascii' codec can't encode character u'\u2021' in position 10: ordinal not in range(128)
Should make sure this works for all resources, actions, rules, etc.
Contributor 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.
Research direction
Start with st2common/content/bootstrap.py and the st2common/bin/st2-register-content entry point, following register_content() and register_actions() from the reported traceback. Reproduce the failure with the Unicode resource reference shown in the issue, then verify bootstrap registration works for actions, rules, and other resources without ASCII encoding errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100