Comments (6)
Interestingly, if you pass
instead of raise
, it works fine.
I wonder what's going on. The code paths seem to be the same since neither __aexit__
is actually interested in the exception.
from aioftp.
@heftig, probably something differs at flushing quit
, so on raise there is no real data transfer.
add the
write_eof
toDataConnectionThrottleStreamIO.__aexit__
This definitely should be there, thanks! 👍
from aioftp.
The code paths seem to be the same since neither aexit is actually interested in the exception.
Strike that; DataConnectionThrottleStreamIO.__aexit__
doesn't call finish
if there's an exception. As a result, close
doesn't get called either, and the connection stays open.
So write_eof
was a red herring, and it was really the missing close
.
I guess since every write
on the stream does a drain
, write_eof
isn't needed?
from aioftp.
AFAIK normally to close a connection you write_eof
, then await drain
and then close
, to ensure all bytes have been sent.
from aioftp.
It looks like writer.close()
is enough here. Since write_eof
closing only writing, but you can still read (as documentation said). Also, not all transports support write_eof
.
Is it enough?
async def __aexit__(self, exc_type, exc, tb):
if exc is None:
await self.finish()
else:
self.close()
from aioftp.
Yes, that works too, thanks.
from aioftp.
Related Issues (20)
- advanced-download-and-upload-abort-restart Question HOT 8
- test_pasv_connection_pasv_forced_response_address fails on FreeBSD HOT 5
- Please tag release revisions in git HOT 6
- Asynchronous permission check HOT 2
- pytest-asyncio mode strict lets tests fail
- Client.download tries to parse my file's contents HOT 7
- Multiplex download HOT 4
- Im not sure but downloads are bugging HOT 2
- Pytest Asyncio 0.17.2: Deprecation Warning HOT 2
- aioftp.errors.PathIsNotAbsolute: E:\PythonPrj\6xx\serverFile\recvFiles\客户端30 HOT 2
- get_passive_connection aborts immediately if epsv server response is 550 Permission denied HOT 2
- Deadlock upon calling `await client.abort()` HOT 5
- Add type hints to aioftp HOT 29
- time format err HOT 1
- cannot download file from filezilla server HOT 3
- [0.21.4] client.list returns Value Error because date format does not match on Windows HOT 1
- Let's put `aioftp` under the `aio-libs` org on PyPI HOT 6
- Support python version older than 3.11 HOT 1
- `[Errno 111] Connect call failed` with simple stat code HOT 2
- [feature-request] Client HTTP(S) proxy support (CONNECT)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aioftp.