André Caron

Results 37 comments of André Caron

I'll go out on a limb here, but it seems to me that we're approaching the problem from the wrong angle. Rather than trying to fix the thorny issue of...

> > If not, I think the easiest 'fix' would be to implement pause as "don't consume any more bytes (but call whatever callbacks are necessary)" instead of "stop doing...

> I think the easiest 'fix' would be to implement pause as "don't consume any more bytes (but call whatever callbacks are necessary)" instead of "stop doing anything". I've worked...

I looked at [bnoordhuis's new test case](https://github.com/joyent/http-parser/issues/97#issuecomment-4193300) and it prevents pausing in `on_headers_complete` from invoking `on_message_complete`. I don' t think this can ever be satisfied if we fix this issue...

After further reading of the code, it seems to me that the only risky bits are parser states that use `goto reexecute_byte;` _and execute callbacks_. I only found only two...

> Couldn't they consume the last byte, but leave the parser in a state of s_paused_before_message_complete, and have that state just call the callback and then do "goto reexecute_byte;"? Hadn't...

@rooterkyberian Thanks for the feedback! > isn't this inherently broken? special characters needed encoding are : / ? # [ ] @ so how urllib was supposed to parse such...

@pawel-slowik Thanks for the feedback! > `pymongo-migrate` cannot do this automatically because it would double encode credentials that are already encoded, thus invalidating them Indeed, `urllib.parse.quote_plus()` is not idempotent and...

OK, I'll try to whip up another implementation based on what you proposed. FWIW, I'm running `pymongo-migrate` in a Kubernetes job to which all secrets are passed as environment variables....

Yeah, I get that. However, I prefer explicitly tying my code to gevent to monkey-patching (for new code, at least). In those programs, it feels really strange to import `threading.Condition`...