Skip to content

Investigate file-like objects in FTP transfers #71

Description

@nicolasCtd

The Vortex codebase contains several references to file-like objects. For example in src/vortex/tools/systems.py:

def is_iofile(self, iocandidate):
"""Check if actual **iocandidate** is a valid filename or io stream."""
return iocandidate is not None and (
(isinstance(iocandidate, str) and self.path.exists(iocandidate))
or isinstance(iocandidate, io.IOBase)
or isinstance(iocandidate, io.BytesIO)
or isinstance(iocandidate, io.StringIO)
)

and also in the tests:

ftpc = self.new_ftp_client()
with self.assertRaises(RuntimeError):
ftpc.pwd()
ftpc.fastlogin(self.user, self.password, delayed=False)
self.assertEqual(ftpc.logname, 'testlogin')
with ftpc:
self.assertEqual(ftpc.pwd(), '/')
testdata = io.BytesIO()

The goal of this ticket is to clarify the current status of this feature.

  • Is support for file-like objects fully implemented?
  • If so, what is the intended way to use it? Are there any examples or documentation?
  • Is this functionality actually used in operational, or is it only present for tests or legacy reasons?
  • If the implementation is incomplete, should it be completed or clean up the code by removing the feature?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions