Hi PyPy devs,

In one of my projects I noticed tests involving symlinked directories on 
Windows failing on PyPy 3.9/10 (v7.3.12), but succeeding on CPython 3.9/10. 
After digging into `pypy/module/posix/interp_scandir.py`, it looks like 
`W_DirEntry` has an incomplete implementation for Windows. The 
`W_DirEntry.is_*()` methods only return results for the symlink (the 
*follow_symlinks* argument is ignored via `.check_mode()`). The 
`W_DirEntry.stat()` method only returns the `stat_result` for the target file 
(ignoring the *follow_symlinks* via `.get_stat_or_lstat()`).

I have a proof of concept fixing the Windows implementation based upon the 
adjacent POSIX code. It passes the previously skipped tests `test_stat4`, and 
`test_dir3-6` in `pypy/module/posix/test/test_scandir.py`. My modification to 
`test_scandir.py` is kind of janky to support Python 2.7 on Windows because it 
doesn't natively support `os.symlink()`. The test uses 
`pypy.module.posix.interp_posix.symlink` when `os.symlink` is unavailable.

I'm not sure how to run `test_scandir.py` after compiling/translationing, and 
what other tests I should be running. I can successfully compile these 
modifications on the py3.10 branch on Windows 10 and Linux (Manjaro, an Arch 
Linux derivative).

The Contributing Guidelines recommends that I start with the mailing list 
before making a random merge request. What's the next step in possibly getting 
this fix reviewed?

Regards,
Caleb Burns
_______________________________________________
pypy-dev mailing list -- pypy-dev@python.org
To unsubscribe send an email to pypy-dev-le...@python.org
https://mail.python.org/mailman3/lists/pypy-dev.python.org/
Member address: arch...@mail-archive.com

Reply via email to