Skip to content

bpo-32659: Solaris "stat" should support "st_fstype"#5307

Merged
jcea merged 2 commits into
python:masterfrom
jcea:bpo-32659
Jan 28, 2018
Merged

bpo-32659: Solaris "stat" should support "st_fstype"#5307
jcea merged 2 commits into
python:masterfrom
jcea:bpo-32659

Conversation

@jcea

@jcea jcea commented Jan 25, 2018

Copy link
Copy Markdown
Member

Trivial patch. The only questionable thing is the __sun define use. This is needed because autoconf doesn't test st_fstype. This would be something to patch in autoconf.

Example:

$ LD_LIBRARY_PATH=/home/cpython/cpython-bpo-32659 ./python
Python 3.7.0a4+ (default, Jan 25 2018, 03:34:04) 
[GCC 4.9.4] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> os.stat('/etc/passwd').st_fstype
'zfs'

https://bugs.python.org/issue32659

@jcea

jcea commented Jan 25, 2018

Copy link
Copy Markdown
Member Author

For reference, I checked Solaris 10, released in 2005, and this field is already present there:

NAME
     stat, lstat, fstat, fstatat - get file status
[...]
char     st_fstype[_ST_FSTYPSZ];
                                 /* Null-terminated type of filesystem */
[...]
SunOS 5.10          Last change: 13 Feb 2007                    1

Comment thread Doc/library/os.rst

String that uniquely identifies the type of the filesystem that
contains the file.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should there be a versionadded?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, @csabella . PR updated.

Thanks.

@jcea jcea merged commit 6c51d51 into python:master Jan 28, 2018
@bedevere-bot

Copy link
Copy Markdown

@jcea: Please replace # with GH- in the commit message next time. Thanks!

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.

4 participants