crossbario / crossbario/autobahn-python

Passing url or realm as non-unicode string fails without readable error

Open
#486 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement needs-discussion wamp
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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.