crossbario / crossbario/autobahn-python
Passing url or realm as non-unicode string fails without readable error
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 768
- PR merge metrics
- No merged PRs in 30d
Description
The fix for #470 adds type checking to ensure that the url and realm are given as unicode strings. In previous versions, non-unicode strings could be used, so this may break user code. When it does break, the reason isn't immediately clear.
This could be remedied by adding error messages to the relevant assert statements in wamp.py:
assert(type(url) == six.text_type), "url must be a unicode string"
assert(type(realm) == six.text_type), "realm must be a unicode string"
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
Open wamp.py and locate the assert statements validating url and realm. Confirm how non-unicode inputs currently fail, then add the readable messages shown in the issue. Done means both assertions explain which argument requires a unicode string.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100