Skip to content

Fix pyproject.toml and improve Modbus TCP proxy example - #105

Merged
jmccrohan merged 3 commits into
jmccrohan:mainfrom
gratux:main
Mar 8, 2026
Merged

jmccrohan merged 3 commits into
jmccrohan:mainfrom
gratux:main

Conversation

@gratux

@gratux gratux commented Mar 8, 2026

Copy link
Copy Markdown
Contributor

While testing the Modbus TCP proxy utility, I noticed the usage of asyncio.StreamReader.readexactly is not quite correct: the documentation states an exception is raised in case not enough data can be read.
With the old behavior, closing the TCP connection would not properly disconnect the Solarman session.

This PR changes the incorrect error handling to catch the exception and disconnect the session.
Also, the utility now uses a proper logger instead of raw print statements.

Additional fixes:

  • pyproject.toml (contained duplicate keys)
  • black formatter

gratux added 3 commits March 8, 2026 19:12
the duplicate script name caused `pip install .` to fail
- `asyncio.StreamReader.readexactly` throws when not enough data can be read.
- use proper logging.
@gratux gratux changed the title Fix pyproject.toml and improve TCP proxy example Fix pyproject.toml and improve Modbus TCP proxy example Mar 8, 2026
@jmccrohan
jmccrohan merged commit 8cfe846 into jmccrohan:main Mar 8, 2026
2 checks passed
@jmccrohan

Copy link
Copy Markdown
Owner

Merged. Thanks for your contribution @gratux!

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.

2 participants