Skip to content

Comments

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

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

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
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