The official site for Ladon is now: https://bitbucket.org/jakobsg/ladon
Please make a branch and a pull request, then I can review your change and
merge it to master.
Br Jakob
On Wed, Aug 23, 2017 at 10:27 PM, Андрей Асеев <email address hidden> wrote:
> never late to fix some good oldies
> just reorder end lines and move python version checker before response
> headers
>
> if sys.version_info[0]>=3:
> # Python 3 support
> if type(output)==str:
> output = bytes(output,charset)
> content_length = str(len(output))
>
> response_headers += [
> ('Content-Type', "%s; charset=%s" %
> (content_type,charset)),
> ('Content-Length', content_length)
> ]
> start_response(status, response_headers)
>
> if hasattr(output,'read'):
> # File-like object
> block_size = 4096
> if 'wsgi.file_wrapper' in environ:
> return environ['wsgi.file_wrapper'](output,
> block_size)
> else:
> return iter(lambda:
> output.read(block_size), '')
>
> return [output]
>
> --
> You received this bug notification because you are subscribed to ladon.
> https://bugs.launchpad.net/bugs/1050638
>
> Title:
> Wrong content-length in wsgi_application on Python 3
>
> Status in ladon:
> New
>
> Bug description:
> At the end of wsgi_application.py
>
> content_length = str(len(output))
>
> is performed before encoding
>
> if sys.version_info[0]>=3:
> # Python 3 support
> if type(output)==str:
> output = bytes(output,charset)
>
> When output contains non-ascii characters 'Content-Length' is wrong.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ladon/+bug/1050638/+subscriptions
>
--
Med venlig hilsen / Best regards
Jakob Simon-Gaarde
Hi.
The official site for Ladon is now: https:/ /bitbucket. org/jakobsg/ ladon
Please make a branch and a pull request, then I can review your change and
merge it to master.
Br Jakob
On Wed, Aug 23, 2017 at 10:27 PM, Андрей Асеев <email address hidden> wrote:
> never late to fix some good oldies info[0] >=3: charset) type,charset) ), status, response_headers) output, 'read') : 'wsgi.file_ wrapper' ](output, read(block_ size), '') /bugs.launchpad .net/bugs/ 1050638 info[0] >=3: charset) /bugs.launchpad .net/ladon/ +bug/1050638/ +subscriptions
> just reorder end lines and move python version checker before response
> headers
>
> if sys.version_
> # Python 3 support
> if type(output)==str:
> output = bytes(output,
> content_length = str(len(output))
>
> response_headers += [
> ('Content-Type', "%s; charset=%s" %
> (content_
> ('Content-Length', content_length)
> ]
> start_response(
>
> if hasattr(
> # File-like object
> block_size = 4096
> if 'wsgi.file_wrapper' in environ:
> return environ[
> block_size)
> else:
> return iter(lambda:
> output.
>
> return [output]
>
> --
> You received this bug notification because you are subscribed to ladon.
> https:/
>
> Title:
> Wrong content-length in wsgi_application on Python 3
>
> Status in ladon:
> New
>
> Bug description:
> At the end of wsgi_application.py
>
> content_length = str(len(output))
>
> is performed before encoding
>
> if sys.version_
> # Python 3 support
> if type(output)==str:
> output = bytes(output,
>
> When output contains non-ascii characters 'Content-Length' is wrong.
>
> To manage notifications about this bug go to:
> https:/
>
--
Med venlig hilsen / Best regards
Jakob Simon-Gaarde