-
Notifications
You must be signed in to change notification settings - Fork 309
from __future__ import * #158
Comments
I still want this. I also want print_function and division. Queues us up for Python 3. |
Here's the docs on the So the action item here is to add the following to the top of all Python files and simplates:
I recall doing this in configure-aspen.py and having it blow up, so this isn't necessarily trivial. |
I'll try to give it some time over the weekend. |
@zwn Cool, thanks. :-) |
I'll update this as I go.
The option |
The biggest bummer so far has been that aspen expects Response body to be a bytestring. That kind of surprised me because where else would be a good idea to support unicode than in Response body? |
I've found this when testing elsewhere/github.py (unittest failed). That's how I have noticed that that get_user_info in bitbucket.py is not covered by any test. |
response.headers.cookie does not like unicode keys. |
Per IRC, we've got an Aspen ticket underway where we'll address body and cookie as unicode instead of bytestring. |
locale.setlocale also does not like unicode for the locale name. The rest seems to be working. I'll put it on a branch once the aspen side is done. |
I see that the default encoding for unicode body of response is ascii. |
We've landed the Aspen side of this, though there are probably regressions to shake out yet. |
@zwn This is ready again now that #1520 has landed. Yes, Aspen Response bodies are expected to be bytestrings. They need to be bytestrings on the wire, of course. It's rare with Aspen that you're instantiating your own Responses, and especially setting a body programmatically. Therefore we expect you to encode the body yourself rather than relying on a content-type sniffing algorithm. |
Apparently I lied. The Aspen ticket I was referring to was AspenWeb/pando.py#225, and there we added |
I don't follow. Did you look at https://github.com/gittip/aspen-python/blob/4708b450160a0f0eaf313dcdd7188ed93117fabb/aspen/http/response.py#L54 ? It allows body to be unicode. What is the principle of least surprise? Given a function, that takes two params - Yes, I'd like to block this. Or rather I don't feel like working around these in gittip is worth the time and effort. |
Right, my second comment basically nullifies my first, sorry. Agreed, let's wait for AspenWeb/pando.py#254. |
Closing in light of our decision to shut down Gratipay. Thank you all for a great run, and I'm sorry it didn't work out! 😞 💃 |
Once AspenWeb/pando.py#228 lands in a release we should upgrade Aspen and add this to the top of all files:
from __future__ import absolute_import, division, print_function, unicode_literals
This is good hygiene and preps us to migrate to Python 3 in the future.
was: use unicode_literals
from future import unicode_literals
@mjallday has it in his test suite, should use generally.
Want to back this issue? Place a bounty on it! We accept bounties via Bountysource.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: