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

Python 3.9 + Windows: Does not handle long paths like other versions #267

Closed
2 of 5 tasks
pradyunsg opened this issue Nov 12, 2021 · 11 comments
Closed
2 of 5 tasks
Assignees
Labels
external Unexpected behavior was caused by external problems

Comments

@pradyunsg
Copy link

pradyunsg commented Nov 12, 2021

Description:
Python 3.9 seems to behave differently from other Python versions, when handling long paths on Windows. This looks suspiciously like non-LongPathAware behaviour.

Action version:
Specify the action version: v2?

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

3.9

Repro steps:
A description with steps to reproduce the issue. If your have a public example or repo to share, please provide the link.

name: Release
on:
  push:

jobs:
  windows:
    name: ${{ matrix.python }} / ${{ matrix.os }}
    strategy:
      matrix:
        os: [Windows]
        python:
          - 3.7
          - 3.8
          - 3.9
          - "3.10"

    runs-on: ${{ matrix.os }}-latest
    steps:
      - uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python }}

      - run: python -c "from pathlib import Path; (Path.cwd() / ('a'*131) / ('a'*131)).mkdir(parents=True)"

Noticed since this was causing errors in pip's test suite: https://github.com/pypa/pip/runs/4187290412?check_suite_focus=true

Expected behavior:
Python 3.9 behaves like other Python versions, and handles long paths on Windows.

Actual behavior:
Python 3.9 fails when handling long paths on Windows.

@pradyunsg pradyunsg added bug Something isn't working needs triage labels Nov 12, 2021
@pradyunsg
Copy link
Author

Oh, and this seems to be a somewhat-recent change, since pip had the same-ish setup working 5 days ago: https://github.com/pypa/pip/runs/4130255296?check_suite_focus=true

@layday
Copy link

layday commented Nov 12, 2021

This is related to the upgrade to 3.9.8 which is the first Python version to have been released with python/cpython@06935bd. The same warning/failure will appear in Python 3.10 next month.

Also experiencing this at pypa/build.

@layday
Copy link

layday commented Nov 12, 2021

Okay, that actually appears to be a manifestation of the issue with paths - I didn't look close enough, sorry.

@uranusjr
Copy link

Make pipx the third PyPA project being affected 🙂

@nikita-bykov
Copy link
Contributor

Hello @pradyunsg! We were be able to reproduce this issue on windows-latest hosted image, but it also reproduces on the local Windows machine. It looks like the issue is not related to setup-python action, but to Python 3.9.8.
As a workaround, you can install Python 3.9.9 using setup-python action. Also next week this Python version will be available in GitHub hosted images and version 3.9 will point to 3.9.9.

@uranusjr
Copy link

What steps are needed to reproduce this locally? I don’t recall 3.9.9 containing a fix for this, so we may want to report this to upstream CPython so they can investigate properly. Even if the bug is fixed in 3.9.9, the fact that it manifests but disappears on its own is enough reason for it to be more thoroughly investigated.

@nikita-bykov
Copy link
Contributor

Hello @uranusjr, I installed Python 3.9.8 on my Windows machine using choco and executed the following command from repro steps:

python -c "from pathlib import Path; (Path.cwd() / ('a'*131) / ('a'*131)).mkdir(parents=True)"

I got the same error as in https://github.com/pradyunsg/testing-grounds/runs/4187901999?check_suite_focus=true

@uranusjr
Copy link

I tracked this down: https://bugs.python.org/issue45777

So yes, 3.9.8 is the only broken release, it’s built with faulty configuration. The solution is to use 3.9.9 (or anything but 3.9.8).

@layday
Copy link

layday commented Dec 10, 2021

So this is supposed to be fixed in 3.9.9? Because 3.9.9 is failing for pypa/build on Windows.

@uranusjr
Copy link

Yes, the 3.9.9 build of CPython is supposed to work (if you have LongPathsEnabled set correctly system-wide, of course; that is always a prerequisite).

@nikita-bykov
Copy link
Contributor

@layday I'm going to close the issue because it related to Python 3.9.8 and not to setup-python.
If you have any questions feel free to contact us.

@nikita-bykov nikita-bykov added external Unexpected behavior was caused by external problems and removed bug Something isn't working labels Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external Unexpected behavior was caused by external problems
Projects
None yet
Development

No branches or pull requests

4 participants