Re: [Django] #15094: Convert STATICFILES_DIRS into a tuple if set as string

2011-02-01 Thread Django
#15094: Convert STATICFILES_DIRS into a tuple if set as string
--+-
   Reporter:  oxy | Owner:  nobody
 Status:  reopened| Milestone:
  Component:  django.contrib.staticfiles  |   Version:  SVN   
 Resolution:  |  Keywords:
   Triage Stage:  Accepted| Has patch:  1 
Needs documentation:  0   |   Needs tests:  0 
Patch needs improvement:  0   |  
--+-
Changes (by jezdez):

  * component:  Contrib apps => django.contrib.staticfiles


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15094: Convert STATICFILES_DIRS into a tuple if set as string

2011-02-01 Thread Django
#15094: Convert STATICFILES_DIRS into a tuple if set as string
+---
   Reporter:  oxy   | Owner:  nobody
 Status:  reopened  | Milestone:
  Component:  Contrib apps  |   Version:  SVN   
 Resolution:|  Keywords:
   Triage Stage:  Accepted  | Has patch:  1 
Needs documentation:  0 |   Needs tests:  0 
Patch needs improvement:  0 |  
+---
Changes (by jezdez):

  * status:  closed => reopened
  * resolution:  wontfix =>
  * stage:  Unreviewed => Accepted


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15094: Convert STATICFILES_DIRS into a tuple if set as string

2011-01-31 Thread Django
#15094: Convert STATICFILES_DIRS into a tuple if set as string
+---
   Reporter:  oxy   | Owner:  nobody
 Status:  closed| Milestone:
  Component:  Contrib apps  |   Version:  SVN   
 Resolution:  wontfix   |  Keywords:
   Triage Stage:  Unreviewed| Has patch:  1 
Needs documentation:  0 |   Needs tests:  0 
Patch needs improvement:  0 |  
+---

Comment (by oxy):

 According to your suggestions I created a second patch and added a test.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15094: Convert STATICFILES_DIRS into a tuple if set as string

2011-01-20 Thread Django
#15094: Convert STATICFILES_DIRS into a tuple if set as string
---+
  Reporter:  oxy   | Owner:  nobody
Status:  closed| Milestone:
 Component:  Contrib apps  |   Version:  SVN   
Resolution:  wontfix   |  Keywords:
 Stage:  Unreviewed| Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by lukeplant):

 Yes, a patch like that would be accepted, since it is always going to be
 an error to pass a string. Remember not use the the 'if then else'
 expression that is not available in Python 2.4

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15094: Convert STATICFILES_DIRS into a tuple if set as string

2011-01-20 Thread Django
#15094: Convert STATICFILES_DIRS into a tuple if set as string
---+
  Reporter:  oxy   | Owner:  nobody
Status:  closed| Milestone:
 Component:  Contrib apps  |   Version:  SVN   
Resolution:  wontfix   |  Keywords:
 Stage:  Unreviewed| Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by oxy):

 Your points are true.

 I just think the currently raised exception does not point to the real
 cause. At least in my case it took me some time to find I just forgot to
 append the comma.

 My suggestion was based on the behaviour in django core, but now an
 exception like "you entered a string, but a tuple is expected" seems more
 reasonable to me.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15094: Convert STATICFILES_DIRS into a tuple if set as string

2011-01-20 Thread Django
#15094: Convert STATICFILES_DIRS into a tuple if set as string
---+
  Reporter:  oxy   | Owner:  nobody
Status:  closed| Milestone:
 Component:  Contrib apps  |   Version:  SVN   
Resolution:  wontfix   |  Keywords:
 Stage:  Unreviewed| Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by jezdez):

 Replying to [comment:3 lukeplant]:
 > Automagically fixing these settings, the way that INSTALLED_APPS and
 TEMPLATE_DIRS does, is a bad idea IMO. Validation that throws an exception
 is acceptable, but automatically fixing like that only leads to further
 confusion, and leads to other code having to make the same fixes so that
 it can cope with everything that Django copes with. This often shows up
 with backwards compatibility or interop concerns.
 >
 > I'd be strongly in favour of changing the INSTALLED_APPS handling to
 raise a `ConfigurationError` instead, but that might require a deprecation
 path.

 Couldn't agree more, although we already have `ImproperlyConfigured` which
 I believe could be used for this without having to require a deprecation
 path.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15094: Convert STATICFILES_DIRS into a tuple if set as string

2011-01-20 Thread Django
#15094: Convert STATICFILES_DIRS into a tuple if set as string
---+
  Reporter:  oxy   | Owner:  nobody
Status:  closed| Milestone:
 Component:  Contrib apps  |   Version:  SVN   
Resolution:  wontfix   |  Keywords:
 Stage:  Unreviewed| Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by lukeplant):

 Automagically fixing these settings, the way that INSTALLED_APPS and
 TEMPLATE_DIRS does, is a bad idea IMO. Validation that throws an exception
 is acceptable, but automatically fixing like that only leads to further
 confusion, and leads to other code having to make the same fixes so that
 it can cope with everything that Django copes with. This often shows up
 with backwards compatibility or interop concerns.

 In this case, there will be confusion over why switching from a string to
 a tuple pair causes breakage.

 To give a different example, the mess in
 
http://code.djangoproject.com/browser/django/trunk/django/views/decorators/cache.py#L11
 was caused by requiring backwards compatibility with code that gave the
 'convenience' of being able to do these:

 {{{
 #!python

 @cache_page
 def foo(request):
 ...

 # or
 foo = cache_page(foo)

 # or
 @cache_page(123)
 def foo(request):
 ...

 # or
 foo = cache_page(foo, 123)

 }}}

 instead of the slightly uglier but consistent:

 {{{
 #!python

 @cache_page()
 def foo(request):
 ...

 # or
 foo = cache_page()(foo)

 # or
 @cache_page(123)
 def foo(request):
 ...

 # or
 foo = cache_page(123)(foo)

 }}}

 I'd be strongly in favour of changing the INSTALLED_APPS handling to raise
 a `ConfigurationError` instead, but that might require a deprecation path.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15094: Convert STATICFILES_DIRS into a tuple if set as string

2011-01-18 Thread Django
#15094: Convert STATICFILES_DIRS into a tuple if set as string
---+
  Reporter:  oxy   | Owner:  nobody
Status:  closed| Milestone:
 Component:  Contrib apps  |   Version:  SVN   
Resolution:  wontfix   |  Keywords:
 Stage:  Unreviewed| Has_patch:  1 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by oxy):

  * has_patch:  0 => 1

Comment:

 Sure, you can't determine if STATICFILES_DIRS is set properly if you know
 it's of type tuple. But you can determine that it's definitely wrong if
 it's a string (STATICFILES_DIRS has to be a tuple).

 Therefore if it's mistakenly entered as string converting it into a tuple
 should be safe.

 As this is a simple fix I created a patch, I hope it's good?!

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #15094: Convert STATICFILES_DIRS into a tuple if set as string

2011-01-15 Thread Django
#15094: Convert STATICFILES_DIRS into a tuple if set as string
---+
  Reporter:  oxy   | Owner:  nobody
Status:  closed| Milestone:
 Component:  Contrib apps  |   Version:  SVN   
Resolution:  wontfix   |  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  0 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by jezdez):

  * status:  new => closed
  * needs_better_patch:  => 0
  * resolution:  => wontfix
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 This can't be easily achieved since STATICFILES_DIRS can itself contain
 tuples (prefx, location pairs), so a check or automagic change would make
 this rather pointless.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



[Django] #15094: Convert STATICFILES_DIRS into a tuple if set as string

2011-01-15 Thread Django
#15094: Convert STATICFILES_DIRS into a tuple if set as string
--+-
 Reporter:  oxy   |   Owner:  nobody
   Status:  new   |   Milestone:
Component:  Contrib apps  | Version:  SVN   
 Keywords:|   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 Hi

 If you mistakenly set STATICFILES_DIRS as a string instead of a tuple
 (e.g. forgot the comma), findstatic et al raise an exception like
 {{{
 ValueError: The joined path (/css/main.css) is located outside of the base
 path component (/)
 }}}
 which is not very enlightening in this case.

 Django core solves this for INSTALLED_APPS and TEMPLATE_DIRS nicely in {{{
 django/conf/__init__.py }}} line 93ff.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.