Hacker News new | ask | show | jobs
by acgh213 2088 days ago
Congrats to the dev finally realizing that the switch to python 3 was a real thing instead of, as I will quote " No, it doesn't. I am perfectly capable of maintaining python 2 myself. Far less work than migrating the entire calibre codebase."

Glad he made the sane option, I held off from converting my eBook library to the system because of the previous python2 ignorance.

5 comments

I hate this take. Everytime Calibre is posted on HN, someone always brings up Kovid and complains about how the software isn't up to their standards. Then everyone circlejerks about the ways Kovid has incensed them in some way or some form by posting some comment on the internet. Imagine maintaining a 500K LOC application for free and for almost a decade, and being criticized by people for using a legacy language. Especially since no other application comes close to the functionality Calibre does.

Calibre has been completely reliable on the multiple e-readers and computers I've used it on.

The only reason this migration is taking place because out of the thousands of people on this forum who complain about his code, several of them decided to help him instead of continuously complain.

Couldn't agree more, it's been very strange reading through this thread & multiple linked launchpad threads to see how critical people can be of things they themselves can't (or aren't willing to) fix - then the understandably irritated responses being pasted out of context all over.

I don't understand this hypercritical way of looking at things, especially considering how powerful and useful Calibre is. I plugged in a very old e-reader to my computer and tried a variety of things to put books on it; Calibre was the only thing that worked (including the actual ereader software!) I can't imagine how much work something like this would take to maintain.

Why? - I don't understand how Calibre's move from Python 2 to Python 3 should impact you as an end-user. The user experience should be identical.

If anything, the user experience has been diminished in the move to Python 3, as the maintainer mentions some 3rd party plugins won't work as they need to be ported over.

Python 2 is EOL, which means the language (and worse: probably all non-standard dependencies you are using) are stuck in time unless everybody decides to go with Python 2 and ditch Python 3.

This would mean considerable dev time to track bugs in the language and dependencies that have been fixed by others in their Python 3 variants. And that means a dev that could have worked on new features now works to do (silly) maintenance work. This clearly does have an impact in the long run.

I am working with Python myself. Everything I moves to Python 3 was a one-time effort, while the stuff where I had stayed with Python 2 means constant effort of making sure it is still safe and no major bug has been discovered in the deps.

I understand the annoyance people have with this, but there aren't to much rational arguments why to use Python 2 over Python 3. In fact it would be the other way around. Before it was minor differences, but the language evolved in a good way since ca. version 3.5 and some of the solutions are really useful (typing, dealing with encodings and unicode, not having to make sure you are using floats when dividing two numbers etc.)

In practise by far the biggest difference is that print foo becomes print(foo), and that is not a big deal if you ask me

Please understand how big codebase is. Porting pyqt stuff is not easy. If you see comments in bug, author and others already started to work on port, but they knew it will take time and they were sure of easyness of maintaining old version. It is always easy to whine than UNDERSTANDING and DOING actual work. As you're already developer, you must know that if it is that easy, author had it ported already

Plus as port itself doesn't affect any user experience, it was not emergency situation. It is just that 'we are working FREELY with our own pace, so it will take time. Actual contribution is really appriciated than complains'

There is another similar program I miss is, leafpad. It is dropped by distros as not yet ported.

I do understand that, my point was precisely that this is always a tradeoff between multiple things. If maintaining the old version is easier than migrating to the new one, you don't do it.

This balance — however — can change with time. E.g. if one of your major dependency moves to Python 3? Or gets abandoned.

I didn't say it was easy, my point was that over time more and more dependencies make a shift to Python 3 as well, which means at some point Python 2 stuff becomes harder to maintain. Whether that point happens early or late depends entirely on the project.

Additionally I nowhere said that this must be done by anyone — you are projecting here.

For me the biggest issue was the reuse of datatype identifiers for different datatypes. Python 2 had a byte string <str> and a unicode string <unicode> types. Python 3 still has both types, but now the byte string type is called <bytes> and the unicode string type is called <str>.

The new names are without a doubt better. In a vacuum. But coming from Python 2 to Python 3 and dealing heavily with encodings because I use Python for massaging machine-generated reports, the fact that they reused the same datatype identifier for bytes in P2 as for unicode in P3 really put me off.

Now that I've made the change (OK, six years ago) I'm much happier with the way Python 3 handles bytes and unicode strings. I think it is a model that all languages could learn from. But it should have been called <string> or stayed <unicode> instead!

Yeah, indeed many things about that transition could have been handled better. E.g. it should have been more small incremental steps, the version 2 should have been phased out quicker, there should have been tooling to help transitions like these etc.
Python2 is old and has been in widespread use for years. Realistically, how likely is it that a new bug will be found that affects Calibre.
As far as I know Python 2 wasn’t EOL at the time of the statement from the author of Calibre.

So it’s kind of harsh to judge that statement in that light isn’t it?

Actually, it was. The last version of Python2 was 2010 released, with only bugfix-versions coming after this. And EOL for those bugfix-versions was also set at the time of the statement, and actually even twice, as the date was pushed back by some years.

Everyone at that time knew that Python2 is dead and that everything is in transition to python3. Most new code was written for python3 and not even compatible for python2 anymore. So it really was just one guy deciding to maintain his own fort on his own.

If as a dev you know their code base will have issues based on what you know about the ecosystem why would that not be a reason to hold off on the product. If they prove themselves despite the issues you choose them, if they realize the issues with their response and adapt you choose them, and if the product blows up because of foreseen issues you predicted you didn't waste your time on a product you suspected was doomed and probably found an alternative in the meantime.
It's a good "smell test" as a developer. It's one of the "secret skills" you earn as someone who knows how to build systems, even though it's anything but secret.

As a case study in open source development, I find it fascinating. In large closed source products, these discussions and their relative dissent is held behind closed doors. I wouldn't be surprised if large parts of YouTube remain Python 2 for a long period of time. But the product owners are aware of these tradeoffs and wouldn't allow public discussion on the subject.

Calibre, from what I've heard has had a historically "bad" codebase. I know nothing about it. But is it the truth?

Calibre is one of those pieces of software where you can "feel" the bad code base as an end user. It's obvious in the way that seemingly simple things are never improved, making changes is obviously hard. It is truly one of the jankiest software systems I have used.
As a user I can't "feel" this bad code at all. Sure, it's has It's own philosphy of things and ocaasional bug like every software, but it's still one of the most stable and productive apps I know. there are regular updates, no big deal breakers and faults coming from the project itself. It simply works and grows, despite being so complex and powerful.

So what is this "bad codebase" you seem to feel?

I mean the UX could be better of course, but are there any specific issues that come to mind? I've never felt that way when using Calibre. I always thought of it as a rather smooth piece of software. Unlike some other pieces of libre software, like LibreOffice...
It does a lot of things and it does all of them at least reasonably well. Some parts like reading ebooks has 75 different choices but I don't think anything nor any combination of things does everything it does and any 3 choices to do 75% of what it does would doubtlessly be vastly jankier.

Not liking how something works doesn't make it wrong or broken.

I understand what you mean, but still: it kinda works.

It feels like a vehicle that has been organically modified over the years by a person who only has a welding machine and a cutting torch and a changing taste in what looks good. But hey: it drives.

Of course you have to know the intricate of the machine to make it behave, but isn't that part of it's charms?

> It feels like a vehicle that has been organically modified over the years by a person who only has a welding machine and a cutting torch and a changing taste in what looks good. But hey: it drives.

I have noted this quote and intend to apply it to every large software stack I work on from now on because damn if it isn't true of all of them.

I still don’t get the rationale. It’s not like calibre somehow converts your ebooks to a proprietary format that you can’t use without calibre or that it modifies your ereader so that it won’t work without caliber either.
It's an ebook management tool. True, it's not proprietary, but if you rely heavily on it, it's a pain to switch to something else later. When you have very reasonable doubts about the future of the project, it makes sense to look for alternatives.

I don't think any good alternatives exist, but if they did, I'd probably switch in a heartbeat. The lead developer for Calibre is extremely annoying. RMS is easier to deal with.

I for one don't really deal with Calibre's author personally. I enjoy Calibre very much, and I'm grateful to its author. But you do you, if that precludes you from using Calibre that's fine.
I enjoy Calibre a lot as well and do not deal with him personally, and am grateful for what he has produced, but if there were alternatives that served my needs, I'd switch. Gratefulness doesn't mean overlooking one's flaws or loyalty.
Most of the time as a user you deal with the consequences of the developers competence or lack thereof not their personality. I'd infinitely rather use the work of a competent asshole than an incompetent saint. I've filled out bug reports and feature requests for calibre and found that even when I didn't agree with Kovid he was relatively easy to approach and responsive to dialog even when I didn't necessary agree with the response I feel like I've derived a ton of value from his work for zero dollars and zero cents.
> I'd infinitely rather use the work of a competent asshole than an incompetent saint.

As would I. On a higher order of infinity, I'd use the work of a competent saint over a competent asshole.

Let's not make false dichotomies.

> If as a dev you know their code base will have issues

If as a dev one ~not know~, assumes that their code base will have issues because its python 2, then the dev has some issues.

Calibre is 13 years old and widely used. There is no reason someone would want to not use it because of as trivial a reason as Python 2 to 3 except for some rationalized emotional nonsense about the Python 2 to 3 shift. Every time Python 2 vs 3 is discussed, there are a bunch of emotional people spewing vitriol about luddites or some nonsense like that. Easy for especially weakly socialized young people that many programmers are to get caught up in that.
> There is no reason

> there are a bunch of emotional people

> or some nonsense like that

> Easy for especially weakly socialized young people that many programmers are

It's amusing to watch you call others "weakly socialized" when reading the rest of your comment. Social awareness is not exactly exuding from it, what with the judgments and the confident assertions.

Seems I touched a nerve there. I see a pattern and say it. Don’t take it so personally.
Reminds me of what a friend once told me: The desktop folks want the Latest Software immediately, and the server folks want nothing to change, ever.

If you've ever developed for linux, you might come down on the side of the server folks. You will find that there's a web of dependencies everywhere that you will have to navigate. And the more higher-functioning what you are doing, the more likely this will become more and more complicated.

If people depend on an app, develop for something like Ubuntu 16.04 or Ubuntu 18.04. It is (more) likely that people will be able to use it without trouble for quite some time. It is very stable and it is not likely updates will affect the folks using your software. They will be able to use the software for years.

strangely, I wonder if arch linux might be the counterpoint to all this. You might just do continuous maintenance all the time instead of one-giant-upheaval-update every few years.

>strangely, I wonder if arch linux might be the counterpoint to all this. You might just do continuous maintenance all the time instead of one-giant-upheaval-update every few years.

Evidently, one of the people mentioned in the calibre blogpost helping the python3 migration is an Arch Linux contributor :)

Eli Schwartz is an absolute treasure. Because Arch strongly prefers to ship unmodified upstream projects, Eli pops up all over the place fixing bugs upstream.

I've been using his Arch repo shipping Calibre with Python 3 for I think over a year. My system is updating to Calibre 5 from the main repos as we speak, so I guess I'll remove the custom repo now.

Now I'm only waiting for the Kodi 19 release before Python 2 will be gone from my system forever...

>Eli Schwartz is an absolute treasure. Because Arch strongly prefers to ship unmodified upstream projects, Eli pops up all over the place fixing bugs upstream.

Not to diminish the work of Eli, but several Arch package maintainers end up bugfixing upstream projects to keep sources unpatched. Personally done upstream contributions to several upstreams I maintain in the distribution :)

Of course! I happen to see Eli all over the place, but many others as well.

(I'm not an Arch TU or dev, but I also contribute upstream fixes for AUR packages I maintain)

Docker honestly made the world a little easier. You’re responsible for everything above the kernel.
I love docker, but I really wish they would change a couple things.

I wish there was a way to say:

  LAYER foo
  RUN unpack_some_large_package
  RUN build it
  RUN install it
  RUN delete stuff
  LAYER bar
because the normal way of using docker makes really really large images.

and the efficient use of docker is unreadable and hard to maintain:

  RUN unpack_some_large_package && build it && install it && delete stuff
thing is - if you do it this way you can hack gigabytes off your image sizes

This is lots harder nowadays over vpn.

I know there's docker squash, but that is a hack on many levels.

Then there's the firewall thing

and last, I'd like to have my own private repository - where docker wont' and can't pull from other machines.

Is the current multi stage build process not sufficient for you?

https://docs.docker.com/develop/develop-images/multistage-bu...

thank you! none of the docker files I've seen used this but it has worked since 17.x
Can't you use multi-stage builds to achieve this?
thank you, i've never seen this :)
It is easier for developer but risky for end user. Docker runs as root and you have to trust application developer to use latest security patches for all dependencies.
They run as root per default.

Simply using the "USER <uid/uname>" directory means you run as non-root user with a specified UID. Kubernetes recommends doing that as a baseline security measure. You can also drop caps from a container so even if you are root inside, you can't do a lot of things root can.

The main developer of Calibre has had a long history of arrogant statements like that. Most famously illustrated in this bug report thread https://bugs.launchpad.net/calibre/+bug/885027

It's like...how many times do security researchers have to exploit your code (and your many "fixes") before you change your program's mounting architecture?

I read this bug report when I want to feel something.

> The main developer of Calibre has had a long history of arrogant statements like that. Most famously illustrated in this bug report thread https://bugs.launchpad.net/calibre/+bug/885027

That's more ignorance that arrogance. He fixed what he understood, and discussed what he did not understood till he found a satisfying solution.

Personally I wouldn't trust a dev who fixes stuff blindly which they don't understand. Though, in case of security this of course can have also bad outcomes, as illustrated in this case in the process. But that makes it even more important for everyone to follow through and communicate clearly. Which did happen here at the end.

That's almost 9 years old now.

Maybe time to let it go?

Unless there are more recent examples to point to. Or the problem still is not fixed.

Yeah, he is... a character, to say the least. It's a shame because outside of Konsole, Kitty is the closest thing to iTerm in the linux space. what's holding it back from being as powerful and usable is basically not having a UI at all, and he's opposed to having more GUI at all, like on this very basic feature: https://github.com/kovidgoyal/kitty/issues/1402
Have you tried Konsole, the KDE terminal. It is absolutely terrific. It handles RTL and multibyte characters perfectly, works with tmux, has monitoring for both activity and silence, renamable tabs, horizontal and vertical splitting, bookmarks, scrolling, colour support, on-the-fly font resizing and colour scheme switching, keyboard shortcuts that do not conflict with any *sh, copy and paste shortcuts for both the normal clipboard and the X11 clipboard, supports the mouse, search functionality, I could probably go on. If iTerm has any feature that I'm missing, I'd love to hear about it.
I mention it in GP! It's what I'm using, since I use my mouse heavily to get my setup, and Kitty just isn't for mouse users.
Oops, yup, I see it now!
I wish I knew how to fit all these features of an advanced terminal to my use cases.
Good thing other people do!
If you're going to stop using stuff because a key person on the project is a bit of a dick, I assume you don't use anything via Linus or Apple-era Steve Jobs.
Wait, why does a book reader ever need to "mount" anything? I don't understand.
I'm guessing because it has extensive support for connecting and communicating to eBook readers like Kindle and the likes.
Yes, precisely. It’s actually very useful, since it can rearrange files on kindles etc.
What a time to be alive.

I remember installing calibre once, because I needed to open an .epub file I had. Upon opening it, it started to "classify" stuff and build a sort of catalog, to which I kill -9'd it immediately and uninstalled it for good measure. But mounting filesystems is way, way worse than anything I imagined it was about to do!

While the filesystem issue showed stubbornness, the fact that it tried to build a catalog is perfectly reasonable, given it is an ebook management software, which happens to include an epub reader.

You really can't blame a program to do what it says to do.

I don't blame the program, I blame myself for installing a management software when all I wanted was an ebook viewer (and definitely NOT a management software of any kind).
Calibre is much more than an eBook reader. It's more of an authoring / reading / management suite.

It can manage eBook readers' libraries either natively or via plugins. It can work with my Kobo eReader for example. I use Calibre to convert standard epubs to kepub (kobo enhanced epub) and push to device and extract highlights from books mainly. It's also a very nice ebook library so I can search and push/read/modify what I want.

Because it's not a book-reader, but a suit of tools for ebooks. Which includes managing them, receiving data from certain source, reading them, converting beetween different formats, automating certain managment-tasks, offering a web-interface as also desktop-interface, and finally also managing synchronisation with many many ebook-readers (for which the mounting is neccessary). And it BTW has a very elaborated plugin-system which allows to add even more that what it can do out of the box.

It's more justified to call it an IDE for Ebooks.

My god, reading this makes me wish there was an alternative to Calibre. I already just tolerate it because it's the only ebook manager I know and there are a lot of things about the UI and how it works that bother me.
It's like OpenSSL. Everyone acted like they did a terrible job in the end, but either you had alternatives and you could have linked to gnutls or you decided that you didn't have alternatives and OpenSSL was irreplaceable. Either way, the product was just way too good.
No, it just means it was acceptable. Doesn't mean it doesn't have its flaws that need to be addressed.

Making an ebook manager is a lot of effort for little reward, so I'm not surprised Calibre is the only one out there. I'm not sure why I'm not allowed to be unhappy with it regardless.

Man, the people here are unbelievable. Calibre isn't this unassailable icon where expressing displeasure about it is heresy. What was that post about people accepting that technology sucks? Calibre sucks. But people put up with it. But somehow I'm the asshole for expressing my dislike.

What features do you use the most? I'm looking to extend a personal project for searching epubs to be more featureful when compared to calibre.
I mostly use the tags feature (though I wish this was better too), because I mainly use Calibre to organize my ebooks library.
My god, somebody did UI I don't like. Its barely tolerable, but I still use it because this world owes me and I can't sunken cost my precious time.
This comment breaks the site guidelines and is a big step in exactly the opposite direction of what we want here. Would you please review https://news.ycombinator.com/newsguidelines.html and take the intended spirit closer to heart? Note that they include:

"Please respond to the strongest plausible interpretation of what someone says, not a weaker one that's easier to criticize. Assume good faith."

"Don't feed egregious comments by replying; flag them instead."

https://news.ycombinator.com/newsguidelines.html

What are you using instead? I don't see a viable alternative to Calibre currently.