StackStorm / StackStorm/st2

Support unicode in resource refs

Open
#3,874 2 comments 1 reaction 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.