Author archives: Mike

RSS feed of Mike

All those little spots where you use strings...

x.split( '.' )
Is an idiom that shows up all over the place, particularly in list comprehensions. Run your code through 2to3 and it fails when x is a str (bytes) object, as 3.x thinks the '.' is unicode. It fails with a rather cryptic TypeError: Type str doesn't support the buffer API error as ...

Continue reading

bzr-svn for those stuck with svn servers...

At work I need to interact with an svn (1.4) repository, but honestly I'm so spoiled by bzr that it just drives me nuts, particularly the (frustratingly frequent) situations where I miss a particular change-set/revision when merging into my tree and wind up reverting someone's changes.  The VCS should bloody-well track what revisions are missing, ...

Continue reading

Good news, backups worked, bad news, it's the motherboard

The backups did, indeed, work, though the /etc/ backup wasn't quite as recent as I'd have liked.  However, now *another* disk is corrupting (this time the home/var disk), and it looks like it's the motherboard's SATA controller at fault.  Replacing that will require new motherboard, memory, and CPU... and yet another day of working on ...

Continue reading

Python 3.x Porting Notes

Decided to see how much work getting PyOpenGL ported to Python 3.x would be.  Notes so far:

  • ubuntu has Python 3.1 packaged (yay)
  • also has distribute and -dev, you'll need both
  • virtualenv -- this is key for my porting work-flow (not just for PyOpenGL, for almost every project), had to use an hg branch to ...

Continue reading

Mocker's hidden gem...

Mocker has one uber-nice feature... it will mock out an object in basically all namespaces, so you can do a .proxy( 'mymodule.this.that' ) and have the resulting mock object replace the target "that" wherever it's been imported.  It won't, for instance, pick up references in lists, sets and the like, but for basic namespaces (dictionaries) ...

Continue reading

Stub/Mock-a-Process Module

Say you want to have a test suite that tests logic which runs command-line processes that should *not* be run on the test machine (e.g. they would cause the test machine's configuration to be totally messed up).  You want to test right down to the point where the call is made (i.e. you don't way ...

Continue reading

DHClient!!! (think "Kahn!")

It's like the standard DHCP client and server are *trying* to be ridiculous.  Half the custom options show up, the others don't, no error messages, different SELinux restraints on different systems, standard options seemingly unknown on one side or another, options just disappearing without explanation.

If you don't understand an option, log an error, don't ...

Continue reading

Oh, SELinux, you complete(ly annoy) me

The DHCP hiccup I've been debugging all week turns out to have bee nothing other than an SELinux restriction preventing the config-file from being read.  Most annoying part is that I already discovered that restriction weeks ago and thought I'd resolved it.  Now to dive in and figure out how to make this work properly, ...

Continue reading

Why would you delete (valid) pages on Wikipedia?

Why the heck is wikipedia *deleting* articles for not being universally notable rather than simply assigning a "notability" level to them?  It's a computer system, and you store all of the revisions anyway, so why delete something rather than simply marking it less-widely relevant (and thereby decreasing search-result ranks and the like)?  I gather somebody ...

Continue reading