aiohttp icon indicating copy to clipboard operation
aiohttp copied to clipboard

Fix a bug in creating proxy connection of TCPConnector.

Open jamwonro opened this issue 3 years ago • 5 comments

This fix addresses the issue where an AttributeError is raised when a proxy response is closed due to EOF.

What do these changes do?

Fix the issue #6239.

Are there changes in behavior for the user?

Add ClientProxyClosedError handler.

Related issue number

#6239

Checklist

  • [x] I think the code is well written
  • [x] Unit tests for the changes exist
  • [ ] Documentation reflects the changes
  • [ ] If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • [x] Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

jamwonro avatar Apr 14 '22 18:04 jamwonro

I believe this resolves my issue. Going to try updating my application to use this patch.

john-parton avatar Apr 20 '22 13:04 john-parton

Is there something specific I can do to help? I have a bunch of test cases, but I'm not sure the best way to add them to this patch.

john-parton avatar Jun 13 '22 22:06 john-parton

Is there something specific I can do to help? I have a bunch of test cases, but I'm not sure the best way to add them to this patch.

Test cases would be great. I guess just create a PR to this branch, or a separate PR to aiohttp that includes the commits on this branch.

Dreamsorcerer avatar Jun 14 '22 18:06 Dreamsorcerer

I'm not sure how to write a test case that doesn't just exercise the entire request/response cycle with an actual endpoint.

I have a "test" here, but it relies on a 3rd party proxy server being up and having that specific configuration: https://github.com/aio-libs/aiohttp/issues/6239#issue-1044366531

Not sure how to extract out the relevant bits and make it a simple unit test.

john-parton avatar Jun 28 '22 14:06 john-parton

I have some additional information here: https://github.com/aio-libs/aiohttp/issues/6239#issuecomment-1320518665

@asvetlov Would it be possible to review this?

john-parton avatar Nov 18 '22 21:11 john-parton