Re: [Django] #30294: HttpResponse doesn't handle memoryview objects

2020-11-10 Thread Django
#30294: HttpResponse doesn't handle memoryview objects
-+-
 Reporter:  Roger Hunwicks   |Owner:  sage
 Type:  New feature  |   Status:  closed
Component:  HTTP handling|  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Carlton Gibson ):

 In [changeset:"1fd9b44a6b1bde29fb1f6746e007787505608974" 1fd9b44]:
 {{{
 #!CommitTicketReference repository=""
 revision="1fd9b44a6b1bde29fb1f6746e007787505608974"
 Refs #32074 -- Fixed handling memoryview content by HttpResponse on Python
 3.10+.

 An iterator was added to memoryview in Python 3.10,
 see https://bugs.python.org/issue41732

 Refs #30294
 }}}

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.4cd43b67154c07698c815efcd824395c%40djangoproject.com.


Re: [Django] #30294: HttpResponse doesn't handle memoryview objects

2019-03-29 Thread Django
#30294: HttpResponse doesn't handle memoryview objects
-+-
 Reporter:  Roger Hunwicks   |Owner:  sage
 Type:  New feature  |   Status:  closed
Component:  HTTP handling|  Version:  master
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Tim Graham ):

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


Comment:

 In [changeset:"9aa56cb0d5dede7fc176a46c745dfd3dacdad773" 9aa56cb]:
 {{{
 #!CommitTicketReference repository=""
 revision="9aa56cb0d5dede7fc176a46c745dfd3dacdad773"
 Fixed #30294 -- Allowed HttpResponse to accept memoryview content.
 }}}

-- 
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/067.25d9424d8b9389f8a3bb5b72ebe2550b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30294: HttpResponse doesn't handle memoryview objects

2019-03-28 Thread Django
#30294: HttpResponse doesn't handle memoryview objects
-+-
 Reporter:  Roger Hunwicks   |Owner:  sage
 Type:  New feature  |   Status:  assigned
Component:  HTTP handling|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Carlton Gibson):

 OK, thanks for the follow-up. I think Simon is correct. We'll need a
 release note... will comment on the PR.

-- 
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/067.739d64796b61abbca73e23a1d298f552%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30294: HttpResponse doesn't handle memoryview objects

2019-03-27 Thread Django
#30294: HttpResponse doesn't handle memoryview objects
-+-
 Reporter:  Roger Hunwicks   |Owner:  sage
 Type:  New feature  |   Status:  assigned
Component:  HTTP handling|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Simon Charette):

 `BinaryField` was introduced in 1.8 and has been returning `memoryview` on
 Python 3 `psycopg2` since then so this isn't a regression nor a bug in a
 newly introduced feature; this has been happening since the feature was
 introduced.

 I considered this was a ''new feature'' because `HttpResponse` never
 handled `memoryview` objects in the first place. Interactions with
 `BinaryField` is red herring here IMO.

-- 
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/067.8c3c72971fcc9bca099a512de885c77f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30294: HttpResponse doesn't handle memoryview objects

2019-03-27 Thread Django
#30294: HttpResponse doesn't handle memoryview objects
-+-
 Reporter:  Roger Hunwicks   |Owner:  sage
 Type:  New feature  |   Status:  assigned
Component:  HTTP handling|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-

Comment (by Roger Hunwicks):

 Personally, I think it is a Bug Fix because this used to work on Django
 1.8 and Python 2.7 and it no longer works on Django 2.2 and Python 3.x.
 The difference is that in Python 2.7 `BinaryField` returned a `buffer`
 which was handled correctly, but on Python 3.6 it returns a `memoryview`.
 I think this change is because Psycopg2 returns different on objects on
 Py2 vs Py3 and `BinaryField` just passes them on. It is not Django's fault
 that the Py2 vs Py3 differences in the upstream library caused a
 regression, but it still looks like a regression that Django code that
 used to work (`BinaryField` -> `HttpResponse`) no longer does.

-- 
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/067.f3bfd8e1b90ff4ab0680e374628a325a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30294: HttpResponse doesn't handle memoryview objects

2019-03-27 Thread Django
#30294: HttpResponse doesn't handle memoryview objects
-+-
 Reporter:  Roger Hunwicks   |Owner:  sage
 Type:  New feature  |   Status:  assigned
Component:  HTTP handling|  Version:  master
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Ready for
 |  checkin
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  1|UI/UX:  0
-+-
Changes (by Carlton Gibson):

 * needs_tests:  1 => 0
 * stage:  Accepted => Ready for checkin


Comment:

 I've just asked for the test case to be moved (from `tests/responses` to
 `tests/httpwrappers`, since that looks like the more suitable home) but
 assuming that's in place this looks ready to go.

 So, question: are we sure this is a New Feature, rather than a Bug fix?
 (Just thinking re release notes and/or backports)

-- 
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/067.ccca6307c28901efbe1945d5b1cdb969%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30294: HttpResponse doesn't handle memoryview objects

2019-03-27 Thread Django
#30294: HttpResponse doesn't handle memoryview objects
+
 Reporter:  Roger Hunwicks  |Owner:  sage
 Type:  New feature |   Status:  assigned
Component:  HTTP handling   |  Version:  master
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  1   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+
Changes (by Carlton Gibson):

 * needs_tests:  0 => 1


-- 
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/067.6291a9822b8ebb073258aa5932cafd82%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30294: HttpResponse doesn't handle memoryview objects

2019-03-27 Thread Django
#30294: HttpResponse doesn't handle memoryview objects
+
 Reporter:  Roger Hunwicks  |Owner:  sage
 Type:  New feature |   Status:  assigned
Component:  HTTP handling   |  Version:  master
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+
Changes (by felixxm):

 * has_patch:  0 => 1


Comment:

 [https://github.com/django/django/pull/11133 PR]

-- 
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/067.833ff42ddc5770154d6fc9feea8da564%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30294: HttpResponse doesn't handle memoryview objects

2019-03-26 Thread Django
#30294: HttpResponse doesn't handle memoryview objects
+
 Reporter:  Roger Hunwicks  |Owner:  sage
 Type:  New feature |   Status:  assigned
Component:  HTTP handling   |  Version:  master
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+

Comment (by sage):

 Does
 
[https://github.com/laymonage/django/commit/6f57880bb3f4b1deaad5dc0949b1369a006f51e4
 this] look 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 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/067.f47b1989780bb467ba4c5b8af3aa709f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30294: HttpResponse doesn't handle memoryview objects

2019-03-26 Thread Django
#30294: HttpResponse doesn't handle memoryview objects
+
 Reporter:  Roger Hunwicks  |Owner:  sage
 Type:  New feature |   Status:  assigned
Component:  HTTP handling   |  Version:  master
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+
Changes (by sage):

 * status:  new => assigned
 * owner:  nobody => sage


Comment:

 I'll try to work on this.

-- 
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/067.92004995f706f3e9a28d7143f2ed2db3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30294: HttpResponse doesn't handle memoryview objects

2019-03-26 Thread Django
#30294: HttpResponse doesn't handle memoryview objects
+
 Reporter:  Roger Hunwicks  |Owner:  nobody
 Type:  New feature |   Status:  new
Component:  HTTP handling   |  Version:  master
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+

Comment (by Simon Charette):

 The fact `make_bytes` would still use `force_bytes` if
 da56e1bac6449daef9aeab8d076d2594d9fd5b44 didn't refactor it and that
 d680a3f4477056c69629b0421db4bb254b8c69d0 added `memoryview` support to
 `force_bytes` strengthen my assumption that `make_bytes` should be
 adjusted as well.

-- 
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/067.dfb1ea868dd2b5c0c97fbf7a693156cc%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30294: HttpResponse doesn't handle memoryview objects

2019-03-26 Thread Django
#30294: HttpResponse doesn't handle memoryview objects
+
 Reporter:  Roger Hunwicks  |Owner:  nobody
 Type:  Bug |   Status:  new
Component:  HTTP handling   |  Version:  master
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+
Changes (by Simon Charette):

 * stage:  Unreviewed => Accepted


Comment:

 I guess `HttpResponseBase.make_bytes`
 
[https://github.com/django/django/blob/9caa3e0a29c54939cc923c1693f491ff6c8e77e2/django/http/response.py#L232-L233
 could be adapted] to deal with `memoryview` objects by casting them to
 `bytes`.

 In all cases simply wrapping the `memoryview` in `bytes` works as a
 workaround `HttpResponse(bytes(model.binary_field))`.

-- 
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/067.2fefc14ea5a65cc537d45823fd6bf4b5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30294: HttpResponse doesn't handle memoryview objects

2019-03-26 Thread Django
#30294: HttpResponse doesn't handle memoryview objects
+
 Reporter:  Roger Hunwicks  |Owner:  nobody
 Type:  New feature |   Status:  new
Component:  HTTP handling   |  Version:  master
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Accepted
Has patch:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  1   |UI/UX:  0
+
Changes (by Simon Charette):

 * type:  Bug => New feature


-- 
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/067.06a788038ffac006555786605670a6bd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.