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

Fix for CPython "Adress already in use" error #79

Merged
merged 3 commits into from
Feb 5, 2024

Conversation

michalpokusa
Copy link
Contributor

@michalpokusa michalpokusa commented Feb 1, 2024

Continuation of #78

🪛Fixes:

  • Server.start() now marks socket for reuse when the lib is used with CPython

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

I tested the cpython example successfully multiple times on the same port and it's now able to re-launch over and over successfully without errors.

Thank you @michalpokusa!

@FoamyGuy FoamyGuy merged commit 4f31799 into adafruit:main Feb 5, 2024
1 check passed
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Feb 6, 2024
Updating https://github.com/adafruit/Adafruit_CircuitPython_DS18X20 to 1.4.0 from 1.3.19:
  > Merge pull request adafruit/Adafruit_CircuitPython_DS18X20#29 from ilikecake/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_FocalTouch to 1.5.2 from 1.5.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_FocalTouch#32 from ilikecake/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_Seesaw to 1.16.2 from 1.16.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_seesaw#129 from scirelli/issue_128

Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Button to 1.9.1 from 1.9.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Button#44 from DJDevon3/DJDevon3_Working_Branch

Updating https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_Layout to 2.1.0 from 2.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_Layout#92 from FoamyGuy/gridlayout_cell_contains

Updating https://github.com/adafruit/Adafruit_CircuitPython_HTTPServer to 4.5.3 from 4.5.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_HTTPServer#79 from michalpokusa/cpython-fix
  > Merge pull request adafruit/Adafruit_CircuitPython_HTTPServer#78 from tedder/ted/cpython_port5k

Updating https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation to 2.9.0 from 2.8.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_LED_Animation#116 from tylerwinfield/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_PyCamera to 0.0.9 from 0.0.8:
  > Merge pull request adafruit/Adafruit_CircuitPython_PyCamera#23 from adafruit/blendmode
  > Merge pull request adafruit/Adafruit_CircuitPython_PyCamera#22 from adafruit/timelapse
  > Merge pull request adafruit/Adafruit_CircuitPython_PyCamera#21 from adafruit/fix_rl

Updating https://github.com/adafruit/Adafruit_CircuitPython_Requests to 2.0.5 from 2.0.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_Requests#152 from justmobilize/fix-null-headers

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Updated download stats for the libraries
@MZachmann
Copy link

MZachmann commented Feb 7, 2024

Unless I'm missing something, when not in CPython this is throwing an exception. I just added an except: pass to deal with it but at least for me in CircuitPython (9.2 for esp32) it's failing.

@michalpokusa michalpokusa deleted the cpython-fix branch February 7, 2024 06:54
@michalpokusa
Copy link
Contributor Author

Unless I'm missing something, when not in CPython this is throwing an exception. I just added an except: pass to deal with it but at least for me in CircuitPython (9.2 for esp32) it's failing.

You are right, I don't kinow how I managed to miss that, probably removed the except just before commiting. Already working on the PR with fix.

Thank for pointing that out!

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

Successfully merging this pull request may close these issues.

3 participants