* Restore Unix executable bits when extracting zip archives
- SafeZipExtractor._extract_member now chmods each extracted file with the
Unix mode stored in ZipInfo.external_attr (POSIX only, no-op when the
archive carries no Unix attributes, e.g. Windows-authored zips).
- stdlib zipfile never restores permission bits itself; a fix is tracked
upstream at https://github.com/python/cpython/pull/150061.
- Fixes archives with more than one executable losing their exec bit after
extraction, e.g. the bundled JBR inside the Kotlin Language Server
distribution (jbr/bin/java and native libs), which previously only had
its single top-level launcher script chmod'd by the language-server code.
Fixesoraios/serena#2100
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Godot's GDScript parser can report a symbol's end column one column past the
line-end convention every other language server follows (closing a node's range from
the next lookahead token instead of the last consumed one, when that lookahead is a
synthesized newline); `replace_symbol_body` on the last function in a file silently
consumed the separating blank line as a result. `GodotLanguageServer` now corrects this
specific, measured overshoot when building its high-level document symbols (#1974)
---------
Signed-off-by: Amir Fathi <amirfathi.me@gmail.com>
FileUtils.read_file has two return paths with different newline semantics.
The primary path, open(file_path, encoding=encoding).read(), uses the default
newline=None and therefore applies universal newlines, so CR never reaches
callers. The charset_normalizer fallback decodes the raw bytes instead
(match.raw.decode(match.encoding)), which performs no newline translation, so
any file that fails to decode with the project's configured encoding re-enters
Serena carrying its CR characters.
Normalize to LF at the fallback's return, matching the primary path.