No description
Find a file
Andrew McLeod 0031ca5d39 Pass Werkzeug/WSGI middleware bytestrings, not unicode. (#6180)
* Pass Werkzeug/WSGI middleware bytestrings, not unicode.

This fixes a bug that prevents website routing to non-ascii routes, such as
will be automatically created by items with non-ascii characters in their
names.

Werkzeug/WSGI actually does careful decoding of URLs passed to it which
ensure they are in the correct format internally. However, using a non-ascii
URL was causing a unicode error and exceptions.

In app.py, unicode_literals is in effect. SharedDataMiddleware and
StaticDataMiddleware instances are created to deal with files in 'assets'
and 'files', respectively. The paths passed need to be bytestrings; however,
due to the use of unicode, these were passed as unicode. This was causing a
later exception when using a (unicode) string method on the decoded URL
string. By explicitly passing bytestrings, this is avoided and everything
works as expected.

* Instead of calling str, call .encode('ascii') method for compatibility with Python3.

* Unicode URL WSGI fix: After testing, it is actually the key not the value of
the export that matters, however both can be wrapped in str() to get 'bytes'
in Python 2 and unicode in Python 3 (which WSGI seems to expect).
2018-10-02 15:32:59 +05:30
.github update issue / PR template 2018-06-27 14:19:24 +05:30
.travis Postgres support for Frappe (#5919) 2018-09-21 10:20:48 +05:30
ci add my_config patch to travis 2014-10-12 18:54:44 +05:30
frappe Pass Werkzeug/WSGI middleware bytestrings, not unicode. (#6180) 2018-10-02 15:32:59 +05:30
rollup fix(syntax): rollup config 2018-09-12 18:13:55 +05:30
test_sites Postgres support for Frappe (#5919) 2018-09-21 10:20:48 +05:30
.eslintignore Added files in .eslintignore, updated globals 2017-06-02 15:00:15 +05:30
.eslintrc New Build System: Rollup (#5010) 2018-02-20 13:47:48 +05:30
.gitignore Update .gitignore 2018-03-01 16:12:41 +05:30
.travis.yml chore: Exclude 2.7 and postgres test (#6145) 2018-09-27 09:16:23 +05:30
attributions.md Non Pour Accent! (#5427) 2018-04-10 22:53:42 -08:00
bandit.yml Postgres support for Frappe (#5919) 2018-09-21 10:20:48 +05:30
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2017-09-12 09:14:34 +05:30
hooks.md Non Pour Accent! (#5427) 2018-04-10 22:53:42 -08:00
LICENSE Update LICENSE 2018-04-12 17:27:20 +05:30
Makefile [NEW] Makefile to clean cache without restart 2018-03-08 15:18:32 +05:30
MANIFEST.in Fixed manifest and website 2014-06-09 13:21:57 +05:30
node_utils.js feat(build): Log build errors in browser console (#5932) 2018-08-07 14:42:39 +05:30
package.json Add Vue Support (#6025) 2018-08-29 12:03:27 +05:30
README.md Update README.md 2018-09-10 19:27:14 +05:30
requirements.txt Merge branch 'staging' into develop 2018-09-21 10:59:49 +00:00
setup.py removed bad code and made compatible with pip 10 (#5458) 2018-04-30 11:22:09 +05:30
socketio.js frappe: refactor async to realtime (#6015) 2018-08-28 15:31:20 +05:30
yarn.lock Add Vue Support (#6025) 2018-08-29 12:03:27 +05:30

Full-stack web application framework that uses Python and MariaDB on the server side and a tightly integrated client side library. Built for ERPNext

Table of Contents

Installation

Install via Frappe Bench

Contributing

  1. Pull Request Requirements
  2. Translations

Website

For details and documentation, see the website https://frappe.io

License

This repository has been released under the MIT License.