Opened 14 years ago
Last modified 14 years ago
#16677 closed Bug
ssi template tag fails when the path to the template contains a space — at Version 2
| Reported by: | Aymeric Augustin | Owned by: | nobody |
|---|---|---|---|
| Component: | Template system | Version: | 1.3 |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
I initially noticed this problem here: http://ci.myks.org/job/Django%20+%20Oracle/42/console
Since the project is called "Django + Oracle", the checkout ends up in "/var/lib/jenkins/jobs/Django + Oracle/workspace", and there are spaces in the paths to the templates used by the tests.
To reproduce the problem, move your checkout of django so there's a space somewhere in the path (for instance mv django-trunk "django trunk") and run PYTHONPATH=.. ./runtests.py --settings=test_sqlite templates.
Apparently the current implementation of the ssi tag doesn't support spaces in the path to the template.
Change History (3)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
| Description: | modified (diff) |
|---|---|
| Summary: | templates tests fail when the path to django contains a space → ssi template tag fails when the path to the template contains a space |
by , 14 years ago
| Attachment: | 16677.patch added |
|---|
The
ssitag is defined twice, indjango/template/defaulttags.pyand indjango/templatetags/future.py. I recommend:token.split_contents()(quotes-aware spitting) instead oftoken.contents.split()(naïve splitting) to parse the content of the tag.I think the second point is a real bug and I've added a test case for it — a template whose file name contains spaces.
Attached patch implements this.