docopt
docopt copied to clipboard
detect string in a way that works with both Python 2.x and 3.x
This is how the six package detects strings (see http://stackoverflow.com/a/20612311/81346)
It resolves https://github.com/docopt/docopt/issues/219
:+1:
I just ran into this frustrating bug. Anything keeping us from merging?
Nothing should keep us from merging as far as I know, but I'm not a collaborator. This fork has my fix in it: https://pypi.python.org/pypi/docopt-unicode/0.6.1
:+1:
Does anyone have an example where sys.argv can contain unicode? The docopt maintainer is asking:
https://github.com/docopt/docopt/issues/219#issuecomment-136360365
I ran into this when injecting arguments into a docopt based module in a unit test with something like docopt(__doc__, ['a', 'b']).
Forgot to mention: doesn't have to be Python 3, the problem occurs with Python 2 and unicode_literals, too.
@dweaver What's the plan for this PR?