- **status**: in-progress --> review - **Comment**: Closed #771. `ib/7878`
Ok, it was worse than I expected :) I've managed to fix some of the issues. A lot of tests still failing, though, and some pages raise unicode errors (e.g. git repo main page) and it need a lot of manual checking. What I did: - run `futurize --stage1 --all-imports --unicode-literals -w **/*.py` - changed `name` and `polymorphic_identity` to string in all ming models/collections - changed `package_data` dictionary keys to string for `setup.py` - converted arguments to sting for the test app (our version of WebTest does not handle unicode well, newer versions do) - Fixed `AntiSpam` decorator. It is quick fix in order to get at least some of the pages to render. We might want to look at it closer and test it more. Don't sure it will work for all the cases. I didn't dig deep in the code to save time to investigate further. - Changed some of the headers/environ set from our internal middlewares. The last point was hardest to spot and debug. It is reproducible only if you run wsgi app. If you working locally with `paster serve` this does not arise. Adding `LoggingMiddleware` to `allura.wsgi` from [here](https://code.google.com/p/modwsgi/wiki/DebuggingTechniques) helped a lot. It prints request/response environ to apache error log. See also commit comments for some details. Further work that need to be done: - Look for places where we set response headers, convert keys and vals to plain strings - Check as many as possible pages by hand to discover and fix unicode errors - Check stuff that interacts with FS (import/export, repo tarballs, etc) - `ForgeHg` and other packages we maintain will probably need steps mentioned above too - Fix tests - Similar fixes for internal SourceForge stuff? Maybe we should tackle these incrementally one by one if we wanna proceed further. They might be intertwined, though. --- ** [tickets:#7878] Try unicode_literals** **Status:** review **Milestone:** unreleased **Labels:** sf-current sf-2 42cc **Created:** Mon May 18, 2015 03:26 PM UTC by Dave Brondsema **Last Updated:** Tue May 19, 2015 06:57 AM UTC **Owner:** Igor Bondarenko Try `from __future__ import unicode_literals` and possibly `absolute_import, division, print_function` too, in our existing Allura .py files. See what sort of issues may arise. Related email thread starts at http://mail-archives.apache.org/mod_mbox/allura-dev/201504.mbox/%3C553955A5.6020006%40brondsema.net%3E --- Sent from forge-allura.apache.org because [email protected] is subscribed to https://forge-allura.apache.org/p/allura/tickets/ To unsubscribe from further messages, a project admin can change settings at https://forge-allura.apache.org/p/allura/admin/tickets/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.
