This looks correct. Can you please submit a PR?
On Friday, 7 December 2018 07:47:00 UTC-8, Carl Petersen wrote:
>
> I was able to get web2py up and running by changing the following line
> (131) in http.py I don't expect that this was the proper way to do it
> (especially considering backward compatibility), but at lease it might
> point out where the issue is:
>
> elif isinstance(body, (str, bytes, bytearray)):
> if isinstance(body, unicodeT):
> body = to_bytes(body)
> return [body]
> elif hasattr(body, '__iter__'):
> return [x.encode('utf-8') for x in body] ----- Changed from
> "return body"
> else:
> body = str(body)
> if isinstance(body, unicodeT):
> body = to_bytes(body)
> return [body]
>
> I didn't know whether I should just apply to_bytes(body) like the other
> returns because the other returns were coded "return [body]" instead of
> "return body".
>
> Thanks
>
> On Friday, December 7, 2018 at 7:50:16 AM UTC-6, Carl Petersen wrote:
>>
>> Hello,
>>
>> I'm having a similar issue. I'm using Python 3.6.6, mod_wsgi 4.6.5,
>> Apache 2.4.6 with web2py 2.17.2.
>>
>> I can get to the welcome screen, but as soon as I try to access the admin
>> application I get the following on my screen:
>>
>> Internal Server Error
>>
>> The server encountered an internal error or misconfiguration and was
>> unable to complete your request.
>>
>> Please contact the server administrator at root@localhost to inform them
>> of the time this error occurred, and the actions you performed just before
>> this error.
>>
>> More information about this error may be available in the server error
>> log.
>>
>>
>> And this in my apache error_log:
>>
>> [Fri Dec 07 08:32:14.626246 2018] [mpm_prefork:notice] [pid 30005]
>> AH00163: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.2k-fips
>> mod_wsgi/4.6.5 Python/3.6 configured -- resuming normal operations
>>
>> [Fri Dec 07 08:32:33.572686 2018] [wsgi:error] [pid 30007] [remote
>> 10.20.100.133:56416] mod_wsgi (pid=30007): Exception occurred processing
>> WSGI script '/opt/web-apps/web2py/wsgihandler.py'.
>>
>> [Fri Dec 07 08:32:33.572836 2018] [wsgi:error] [pid 30007] [remote
>> 10.20.100.133:56416] TypeError: sequence of byte string values expected,
>> value of type str found
>>
>> Any assistance would be greatly appreciated.
>>
>>
>>
>> On Sunday, September 2, 2018 at 1:03:30 PM UTC-5, motionbutterfly wrote:
>>>
>>> Hello, I was wondering if anyone here could help me. I've been migrating
>>> a web2py application from Python2.7 to Python3.4, this application was
>>> already being hosted in a webserver with Apache2.4 following the steps in
>>> the Deployment Recipes chapter of the web2py book. I reconfigured apache to
>>> run with python 3, and reinstalled mod_wsgi using pip. My problem is that
>>> as soon as I load my application I get an internal error, and when I click
>>> on the ticket it shows me "500 Internal Server Error", and when I look up
>>> the error log for apache this is what comes up:
>>>
>>> [Thu Aug 23 22:42:17.748139 2018] [wsgi:warn] [pid 2268:tid
>>> 139927378876288] mod_wsgi: Compiled for Python/3.4.2rc1+.
>>> [Thu Aug 23 22:42:17.748154 2018] [wsgi:warn] [pid 2268:tid
>>> 139927378876288] mod_wsgi: Runtime using Python/3.4.2.
>>> [Thu Aug 23 22:42:17.896498 2018] [mpm_event:notice] [pid 2268:tid
>>> 139927378876288] AH00489: Apache/2.4.10 (Debian) OpenSSL/1.0.1t
>>> mod_wsgi/4.3.0 Python/3.4.2 mod_perl/2.0.9dev Perl/v5.20.2 configured --
>>> resuming normal operations
>>> [Thu Aug 23 22:42:17.896584 2018] [core:notice] [pid 2268:tid
>>> 139927378876288] AH00094: Command line: '/usr/sbin/apache2'
>>> [Thu Aug 23 22:45:29.528373 2018] [wsgi:error] [pid 2272:tid
>>> 139927187830528] <class 'int'>
>>> [Thu Aug 23 22:45:29.528468 2018] [wsgi:error] [pid 2272:tid
>>> 139927187830528] 10
>>> [Thu Aug 23 22:45:29.968522 2018] [wsgi:error] [pid 2272:tid
>>> 139927213033216] Loads pas\xc3\xb3
>>> [Thu Aug 23 22:45:35.289112 2018] [wsgi:error] [pid 2272:tid
>>> 139927179421440] [remote 186.89.23.145:25178] mod_wsgi (pid=2272):
>>> Exception occurred processing WSGI script
>>> '/home/www-data/web2py/wsgihandler.py'.
>>> [Thu Aug 23 22:45:35.289293 2018] [wsgi:error] [pid 2272:tid
>>> 139927179421440] [remote 186.89.23.145:25178] TypeError: sequence of
>>> byte string values expected, value of type str found
>>>
>>> Which seems to suggest that the problem is inside the wsgihandler.py
>>> script, but doesn't point out where. Has this happened to anyone else
>>> before?
>>>
>>> Thanks in advance for any help.
>>>
>>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.