news
Programming Leftovers
-
Perl / Raku
-
Python
-
Gary Benson: Python antipattern: Close in finally
Why is the second better? Using
contextlib.closing()
ties closing the item to its creation. These baby examples are about equally easy to reason about, with only a single line in thetry
block, but consider what happensifwhen more lines get added in future? In the first example, the close moves away, potentially offscreen, but that doesn’t happen in the second.
-
-
Rust
-
Rust Blog ☛ The Rust Programming Language Blog: crates.io security incident: improperly stored session cookies
Today the crates.io team discovered that the contents of the
cargo_session
cookie were being persisted to our error monitoring service, Sentry, as part of event payloads sent when an error occurs in the crates.io backend. The value of this cookie is a signed value that identifies the currently logged in user, and therefore these cookie values could be used to impersonate any logged in user.
-