setup-python icon indicating copy to clipboard operation
setup-python copied to clipboard

[v5.0.0] Error when using cache and there is a file with emoji in the file name on Windows

Open kzrnm opened this issue 2 years ago • 2 comments

Description:

An error occurs when the following conditions are met.

  • Windows runner
  • There is a file in the repository that contains emoji in the file name, such as 👍.txt.
  • cache is pip or poetry.

Action version: v5.0.0

Platform:

  • [ ] Ubuntu
  • [ ] macOS
  • [x] Windows

Runner type:

  • [x] Hosted
  • [ ] Self-hosted

Tools version:

Repro steps:

Run this workflow.

name: Python
on:
  workflow_dispatch:
jobs:
  download:
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
        python:
          - "3.9"
          - "3.12"
      fail-fast: false

    runs-on: ${{ matrix.os }}
    steps:
      - run: |
          touch "👍.txt"
          touch requirements.txt
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: "${{ matrix.python }}"
          cache: pip

Expected behavior:

All strategies are successfully completed.

Actual behavior:

On windows,

Error: Cannot read properties of undefined (reading '0')
node:internal/fs/promises:894
  const result = await binding.stat(pathModule.toNamespacedPath(path),
                               ^
Error: ENOENT: no such file or directory, stat
    at Object.stat (node:internal/fs/promises:894:32)
    at DefaultGlobber.<anonymous> (D:\a\_actions\actions\setup-python\v5\dist\setup\index.js:7081:47)
    at Generator.next (<anonymous>)
    at D:\a\_actions\actions\setup-python\v5\dist\setup\index.js:6911:71
    at new Promise (<anonymous>)
    at __webpack_modules__.8298.__awaiter (D:\a\_actions\actions\setup-python\v5\dist\setup\index.js:6907:12)
    at DefaultGlobber.stat (D:\a\_actions\actions\setup-python\v5\dist\setup\index.js:7073:16)
    at DefaultGlobber.globGenerator_1 (D:\a\_actions\actions\setup-python\v5\dist\setup\index.js:7018:60)
    at globGenerator_1.next (<anonymous>)
    at resume (D:\a\_actions\actions\setup-python\v5\dist\setup\index.js:6927:44) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'stat'
}

kzrnm avatar Dec 16 '23 09:12 kzrnm

This is caused by https://github.com/nodejs/node/issues/48673

kzrnm avatar Dec 16 '23 12:12 kzrnm

Hello @kzrnm Thank you for creating this issue. We will investigate it and come back to you with our findings.

marko-zivic-93 avatar Dec 18 '23 15:12 marko-zivic-93

This error has been resolved in Node 20.12.

Related

  • https://github.com/nodejs/node/issues/48673
  • https://github.com/actions/runner/issues/3263
  • https://github.com/actions/runner/pull/3284
  • https://github.com/actions/actions-runner-controller/pull/3559

kzrnm avatar Jun 08 '24 06:06 kzrnm