This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author riffm
Recipients riffm
Date 2011-01-18.17:29:19
SpamBayes Score 5.0085833e-07
Marked as misclassified No
Message-id <1295371764.49.0.785710350986.issue10935@psf.upfronthosting.co.za>
In-reply-to
Content
This code:

    assert type(val) is StringType,"Header values must be strings"

(from here http://svn.python.org/view/python/tags/r271/Lib/wsgiref/handlers.py?revision=86833&view=markup)

from "start_response" method, is not allowing to use str subclasses objects as header value.

Usecase:

I made class URL which subclasses str and has additional methods to manipulate query string. It is very handy. But when I need to set header
"Location" with URL object as value I get assertion error.

Can't we do this instead:

    assert isinstance(val, str),"Header values must be strings"
History
Date User Action Args
2011-01-18 17:29:24riffmsetrecipients: + riffm
2011-01-18 17:29:24riffmsetmessageid: <1295371764.49.0.785710350986.issue10935@psf.upfronthosting.co.za>
2011-01-18 17:29:19riffmlinkissue10935 messages
2011-01-18 17:29:19riffmcreate