Skip to content

fix: pack reads files in binary mode to prevent trimming on Windows#1389

Open
cristipufu wants to merge 2 commits intomainfrom
fix/pack-binary-mode-windows
Open

fix: pack reads files in binary mode to prevent trimming on Windows#1389
cristipufu wants to merge 2 commits intomainfrom
fix/pack-binary-mode-windows

Conversation

@cristipufu
Copy link
Member

@cristipufu cristipufu commented Feb 27, 2026

Summary

  • Read all files in binary mode during pack ("rb" instead of "r"), preventing Python's universal newline translation from silently converting \r\n\n on Windows, which caused files to appear "trimmed"
  • Normalize zip entry paths to use forward slashes on Windows (previously used OS-native backslashes, producing non-standard zip entries like content/subfolder\file.py)
  • Bump version to 2.10.2

Test plan

  • All 1551 existing tests pass
  • Pack a project on Windows with LF line endings (e.g., from Cursor) and verify file content in the nupkg is byte-identical to the originals
  • Pack a project with files in subdirectories on Windows and verify zip entries use forward slashes

🤖 Generated with Claude Code

Development Package

  • Use uipath pack --nolock to get the latest dev build from this PR (requires version range).
  • Add this package as a dependency in your pyproject.toml:
[project]
dependencies = [
  # Exact version:
  "uipath==2.10.2.dev1013895091",

  # Any version from PR
  "uipath>=2.10.2.dev1013890000,<2.10.2.dev1013900000"
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
uipath = { index = "testpypi" }

[tool.uv]
override-dependencies = [
    "uipath>=2.10.2.dev1013890000,<2.10.2.dev1013900000",
]

@github-actions github-actions bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository labels Feb 27, 2026
@cristipufu cristipufu self-assigned this Feb 27, 2026
@cristipufu cristipufu requested a review from Copilot February 27, 2026 14:32
@cristipufu cristipufu added the build:dev Create a dev build from the pr label Feb 27, 2026
…g on Windows

Text files were opened in text mode during packing, causing Python's universal
newline translation to convert CRLF to LF on Windows. This silently trimmed
file content when git's autocrlf converted LF to CRLF on checkout. Also
normalizes zip entry paths to use forward slashes on Windows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

This comment was marked as outdated.

…pack

Writes files with explicit CRLF and LF line endings in binary mode, then
asserts the zip entry bytes match exactly after packing. Prevents the
text-mode read regression from reappearing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build:dev Create a dev build from the pr test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants