FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

expose SFTPHandle.closed for IOBase API by MartinNowak · Pull Request #223 · ParallelSSH/ssh2-python · GitHub

expose SFTPHandle.closed for IOBase API - #223

Closed
MartinNowak wants to merge 1 commit into
ParallelSSH:masterfrom
MartinNowak:expose_sftp_closed
Closed

expose SFTPHandle.closed for IOBase API#223
MartinNowak wants to merge 1 commit into
ParallelSSH:masterfrom
MartinNowak:expose_sftp_closed

Conversation

MartinNowak commented Aug 28, 2025
edited
Loading

Copy link
Copy Markdown

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

Copy link
Copy Markdown
Member

Hello,

Thanks for the interest.

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

MartinNowak commented Sep 3, 2025
edited
Loading

Copy link
Copy Markdown
Author

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 commented Sep 17, 2025
edited
Loading

Copy link
Copy Markdown
Author

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 commented Sep 22, 2025
edited
Loading

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member

Done in #226 .

Can see why tests are needed in that PR. Just changing the internal property to public is not enough.

pkittenis closed this Oct 4, 2025
ParallelSSH locked as resolved and limited conversation to collaborators Oct 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL