ron rothman.ron rothman
selectively conformist

Author Archive

»
Python 3 Rounding Surprise

by Ron
No comments yet

I discovered this subtle change when one of my unit tests mysteriously failed once I ported it from Python 2 to Python 3. A computed price was consistently one microdollar higher in the Python 3 version. I eventually tracked it down to a change in rounding behaviour between Python 2 and 3. According to the […]

»
Python 3 Exception Chaining

by Ron
No comments yet

Exception chaining solves two problems in Python 2. 1. Swallowed Exceptions If, while handling exception A, exception B inadvertently occurred, exception A was completely lost. Sadly, the original problem is nowhere to be found in our Python 2 stack trace: 2. Preserving Tracebacks Sometimes it’s useful, when catching an exception, to raise a new exception […]

»
Safe Password Storage – How Websites Get It Wrong

by Ron
No comments yet

Here’s the recording of my talk “15 minutes w/ Beeswax: Safe Password Storage – How Websites Get It Wrong.” And here are the slides: Safe password storage: How Websites Get It Wrong from Ron Rothman

»
Python at Scale: Concurrency at Beeswax

by Ron
No comments yet

My presentation from the NYC Python Meetup: Python at Scale; Concurrency at Beeswax. Concurrent Python at Beeswax – Ron Rothman – NYC Python Meetup 2020 from Ron Rothman

»
Python Dependencies The Right Way

by Ron
No comments yet

My BazelCon 2019 lightning talk, Python Dependencies The Right Way*, has been posted. Please excuse my raspy voice; I woke up that morning with a sore throat and drank copious amounts of tea and honey to nurse my voice back to semi-working condition. Enjoy!

»
Python 3 f-strings

by Ron
No comments yet

One of my favorite features of Python 3 is f-strings (Formatted String Literals). Each of these print statements emits the same output. But which of them is the easiest to write and read? Even if that’s all they did, I’d love f-strings. But they’re much more powerful than that. (For example, you can dereference objects […]

»
mtwsgi: A Multithreaded Python WSGI Implementation

by Ron
No comments yet

I wanted to combine the simplicity of Python’s built-in WSGI server with the benefits of concurrency, so I wrote this multithreaded drop-in replacement for wsgiref.WSGIServer. Also included: a server adapter for use with Bottle. Suggestions welcome.

»
Python 2.7.3 (Bug) Broke My Namedtuple Unpickling

by Ron

I just learned (*ahem* the Hard Way) that CPython 2.7.3 namedtuple is buggy when combined with pickling and older Python versions. If you pickle a namedtuple using CPython 2.7.3, you won’t be able to successfully unpickle it using 2.7.2 (nor, presumably, using even earlier versions). Here’s a short example. First, run this with Python 2.7.3: […]

»
Superior Macaroni & Cheese

by Ron
No comments yet

If “mac and cheese” makes you think of gooey, bright orange slop, then you haven’t tried this version. It’s delicious, nutritious (try it with quinoa pasta), easy to make, and it will completely change your outlook on this American favorite. Kraft™, it ain’t. Ingredients Pasta 1 package (16 oz.) elbow pasta (macaroni). Use whole wheat […]

»
Cygwin cron: Spurious Messages in Event Viewer

by Ron

I’ve been using Cygwin on my Windows partition to run a particular job every minute. Cron (Vixie’s cron) works perfectly, except that messages like this one were appearing (every minute!) in my Windows event log:

»
Fixing minidom.toprettyxml’s Silly Whitespace

by Ron

Python’s xml.dom.minidom.toprettyxml has a feature/flaw that renders it useless for many common applications.

»
2 Become 3

by Ron

“Leo loves you.”

»
It’s a Boy!

by Ron

Please welcome our newest family member, Blake, into the world.

»
Is Home Birth Courageous?

by Ron

It’s funny. I’ve recently been told—by more than one person—that Sara and I are “brave” for planning to deliver our baby at home. This from people who are educated, intelligent and have my respect. And yet, they couldn’t have picked a worse way to characterize the decision. What’s going on here? Read on, and then […]

»
Canada Trip: Posted

by Ron

Finally posted the itinerary and photos from our summer trip to Quebec & Ontario. Activities included: Visiting friends Cycling 100 miles of scenic converted rail line Genealogy research in rural Quebec Consumption of many and varied animal parts (not to mention: chocolate, cheese, poutine, et al.) Ice wine tasting Quebecois Folk music concerts Watching Beluga […]

»
CSA Inventory, Week 10

by Ron

Produce Roundup This week’s vegetables. (Click for larger view.) Fresh, organic and local. $12. This week’s take: