Re: [Django] #21282: The serialize_headers method of HttpResponse fails to handle latin1-compatible values

2013-10-17 Thread Django
#21282: The serialize_headers method of HttpResponse fails to handle
latin1-compatible values
--+
 Reporter:  xelnor|Owner:  nobody
 Type:  Bug   |   Status:  closed
Component:  HTTP handling |  Version:  1.4
 Severity:  Normal|   Resolution:  fixed
 Keywords:  http header encoding  | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by Claude Paroz ):

 In [changeset:"b2f9c74ed1cd246022ab52d239eeb33f950dcc70"]:
 {{{
 #!CommitTicketReference repository=""
 revision="b2f9c74ed1cd246022ab52d239eeb33f950dcc70"
 [1.6.x] Fixed #21282 -- Made HttpResponse.serialize_headers accept latin-1

 Thanks Raphaël Barrois for the report and the initial patch and
 Aymeric Augustin for the review.

 Backport of a14f087233 from master.
 }}}

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.666ffee0ea846339ee54be1977d5a254%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21282: The serialize_headers method of HttpResponse fails to handle latin1-compatible values

2013-10-17 Thread Django
#21282: The serialize_headers method of HttpResponse fails to handle
latin1-compatible values
--+
 Reporter:  xelnor|Owner:  nobody
 Type:  Bug   |   Status:  closed
Component:  HTTP handling |  Version:  1.4
 Severity:  Normal|   Resolution:  fixed
 Keywords:  http header encoding  | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by Claude Paroz ):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"a14f08723304be27e851c753a68c8200473a9ca1"]:
 {{{
 #!CommitTicketReference repository=""
 revision="a14f08723304be27e851c753a68c8200473a9ca1"
 Fixed #21282 -- Made HttpResponse.serialize_headers accept latin-1

 Thanks Raphaël Barrois for the report and the initial patch and
 Aymeric Augustin for the review.
 }}}

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.7b085482e56656eb665776db3fca9a75%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21282: The serialize_headers method of HttpResponse fails to handle latin1-compatible values

2013-10-17 Thread Django
#21282: The serialize_headers method of HttpResponse fails to handle
latin1-compatible values
--+
 Reporter:  xelnor|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  HTTP handling |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:  http header encoding  | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+

Comment (by claudep):

 I've attached a slightly different patch, Python 3 compatible. Aymeric's
 review mandatory!

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.7766fa987784c91245371b45a2d5420d%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21282: The serialize_headers method of HttpResponse fails to handle latin1-compatible values

2013-10-17 Thread Django
#21282: The serialize_headers method of HttpResponse fails to handle
latin1-compatible values
--+
 Reporter:  xelnor|Owner:  nobody
 Type:  Bug   |   Status:  new
Component:  HTTP handling |  Version:  1.4
 Severity:  Normal|   Resolution:
 Keywords:  http header encoding  | Triage Stage:  Accepted
Has patch:  1 |  Needs documentation:  0
  Needs tests:  0 |  Patch needs improvement:  0
Easy pickings:  0 |UI/UX:  0
--+
Changes (by claudep):

 * 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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.01f5c2c68c4f9170fa2c700993725da9%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #21282: The serialize_headers method of HttpResponse fails to handle latin1-compatible values

2013-10-17 Thread Django
#21282: The serialize_headers method of HttpResponse fails to handle
latin1-compatible values
-+-
 Reporter:  xelnor   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  HTTP handling|  Version:  1.4
 Severity:  Normal   |   Resolution:
 Keywords:  http header  | Triage Stage:
  encoding   |  Unreviewed
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by xelnor):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 The test suite passes with the proposed patch:
 {{{
 Ran 5906 tests in 201.214s

 OK (skipped=348, expected failures=11)
 }}}

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.f45b0f57b59bcfb540f45ed2fb6b59b5%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


[Django] #21282: The serialize_headers method of HttpResponse fails to handle latin1-compatible values

2013-10-17 Thread Django
#21282: The serialize_headers method of HttpResponse fails to handle
latin1-compatible values
---+--
 Reporter:  xelnor |  Owner:  nobody
 Type:  Bug| Status:  new
Component:  HTTP handling  |Version:  1.4
 Severity:  Normal |   Keywords:  http header encoding
 Triage Stage:  Unreviewed |  Has patch:  1
Easy pickings:  0  |  UI/UX:  0
---+--
 If a header value (passed as unicode) contains only ascii data,
 `serialize_headers()` doesn't fail
 If it contains characters that can't be encoded in latin1,
 `serialize_headers()` doesn't fail
 If it contains only characters valid in latin1, including some outside the
 ascii range, `serialize_headers()` fails with a `UnicodeDecodeError`.

 The culprit seems to lie on line 132 of `django/http/response.py`: that
 line calls `('%s: %s' % (key, value)).encode('us-ascii')`, but at this
 point, key is ascii bytes and value is a bytes array containing either
 latin1-encoded text or mime-encoded utf8 text.

 Since we're using `unicode_literals`, Python tries
 `value.decode('ascii')`, which fails if, and only if, value contains
 latin1 characters outside the ascii range.

 I have attached a patch containing both a test exhibiting the issue and a
 patch fixing it (no test failure).

 Note: This is not a release blocker, since the `serialize_headers()` and
 its callers (`serialize()` and `__str__()`) aren't used while answering
 requests.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.699d868ba0b74fad68a42da743fc2e78%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.