Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError on Python3.6.x in FastAGI. #44

Open
vitimm144 opened this issue Jun 13, 2019 · 3 comments
Open

TypeError on Python3.6.x in FastAGI. #44

vitimm144 opened this issue Jun 13, 2019 · 3 comments

Comments

@vitimm144
Copy link

vitimm144 commented Jun 13, 2019

Hi,

When I have run the FastAGI script with python 3.6.8, I have gotten the following error:

image

I think, I found a solution to fix it. How can i contribute to fix the error?

@russellb
Copy link
Contributor

You may contribute a patch using github pull requests.

For more info, see: https://help.github.com/en/articles/about-pull-requests

@russellb
Copy link
Contributor

Looking at the error, a workaround may be to use Python 2.

@ldo
Copy link

ldo commented Nov 10, 2022

First of all, copying and pasting the actual text would be better than a screenshot.

Secondly, the error seems to be entirely within twisted modules, not starpy itself.

Thirdly, I don’t see how that error can occur with current twisted. A little above the source line where the error is reported:

lines = (self._buffer + data).split(self.delimiter)

I see that delimiter is initialized thus:

delimiter = b"\r\n"

Which looks fine (at least with twisted 22.4 on my Debian system). Unless some outside code is inappropriately changing this value via something like

LineOnlyReceiver.delimiter = "\r\n"

which could cause the error observed ...

... ah, I see, yes. In starpy/fastagi.py, for example, we have class FastAGIProtocol, which subclasses twisted’s LineOnlyReceiver, and overrides the above class variable definition with this line:

delimiter = '\n'

That would certainly cause trouble like that observed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants