Bug 22314 - python-regex causes calibre crash on a Turkish locale system
Summary: python-regex causes calibre crash on a Turkish locale system
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal major
Target Milestone: ---
Assignee: Thierry Vignaud
QA Contact:
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2018-01-04 01:48 CET by Atilla ÖNTAŞ
Modified: 2018-01-07 01:39 CET (History)
0 users

See Also:
Source RPM: python-regex-2015.11.22-2.mga7.src.rpm
CVE:
Status comment:


Attachments
regexp_core patch (668 bytes, patch)
2018-01-04 01:48 CET, Atilla ÖNTAŞ
Details | Diff

Description Atilla ÖNTAŞ 2018-01-04 01:48:39 CET
Created attachment 9878 [details]
regexp_core patch

Description of problem:
Calibre requires python-regex package to work since calibre-3.7.0-1.mga7. But on a Turkish locale system we get unknown property error:

[atilla@tarakbumba ~]$ calibre

** (python2:21370): WARNING **: Couldn't connect to accessibility bus: Failed to connect to socket /tmp/dbus-HXZDMhAnGf: Bağlantı reddedildi
Traceback (most recent call last):
  File "/usr/lib64/calibre/calibre/gui2/ui.py", line 155, in __init__
    ac = self.init_iaction(action)
  File "/usr/lib64/calibre/calibre/gui2/ui.py", line 169, in init_iaction
    ac = action.load_actual_plugin(self)
  File "/usr/lib64/calibre/calibre/customize/__init__.py", line 614, in load_actual_plugin
    ac = getattr(importlib.import_module(mod), cls)(gui,
  File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/usr/lib64/calibre/calibre/gui2/actions/catalog.py", line 12, in <module>
    from calibre.gui2.tools import generate_catalog
  File "/usr/lib64/calibre/calibre/gui2/tools.py", line 15, in <module>
    from calibre.gui2.convert.single import NoSupportedInputFormats
  File "/usr/lib64/calibre/calibre/gui2/convert/single.py", line 19, in <module>
    from calibre.gui2.convert.search_and_replace import SearchAndReplaceWidget
  File "/usr/lib64/calibre/calibre/gui2/convert/search_and_replace.py", line 11, in <module>
    from calibre.gui2.convert.search_and_replace_ui import Ui_Form
  File "/usr/lib64/calibre/calibre/gui2/convert/search_and_replace_ui.py", line 155, in <module>
    from regex_builder import RegexEdit
  File "/usr/lib64/calibre/calibre/gui2/convert/regex_builder.py", line 18, in <module>
    from calibre.ebooks.conversion.search_replace import compile_regular_expression
  File "/usr/lib64/calibre/calibre/ebooks/conversion/search_replace.py", line 6, in <module>
    import regex
  File "/usr/lib64/python2.7/site-packages/regex.py", line 383, in <module>
    import _regex_core
  File "/usr/lib64/python2.7/site-packages/_regex_core.py", line 4283, in <module>
    "d": lookup_property(None, "Digit", True),
  File "/usr/lib64/python2.7/site-packages/_regex_core.py", line 1652, in lookup_property
    raise error("unknown property")
error: unknown property


Older calibre releases use internal _regex_core.py file and we used to patch it to prevent this bug.If lookup_property values for CHARSET_ESCAPES variable are lower-case this problem occurs. This is probably due to dotless "i" and dotted "I" characters in Turkish alphabet. I'm attaching a patch which fixes this issue.

How reproducible:
1. Install calibre on a Turkish locale system.
2. Run calibre and it crashes with given error above
3. Apply attached patch to /usr/lib/python2.7/site-packages/_regex_core.py
4. Issue fixed.
Comment 1 Atilla ÖNTAŞ 2018-01-07 01:39:53 CET
Anyway, i applied the patch and submitted package to repos.

Status: NEW => RESOLVED
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.