Gavrie's Blog

Musings on programming in Python and Go

From Python to Go

I have been programming in Python in one capacity or another since around 2000. That’s almost 15 years. Over those years, I’ve come to know the language fairly well. I originally came to Python from C and Perl, and it was quite refreshing to come to a language that is simple to use, has a consistent syntax and library, and is quite powerful.

13 May 2015 #python #go

A subprocess bug? Nah.

A few weeks ago, a colleague came to me with an interesting bug: When running a child process with Python’s subprocess module, no exception is thrown when the child process fails. In essence, what happened was the following (typed at the interactive Python prompt):

1 Jul 2014 #python

Buffers will fill up... eventually

A colleague asked me to look into a problem with him, mentioning that “Tlib hangs when we run it”. Tlib is a fairly large project that is written in Python. His initial analysis showed that it hangs at a very early phase, during with it tries to fetch the latest version to run from a git server. Various users complained about the same problem, suggesting that it is not a local issue.

18 Jun 2014 #python

Why I don't like 'transparent' RPC

Lately I’ve been working on modifying an architectural aspect of an existing software project. This project makes heavy use of remote execution of code on several hosts. To accomplish this feat, it uses several different methods for remote execution: SSH for running general shell commands, RPyC for executing arbitrary Python code remotely, as well as a couple of proprietary interfaces.

20 Jun 2012 #rpc

The YAGNI/NIH conundrum

Disclaimer: This post is about software development, but it is more about the human side of it than about the technical side. This means you may enjoy it even if you’re not a software developer (or a technical person at all).

One of the recurring issues that I encounter as a software developer is that of having to decide where on the scale between YAGNI and NIH I want to be. You are probably wondering what the hell I am talking about

15 Jun 2012

Generating virtual FC WWPNs for a storage lab

At work, I encountered an interesting problem: While testing the Fibre Channel (FC) scalability of a storage product, we needed to create a lot of FC connections between hosts and the storage system. This would in turn require a large number of FC Initiators, each of which having a unique World-Wide Port Name (WWPN).

16 Feb 2012

Improving readability and flow control in Python

Recently, a colleague and I refactored a piece of existing code that had new behavior added to it. During the process, we managed to improve the readability of the code using several techniques that I’ll describe below.

16 Feb 2012 #python