Skip to content

fs: preserve raw filename bytes in glob buffer mode#61961

Closed
jorgitin02 wants to merge 1 commit intonodejs:mainfrom
jorgitin02:fix/59202-fs-glob-nonutf8-filenames
Closed

fs: preserve raw filename bytes in glob buffer mode#61961
jorgitin02 wants to merge 1 commit intonodejs:mainfrom
jorgitin02:fix/59202-fs-glob-nonutf8-filenames

Conversation

@jorgitin02
Copy link

@jorgitin02 jorgitin02 commented Feb 24, 2026

Fixes: #59202

Summary

  • preserve non-UTF8 filename bytes when using glob with encoding: 'buffer'
  • keep matching behavior while avoiding UTF-8 replacement corruption in returned paths
  • add regression coverage for non-UTF8 filenames and traversal in buffer mode
  • document encoding and return types for glob APIs

Testing

  • python3 tools/test.py test/parallel/test-fs-glob.mjs
  • python3 tools/test.py --repeat=5 test/parallel/test-fs-glob.mjs
  • python3 tools/test.py test/parallel/test-fsglob
  • make lint-js NODE=$(command -v node)
  • scripts/agent-preflight.sh
  • make test-doc is blocked locally by an ignored local AGENTS.md markdown-lint warning; this file is not tracked in the patch.

Signed-off-by: jorge guerrero <grrr.jrg@gmail.com>
@nodejs-github-bot nodejs-github-bot added fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels Feb 24, 2026
@jorgitin02
Copy link
Author

Heads up: workflows on this PR are still in action_required (0s) and never actually executed.

I can't approve or rerun these from my fork permissions. Could a maintainer please click Approve and run workflows so CI can start?

Local verification I ran for this branch:

  • python3 tools/test.py test/parallel/test-fs-glob.mjs
  • python3 tools/test.py --repeat=5 test/parallel/test-fs-glob.mjs
  • python3 tools/test.py test/parallel/test-fs-glob.mjs test/parallel/test-fs-glob-throw.mjs
  • make lint-js NODE=/opt/homebrew/bin/node
  • make doc-only NODE=/opt/homebrew/bin/node
  • make lint-md LINT_MD_TARGETS=doc/api/fs.md NODE=/opt/homebrew/bin/node

@jorgitin02 jorgitin02 closed this Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fs.globSync returns incorrect results with non-UTF8 encoded file names.

2 participants