Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Break with unicode tag #7

item4 opened this issue Aug 11, 2016 · 3 comments

Break with unicode tag #7

item4 opened this issue Aug 11, 2016 · 3 comments


Copy link

item4 commented Aug 11, 2016

I'm Korean. So I sometimes use Korean tag in post. but lektor-tags do not work fine with unicode tags

(techblog) [item4@item4-mbp]$ lektor server
 * Project path: /Users/item4/Projects/
 * Output path: /Users/item4/Library/Caches/Lektor/builds/64ad49362b7f45d4919f47f92b714db9
Started source info update
 * Running on (Press CTRL+C to quit)
Finished source info update in 3.37 sec
Started build
Finished build in 1.15 sec
Started prune
Finished prune in 0.04 sec
Traceback (most recent call last):
  File "/Users/item4/Projects/lektor/lektor/", line 49, in build
  File "/Users/item4/Projects/lektor/lektor/", line 1062, in prune
    for aft in build_state.iter_unreferenced_artifacts(all=all):
  File "/Users/item4/Projects/lektor/lektor/", line 371, in iter_unreferenced_artifacts
    and is_primary_source''', [artifact_name])
ProgrammingError: You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str). It is highly recommended that you instead just switch your application to Unicode strings.
Copy link

I have edited /Users/item4/Projects/lektor/lektor/ and added a single line

con.text_factory = lambda x: unicode(x, 'utf-8', 'ignore')

after the following line

con = sqlite3.connect(self.buildstate_database_filename,
timeout=10, check_same_thread=False)
Ref Link :

Copy link

keikoro commented Mar 11, 2017

@haseenapa Have you considered contributing the fix to Lektor directly by sending a pull request?

Copy link

keikoro commented Mar 11, 2017

Oops, just saw that @item4 actually submitted a fix for the issue. I'm guessing the issue could be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

3 participants