Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symlink to directory on Windows 8 #67996

Open
serhiy-storchaka opened this issue Mar 29, 2015 · 5 comments
Open

Symlink to directory on Windows 8 #67996

serhiy-storchaka opened this issue Mar 29, 2015 · 5 comments
Labels
OS-windows tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@serhiy-storchaka
Copy link
Member

BPO 23808
Nosy @pfmoore, @tjguk, @zware, @serhiy-storchaka, @zooba, @izbyshev
PRs
  • [3.4] Backport CI config from master #2475
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2015-03-29.18:45:10.431>
    labels = ['type-bug', 'tests', 'OS-windows']
    title = 'Symlink to directory on Windows 8'
    updated_at = <Date 2018-02-26.20:20:15.918>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2018-02-26.20:20:15.918>
    actor = 'izbyshev'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Tests', 'Windows']
    creation = <Date 2015-03-29.18:45:10.431>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 23808
    keywords = []
    message_count = 5.0
    messages = ['239506', '239510', '239514', '261361', '312948']
    nosy_count = 7.0
    nosy_names = ['paul.moore', 'tim.golden', 'python-dev', 'zach.ware', 'serhiy.storchaka', 'steve.dower', 'izbyshev']
    pr_nums = ['2475']
    priority = 'normal'
    resolution = None
    stage = 'needs patch'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue23808'
    versions = ['Python 3.4', 'Python 3.5', 'Python 3.6']

    @serhiy-storchaka
    Copy link
    Member Author

    Looks as a symlink on Windows 8 can has the FILE_ATTRIBUTE_DIRECTORY flag.

    http://buildbot.python.org/all/builders/AMD64%20Windows8%203.4/builds/348/steps/test/logs/stdio
    ======================================================================
    FAIL: test_walk_bottom_up (test.test_os.WalkTests)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File &#34;D:\buildarea\3.4.bolen-windows8\build\lib\test\test_os.py&#34;, line 802, in test_walk_bottom_up
        self.sub2_tree)
    AssertionError: Tuples differ: (&#39;@test_3872_tmp\\TEST1\\SUB2&#39;, [&#39;broken_link&#39;, &#39;link&#39;], [&#39;tmp3&#39;]) != (&#39;@test_3872_tmp\\TEST1\\SUB2&#39;, [&#39;link&#39;], [&#39;broken_link&#39;, &#39;tmp3&#39;])

    First differing element 1:
    ['broken_link', 'link']
    ['link']

    • ('@test_3872_tmp\\TEST1\\SUB2', ['broken_link', 'link'], ['tmp3'])
      ? ----------

    + ('@test_3872_tmp\\TEST1\\SUB2', ['link'], ['broken_link', 'tmp3'])
    ? ++++++++++

    ======================================================================
    FAIL: test_walk_prune (test.test_os.WalkTests)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File &#34;D:\buildarea\3.4.bolen-windows8\build\lib\test\test_os.py&#34;, line 782, in test_walk_prune
        self.assertEqual(all[1], self.sub2_tree)
    AssertionError: Tuples differ: (&#39;@test_3872_tmp\\TEST1\\SUB2&#39;, [&#39;broken_link&#39;, &#39;link&#39;], [&#39;tmp3&#39;]) != (&#39;@test_3872_tmp\\TEST1\\SUB2&#39;, [&#39;link&#39;], [&#39;broken_link&#39;, &#39;tmp3&#39;])

    First differing element 1:
    ['broken_link', 'link']
    ['link']

    • ('@test_3872_tmp\\TEST1\\SUB2', ['broken_link', 'link'], ['tmp3'])
      ? ----------

    + ('@test_3872_tmp\\TEST1\\SUB2', ['link'], ['broken_link', 'tmp3'])
    ? ++++++++++

    ======================================================================
    FAIL: test_walk_topdown (test.test_os.WalkTests)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File &#34;D:\buildarea\3.4.bolen-windows8\build\lib\test\test_os.py&#34;, line 765, in test_walk_topdown
        self.assertEqual(all[3 - 2 * flipped], self.sub2_tree)
    AssertionError: Tuples differ: (&#39;@test_3872_tmp\\TEST1\\SUB2&#39;, [&#39;broken_link&#39;, &#39;link&#39;], [&#39;tmp3&#39;]) != (&#39;@test_3872_tmp\\TEST1\\SUB2&#39;, [&#39;link&#39;], [&#39;broken_link&#39;, &#39;tmp3&#39;])

    First differing element 1:
    ['broken_link', 'link']
    ['link']

    • ('@test_3872_tmp\\TEST1\\SUB2', ['broken_link', 'link'], ['tmp3'])
      ? ----------

    + ('@test_3872_tmp\\TEST1\\SUB2', ['link'], ['broken_link', 'tmp3'])
    ? ++++++++++

    ----------------------------------------------------------------------

    Create broken link:

        os.symlink('non_existing_patch', 'broken_link', target_is_directory=True)

    What return os.path.isdir('broken_link')?

    @serhiy-storchaka serhiy-storchaka added tests Tests in the Lib/test dir OS-windows labels Mar 29, 2015
    @pfmoore
    Copy link
    Member

    pfmoore commented Mar 29, 2015

    It returns True.

    @serhiy-storchaka
    Copy link
    Member Author

    Then tests should be adapted for Windows 8.

    @serhiy-storchaka serhiy-storchaka added the type-bug An unexpected behavior, bug, or error label Dec 20, 2015
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Mar 8, 2016

    New changeset 19a3e0e664af by Serhiy Storchaka in branch '3.4':
    Issues bpo-23808, bpo-25911: Trying to fix walk tests on Windows.
    https://hg.python.org/cpython/rev/19a3e0e664af

    New changeset f9e22717722d by Serhiy Storchaka in branch '3.5':
    Issues bpo-23808, bpo-25911: Trying to fix walk tests on Windows.
    https://hg.python.org/cpython/rev/f9e22717722d

    New changeset da020e408c7f by Serhiy Storchaka in branch 'default':
    Issues bpo-23808, bpo-25911: Trying to fix walk tests on Windows.
    https://hg.python.org/cpython/rev/da020e408c7f

    @izbyshev
    Copy link
    Mannequin

    izbyshev mannequin commented Feb 26, 2018

    This behavior is not specific to just Windows 8. Symlinks to directories are treated as directories on Windows, in particular, they should be removed with RemoveDirectory, not DeleteFile.

    Is there any reason this issue is still open?

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    OS-windows tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants