| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Read the OK packet just after sending the EOF (enpty) packet.
Codecov Report❌ Patch coverage is 90.00000% with 2 lines in your changes missing coverage. Please review.
@@ Coverage Diff @@
## main #1264 +/- ##
==========================================
- Coverage 86.24% 84.51% -1.74%
==========================================
Files 17 17
Lines 2436 2460 +24
Branches 258 247 -11
==========================================
- Hits 2101 2079 -22
- Misses 249 304 +55
+ Partials 86 77 -9 ☔ View full report in Codecov by Harness.
|
Sorry, something went wrong.
There was a problem hiding this comment.
Refactors the client-side LOAD DATA LOCAL INFILE handling in pymysql/connections.py to align packet sequencing (send the empty/EOF packet, then immediately read the server’s response) and to simplify the local-file sending implementation.
Changes:
pymysql/connections.py:1446
def _send_local_file(filename: str, conn: Connection):
"""Send data packets from the local file to the server"""
packet_size = min(conn.max_allowed_packet, 16 * 1024)
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
| finally: | ||
| # send the empty packet to signify we are done sending data | ||
| conn.write_packet(b"") | ||
| ok_packet = conn._read_packet() | ||
| # If an error occurs while sending the file, exit here without handling | ||
| # the OK packet. | ||
|
|
||
| ok_packet = self.connection._read_packet() | ||
| if ( | ||
| not ok_packet.is_ok_packet() | ||
| ): # pragma: no cover - upstream induced protocol error | ||
| if not ok_packet.is_ok_packet(): |
| Back | FazBrowse Home | New Git URL |
Read the OK packet just after sending the EOF (enpty) packet.
There is no problem with bare except clauses, but many people keep sending PRs to remove them, so we rewrite them using finally.