unsloth/studio/backend/auth
Daniel Han 1fcdfb3048 Open the bootstrap file in binary mode and finish the write
Three defects in the in-place normalisation, all on the Windows upgrade path.

os.open does not add O_BINARY on Windows and CPython never changes the CRT
default of _O_TEXT, so the descriptor was in text mode: os.write turned the LF
straight back into CRLF and ftruncate then cut the LF off, leaving
"<secret>\r". That is the bug this PR exists to fix, reintroduced by the
migration itself, and it is a fixed point that never converges. os.read
translates in reverse too, so a genuinely CRLF file failed verification and was
silently skipped.

os.write may return having written fewer bytes than asked; ftruncate would then
NUL-extend the credential so it no longer matched the hash in auth.db.

os.fchmod only reached Windows in 3.13 and AttributeError is not OSError, so on
3.9 to 3.12 it escaped both handlers and aborted the first start after upgrade.
2026-07-29 06:19:37 +00:00
..
.gitkeep root studio folder 2026-02-02 09:13:49 +00:00
__init__.py Studio: make code comments and docstrings more succinct (#6029) 2026-06-08 23:07:28 -07:00
authentication.py Studio: tighten the comments added by the OpenAI model-admission work (#7501) 2026-07-27 05:59:03 -07:00
bootstrap_timeout.py Replace standalone Studio wording with Unsloth (#7221) 2026-07-19 00:47:04 -07:00
hashing.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
storage.py Open the bootstrap file in binary mode and finish the write 2026-07-29 06:19:37 +00:00
terminal_prompt.py Studio: reject whitespace-only passwords (#7341) 2026-07-23 00:44:37 -07:00