Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

test_os: test_attributes failed on ReFS, Windows 11 Dev Drive #111293

Closed
Labels
type-bugAn unexpected behavior, bug, or error
@zcxsythenew

Description

@zcxsythenew

Bug report

Bug description:

PowerShell command:

PS D:\cpython> .\PCbuild\build.bat -t CleanAllPS D:\cpython> .\PCbuild\build.bat -e -dPS D:\cpython> .\python.bat -m test -j1

Test output:

0:26:00 load avg: 0.52 [285/469/2] test_os failed (1 failure)test test_os failed -- Traceback (most recent call last):  File "D:\cpython\Lib\test\test_os.py", line 4696, in test_attributes    self.check_entry(entry, 'dir', True, False, False)  File "D:\cpython\Lib\test\test_os.py", line 4645, in check_entry    self.assertEqual(entry.inode(),AssertionError: 0 != 887860239011714428829696

The output indicates thattest_attributes failed.

Given thatos.link andos.symlink can both success, Isummarized the test below (may be slightly different from the original), shown in Python code:

importosdefcreate_file(file_name,content=b'content'):withopen(file_name,'xb',0)asfp:fp.write(content)returnfile_nameif__name__=='__main__':dirname='D:\\test-py'os.mkdir(dirname)filename=create_file('D:\\file.txt')os.link(filename,'D:\\link_file.txt')os.symlink(dirname,'D:\\symlink_dir',True)os.symlink(filename,'D:\\symlink_file.txt')forentryinos.scandir('D:\\'):print(entry.name)print(entry.inode())print(os.stat(entry.path,follow_symlinks=False).st_ino)print('')

Output:

$RECYCLE.BIN0121914531583146426630144aspnetcore037170189308524746506240cpython0461777344397171205603328Euler0459231693714999287480320file.txt1828334198897217871282194gobook0458438483719829776760832gobook20458752078369082839138304gopl.io0455523898156183667605504leveldb0445249061707127447355392link_file.txt1828334198897217871282194oceanbase0413631342364789275885568source0121951425071293845733376symlink_dir01057588731233916013248512symlink_file.txt1928334198897217871282195System Volume Information00test-py01057570284489842303696896

The above output indicates that:

  • entry.inode() returns a small integer for a file,0 for a folder;
  • os.stat(entry.path, follow_symlinks=False).st_ino returns a large number, same asfsutil file queryFileID on Windows

Because they are different, the test fails.

Note: This issue will not appear on NTFS. This issue can only be reproduced on ReFS.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Windows

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp