Julian Andres Klode: Python modules, licenses, and more
Today, I want to present you some things I have asked myself and some ideas about them. You should not expect the information to be correct. Therefore, if you find mistakes, please leave a comment. Copyright statements / Comments MIT license: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - If you had a python module released under the MIT license, and this is in the comment of the module and you somehow ship only pyc or pyo files, you would be violating the license by not including the copyright notice, because these files do not contain the modules. This is also true for many other licenses, but this seems to be the best example. If you include this in the docstrings, you would only violate such license terms if you distribute bytecode created with the -OO option. This also does not apply if the code is a program which prints the license (eg. via a commandline license option). GPL vs LGPL Is there any difference at all? The LGPL requires you to publish all changes you make to the code, while the GPL also requires you to publish source files you have created. This also means that you can t link a non-free program to a GPL library, but you can link it to a LGPL library. Because Python modules are not linked to each other, everything you do is normally considered a use of the module. Therefore, if there is a module G released under the GPL, and a module X released under a different, incompatible license X, you would still be able to use the facilities provided by the module G. This also effects subclassing classes of G in X. Due to the enormous flexibility provided by Python you can easily break the intented rules of the GPL. Instead of editing the class definition you subclass the class and edit it. You can also replace stuff inside the module G during run-time, simply by setting the relevant attributes. In summary, Python makes it very easy to work around the restrictions of the GPL, therefore, using the LGPL instead of the GPL makes no sense. You can t give others more rights than they already have. You would just make it easier for others in case they want to write new code and want to copy some of yours. What about the AGPL? The AGPL exposes (compared to the GPL3) further restrictions on using the software on eg. websites. It is intended for programs which may be used by SaaS providers. Like with the GPL, the enormous flexibility of Python compensates most of the restrictions the license. BTW, which license to choose? I normally choose to release my programs and modules, etc. under the terms of the GNU General Public License, version 3 (or at your option) any later version. But it also depends on the size of the project. When I work on small scripts, like hardlink, I generally choose the MIT license. This is also somehow related to the fact that I don t want to have a license which takes more than 50% of the size of my project. This is actually a bit different to what Bruce Perens does. Bruce recommends 3 types of licenses. The first one is what he calls the gift license. He recommends the Apache License 2.0, because it provides better protection from software patent lawsuites . The MIT license is another example for this type of license. While not providing the patent protection, this is not that critical for persons like me who live in Germany. Furthermore, the number of patents possibly infringed by the code is proportional to the amount of code. The second type he recommends is a sharing-with-rules license, like the GPL 3. Like him, I mostly use this license for my code. Sometimes I also use the GPL 2, but only when I am required to do so, or because of tradition. In generally, I only upgrade software from GPL-2+ to GPL-3+ when I introduce new features, not for bug fixes or similar. The third type he describes is the in-between license , like the LGPL. As I pointed out above, this type of license is not much different than the GPL, at least if applied to Python modules. Therefore, I never release any Python module under such a license. Things may be different for C libraries (and others), but I never released one. Documentation, etc. Well, I license all my documentation under the same license as the software. This makes it easier for the user because he does not need to read yet another license (at least if he reads all the licenses of the software he uses). If I distribute non-code content independent of code, I generally choose a Creative Commons License (CC-BY-SA 3.0, CC-BY 3.0), Germany. This also has an effect on this blog. From now on, all content (ever) provided by me via this blog is licensed under the terms of the Creative Commons Attribution-Share Alike 3.0 Germany, unless a different license information is included as part of the post. The design and comments from other persons are not included. Why I wrote this Really, I don t know. Maybe I just want to write something, maybe I want to write these things down, so I can read them. Anyway, please tell me if I my conclusions/ideas are wrong. Update 1: There was a mistake should expect the information to be correct , fixed now: should not expect [...] . I may be wrong with the GPL vs. LGPL thing, have not completely checked this. (2009-02-18 19:18 CET) Update 2: Seems the GPL vs LGPL thing is not correct, as written by Anonymous and Bruce. (2009-02-18 19:26 CET) Posted in General

3 years. Thanks my dear Koki!

I ve been doing some code lately, fixing things here and there, and over the last few days gave mt-daapd some attention.
First, I was reported a segfault of mt-daapd when reloading web pages too fast. Surprisingly, it turned out to be a stupid omission in a simple routine and it is hard to hit without disabling the cache in the browser.
Now, I just fixed something that s been bugging me for a while: mt-daapd did not handle Avahi daemon restarts, leading to mt-daapd becoming invisible to clients relying on mDNS until you restarted it.
And, wow, that went a bit further than expected. As I expected, the simple piece of code needed to handle that wasn t there. But still it did not work, as it turns out the event loop for the Avahi polling wasn t being run. Replace stupid code reinventing the wheel by the Avahi-provided wheel and there, it works. But not when run as a daemon (aka foreground only). Well yes, starting the thread before daemonizing isn t going to work well, so fix that. EPIC WIN \o/
As mt-daapd s upstream is not active anymore I m accumulating fixes for mt-daapd in the Debian package, to the point I m starting to consider setting up a git repository somewhere with those fixes and possibly some more code rework if I feel like it.




If you re reading this post via the website rather than a feed/planet then you will notice that the site has gone completely black in support of the
Neil McGovern noticed me using drivel for my blog entries at the recent Debian UK BSP for Lenny and as he isn't using it anymore, suggested that I might want to take over maintenance. It's always better to have a package maintained by a regular user of the program.
After dropping all (pretense at) regular exercise after leaving high/grammar/secondary school (the german word is Gymnasium) and doing more or less nothing for more than 10 years, I've taken up weight training (after a not very successful attempt at volleyball; I like the sport but the team fell apart) two years ago. Since I actually managed to work out regularly (twice a week) in the first year, and since membership in a gym is not cheap, and since I moved and thus had to find a different solution anyway, I decided to buy a
If you're not reading
Here's a
Scott has several posts about git (
Yay!
This blog post is not strictly speaking news anymore - But for those who don't know it yet, three days ago
So a customer of mine needs to use RedHat. It's not their choice, the
choice was forced upon them by the people who wrote the tools they need
to use.
The new version of this particular tool which they wanted to use
requires RHEL5, and they're currently running RHEL4. So I had to upgrade
their systems from RHEL4 to RHEL5. No sweat, right?
Yeah, right.
RedHat has this nice 'Red Hat Network', where you can manage your
servers, and remotely mark packages for upgrade. You can also, by way of
a command line tool, say that you want it to upgrade from one release to
another. This can't be done remotely, which sortof makes sense;
upgrading from one release to another might cause problems that you
really really don't want if you don't have an immediate shell. So you
should use 'up2date --upgrade-to-release=5' to upgrade from RHEL4 to
RHEL5.
Except that that doesn't work. For some reason, RedHat chose not to
support in-place upgrades from RedHat 4 to RedHat 5. Instead, you have
to download installation media, boot from them (thereby inducing
downtime) and select 'upgrade' in the installer. Which part of this
distribution is "Enterprise", again?
Oh well. So I download the first ISO, and start the upgrade process.
Surely that'll work, right?
Hah. No, I really need all six images. So I download them, and start
again.
Some minutes into the installation, the HP iLO session that I'm using
times out, and takes my Virtual CD device with it. As such, the
installer-in-upgrade-mode obviously can't find the CD-ROM anymore, and
produces a read error. This is totally normal. The system provides me
with a 'retry' button. That button doesn't work.
That is to say, it works, but after two or so files, the installation
goes to a grinding halt. I had to reboot, and start over.
So after rebooting, changing my iLO session settings so the timeout
is at 120 minutes (the maximum) rather than 30 minutes (what appears to
be the default), and I restart the upgrade process, making sure to click
in the iLO interface every once in a while to keep it active. When it's
somewhere at 80% and 3 hours into the upgrade process (god, why does
that have to take so long?), it suddenly finds itself out of disk
space.
Well, shit happens, of course; guess there's nothing to blame RedHat
with that one. But the way this situation is handled, is beyond my
comprehension:
The only 'recover' option is 'reboot'. There's no 'retry'. I don't
mind diving to a second console, mucking about a bit on the mounted
partition, and doing 'retry', but the installer doesn't even offer me
that option. Instead, I have to choose 'reboot'. Never mind that the
system is halfway through an installation process and might be totally
and utterly broken, and not even bootable. Well, that's what rescue
modes on installation media are for, I guess, but still.
After cleaning out some old files that aren't needed anymore and
going back to the installer, you'd suppose that the system could figure
out what it'd already done, and continue from there, right?
Well, no, it can't. It starts over from scratch, thereby forcing me
to sit and wait for another three hours.
Times like these make me remember why I'm a Debian developer, and not
a RedHat one. Why I chose not to finish that
On my Sansa Clip, a playlist that worked fine before suddenly stopped working.
I couldn't find anything wrong with the list: it had DOS line separators,
DOS directory separators and relative paths (all stuff that Sansa needs,
unfortunately). I had generated proper EXTINF meta data lines, the list was
called .m3u8 to singal it's UTF-8. And after all: it had worked before.After deleting a leftover playlist, suddenly I noticed with another playlist
that had worked the day before that it was now empty. Ouch. So I investigated
a bit more...At some point, I ran across a post on a similar Sansa device titled