Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 10-13-2024, 02:25 AM   #1
Yossarian
Junior Member
Yossarian began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Oct 2024
Device: kobo
calibre 7.6.0 / python error

When I want to edit some books, I get the following error. Unfortunately, I don't know how to fix this error. Perhaps someone knows the solution?

TypeError:sequence item 1: expected str instance, bytes found

calibre, version 7.6.0
FEHLER: Unbehandelter Ausnahmefehler: <b>TypeError</b>:sequence item 1: expected str instance, bytes found

calibre 7.6 embedded-python: False
Linux-6.8.0-107045-tuxedo-x86_64-with-glibc2.39 Linux ('64bit', 'ELF')
('Linux', '6.8.0-107045-tuxedo', '#45tux1 SMP PREEMPT_DYNAMIC Thu Sep 12 19:21:40 UTC 2024')
Python 3.12.3
Interface language: de
EXE path: /usr/bin/python3.12
Successfully initialized third party plugins: Find Duplicates (1, 10, 9)
Traceback (most recent call last):
File "/usr/lib/calibre/calibre/gui2/__init__.py", line 755, in dispatch
self.func(*args, **kwargs)
File "/usr/lib/calibre/calibre/gui2/tweak_book/job.py", line 84, in job_done
callback(job)
File "/usr/lib/calibre/calibre/gui2/tweak_book/boss.py", line 381, in book_opened
self.current_metadata = self.gui.current_metadata = container.mi
^^^^^^^^^^^^
File "/usr/lib/calibre/calibre/ebooks/oeb/polish/container.py", line 649, in mi
mi = self.serialize_item(self.opf_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/calibre/calibre/ebooks/oeb/polish/container.py", line 1009, in serialize_item
data = re.sub(br'(<[/]{0,1})opf:', r'\1', data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/re/__init__.py", line 186, in sub
return _compile(pattern, flags).sub(repl, string, count)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: sequence item 1: expected str instance, bytes found

Many thanks in advance.
Yossarian is offline   Reply With Quote
Old 10-13-2024, 04:55 AM   #2
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 73,779
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
I notice

Quote:
calibre 7.6 embedded-python: False
in the log. I'm guessing that your system python is different enough from the python that calibre is written against that there's a syntax difference.

But that is just a guess.
pdurrant is offline   Reply With Quote
Advert
Old 10-13-2024, 05:20 AM   #3
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,415
Karma: 145491800
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
You should also update to the latest calibre. It's not worth while to try to debug an older calibre.
JSWolf is offline   Reply With Quote
Old 10-13-2024, 05:44 AM   #4
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,364
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Yossarian View Post
calibre 7.6 embedded-python: False
Linux-6.8.0-107045-tuxedo-x86_64-with-glibc2.39 Linux ('64bit', 'ELF')
('Linux', '6.8.0-107045-tuxedo', '#45tux1 SMP PREEMPT_DYNAMIC Thu Sep 12 19:21:40 UTC 2024')
Python 3.12.3
Adding to what @pdurrant said, you are running Python 3.12.3. Calibre hasn't yet been ported to python 3.12.

Adding to what @JSWolf said, there might have been some 3.12 problem workarounds added in a more recent release. Upgrade to find out.

If you are using a distro-provided release of calibre, which it looks like you are, then change to the official release at https://calibre-ebook.com/download.
chaley is offline   Reply With Quote
Old 10-13-2024, 12:03 PM   #5
Yossarian
Junior Member
Yossarian began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Oct 2024
Device: kobo
Thank you for your answers. Yes, I am using Kubuntu 24.04 and have installed Calibre from the package sources. I give it a try to install the latest version of Calibre, following the instructions for Linux and let you know if I was successful.

Cheers, Yossarian
Yossarian is offline   Reply With Quote
Advert
Old 10-15-2024, 02:51 AM   #6
S01010000
Junior Member
S01010000 began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Oct 2024
Device: remarkable 2
Hi, long shot but does anyone know of you can use the system Python with the Mac version of calibre?
S01010000 is offline   Reply With Quote
Old 10-15-2024, 06:30 AM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,251
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No, you cannot.
kovidgoyal is offline   Reply With Quote
Old 10-15-2024, 10:26 AM   #8
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 73,779
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
Quote:
Originally Posted by S01010000 View Post
Hi, long shot but does anyone know of you can use the system Python with the Mac version of calibre?
The current macOS does not come with any version of Python, and hasn't since macOS 12.3
pdurrant is offline   Reply With Quote
Old 10-19-2024, 01:32 AM   #9
Yossarian
Junior Member
Yossarian began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Oct 2024
Device: kobo
I have uninstalled Calibre and installed the latest version as described on the Calibre website. Now everything is correct and I can edit any book without an error message appearing.

Thank you guy's.
Yossarian is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
'calibredb add' throws python error when calibre-server is running CubGeek Server 2 09-17-2021 11:01 AM
Calibre Python error on Win10 B_chan Devices 6 07-10-2016 02:40 AM
Python error message when loading Calibre AJ Starr Calibre 5 11-17-2015 11:20 AM
calibre will no longer open - python error SouthernShred Calibre 21 08-22-2014 05:42 PM


All times are GMT -4. The time now is 08:04 AM.


MobileRead.com is a privately owned, operated and funded community.