Merge lp:~cjwatson/storm/fix-py3-cextensions into lp:storm
Proposed by
Colin Watson
Status: | Merged |
---|---|
Merged at revision: | 534 |
Proposed branch: | lp:~cjwatson/storm/fix-py3-cextensions |
Merge into: | lp:storm |
Diff against target: |
53 lines (+11/-2) 3 files modified
NEWS (+2/-0) storm/cextensions.c (+8/-1) tox.ini (+1/-1) |
To merge this branch: | bzr merge lp:~cjwatson/storm/fix-py3-cextensions |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Kristian Glass (community) | Approve | ||
Storm Developers | Pending | ||
Review via email: mp+373435@code.launchpad.net |
Commit message
Fix C version of Compile.
Description of the change
On Python 3, an "S" argument only takes bytes, but this parameter should only accept text. (It still accepts either bytes or text on Python 2.)
The reason this wasn't caught in tests was a little subtle. tox installs the C extension in a virtualenv, as you might expect; but, when running the test program, the storm package is imported from the same directory as the test program, and so it never actually finds any C extensions. The simplest workaround is to move the test program to a subdirectory, where no storm package exists and so it will be properly imported from the virtualenv.
To post a comment you must log in.
I'm not familiar with Python C extensions, but your change certainly makes sense in the context of having just read https:/ /docs.python. org/3/c- api/arg. html#parsing- arguments