Skip to content

Conversation

MartinNowak
Copy link

@MartinNowak MartinNowak commented Aug 28, 2025

@MartinNowak MartinNowak requested a review from pkittenis as a code owner August 28, 2025 14:22
@pkittenis
Copy link
Member

Hello,

Thanks for the interest.

What is this PR for? SFTPHandle.closed is already a public attribute.

@MartinNowak
Copy link
Author

MartinNowak commented Sep 3, 2025

What is this PR for? SFTPHandle.closed is already a public attribute.

The cdef bint closed attribute does not seem to be visible on the Python side, preventing certain usages of an SFTPHandle as file. Also apparently cpdef does not support bint attribute.

import ssh2.sftp_handle
ssh2.sftp_handle.SFTPHandle(None).closed

@MartinNowak
Copy link
Author

MartinNowak commented Sep 17, 2025

What is this PR for? SFTPHandle.closed is already a public attribute.

The cdef bint closed attribute does not seem to be visible on the Python side, preventing certain usages of an SFTPHandle as file. Also apparently cpdef does not support bint attribute, hence the need for property wrappers. Am I overlooking something?

import ssh2.sftp_handle
ssh2.sftp_handle.SFTPHandle(None).closed

@pkittenis

@pkittenis
Copy link
Member

pkittenis commented Sep 22, 2025

The cdef bint closed attribute does not seem to be visible on the Python side, preventing certain usages of an SFTPHandle as file.

Is there some example code that is not working or causing errors I can look at?

Edit - here:

from ssh2.sftp_handle import SFTPHandle
hh = SFTPHandle(None)
hh.closed

Traceback (most recent call last):
  File "<python-input-6>", line 1, in <module>
    hh.closed
AttributeError: 'ssh2.sftp_handle.SFTPHandle' object has no attribute 'closed'. Did you mean: 'close'?

This needs added as a test to check the changes work. Changes look good otherwise.

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