Re: [Django] #28235: LiveServerTestCase crashes because it got a ParseResultBytes instance

2017-05-31 Thread Django
#28235: LiveServerTestCase crashes because it got a ParseResultBytes instance
---+--
 Reporter:  Curtis Maloney |Owner:  nobody
 Type:  Bug|   Status:  closed
Component:  Testing framework  |  Version:  1.11
 Severity:  Normal |   Resolution:  invalid
 Keywords: | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--
Changes (by Tim Graham):

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


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


Re: [Django] #28235: LiveServerTestCase crashes because it got a ParseResultBytes instance

2017-05-25 Thread Django
#28235: LiveServerTestCase crashes because it got a ParseResultBytes instance
---+--
 Reporter:  Curtis Maloney |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  1.11
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by Tim Graham):

 Do you plan to investigate further as to whether your patch is a good
 approach?

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


Re: [Django] #28235: LiveServerTestCase crashes because it got a ParseResultBytes instance

2017-05-23 Thread Django
#28235: LiveServerTestCase crashes because it got a ParseResultBytes instance
---+--
 Reporter:  Curtis Maloney |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  1.11
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by Curtis Maloney):

 Setting STATIC_URL in settings fixed this issue.

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


Re: [Django] #28235: LiveServerTestCase crashes because it got a ParseResultBytes instance

2017-05-23 Thread Django
#28235: LiveServerTestCase crashes because it got a ParseResultBytes instance
---+--
 Reporter:  Curtis Maloney |Owner:  nobody
 Type:  Bug|   Status:  new
Component:  Testing framework  |  Version:  1.11
 Severity:  Normal |   Resolution:
 Keywords: | Triage Stage:  Unreviewed
Has patch:  1  |  Needs documentation:  0
  Needs tests:  0  |  Patch needs improvement:  0
Easy pickings:  0  |UI/UX:  0
---+--

Comment (by Curtis Maloney):

 As can be seen here the error happens on 1.8 to 1.11.2, and py 3.3 - 3.6

 https://travis-ci.org/funkybob/django-nap/builds/235472369

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


[Django] #28235: LiveServerTestCase crashes because it got a ParseResultBytes instance

2017-05-23 Thread Django
#28235: LiveServerTestCase crashes because it got a ParseResultBytes instance
-+
   Reporter:  Curtis Maloney |  Owner:  nobody
   Type:  Bug| Status:  new
  Component:  Testing framework  |Version:  1.11
   Severity:  Normal |   Keywords:
   Triage Stage:  Unreviewed |  Has patch:  1
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+
 I'm not sure why urllib.parse.urlparse is returning a Bytes result in this
 case, but the result is the following error:

 {{{
 Traceback (most recent call last):
   File "/opt/python/3.3.5/lib/python3.3/wsgiref/handlers.py", line 137, in
 run
 self.result = application(self.environ, self.start_response)
   File "/home/travis/virtualenv/python3.3.5/lib/python3.3/site-
 packages/django/test/testcases.py", line 1106, in __call__
 if not self._should_handle(get_path_info(environ)):
   File "/home/travis/virtualenv/python3.3.5/lib/python3.3/site-
 packages/django/test/testcases.py", line 1077, in _should_handle
 return path.startswith(self.base_url[2]) and not self.base_url[1]
 TypeError: startswith first arg must be str or a tuple of str, not bytes
 }}}

 It's caused by a simple test case:

 {{{
 class RPCClientTest(LiveServerTestCase):

 def setUp(self):
 self.rpc = client.RPCClient(self.live_server_url + '/rpc/')

 def test_echo(self):
 resp = self.rpc.echo(foo='bar')
 self.assertEqual(resp, {'foo': 'bar'})
 }}}

 Where RPCClient uses a requests Session to post to the url.

 I've kludged the following patch to make it work:

 {{{
 diff -urw django/test/testcases.py /home/curtis/src/git/django-
 nap/venv/lib/python3.5/site-packages/django/test/testcases.py
 --- django/test/testcases.py2017-05-24 12:08:14.870948448 +1000
 +++ /home/curtis/src/git/django-nap/venv/lib/python3.5/site-
 packages/django/test/testcases.py   2017-05-24 11:07:53.967738745 +1000
 @@ -41,6 +41,11 @@
  from django.utils.six.moves.urllib.parse import (
  unquote, urljoin, urlparse, urlsplit, urlunsplit,
  )
 +try:
 +from urllib.parse import ParseResultBytes
 +except ImportError:
 +class ParseResultBytes:
 +pass
  from django.utils.six.moves.urllib.request import url2pathname
  from django.views.static import serve

 @@ -1183,6 +1188,8 @@
  def __init__(self, application):
  self.application = application
  self.base_url = urlparse(self.get_base_url())
 +if isinstance(self.base_url, ParseResultBytes):
 +self.base_url = self.base_url.decode('utf-8')
  super(FSFilesHandler, self).__init__()

  def _should_handle(self, 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 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/051.d194c422798235b99ad4f8f37fb5629d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.