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

Open
item4 opened this Issue Aug 11, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@item4

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 item4.github.io]$ lektor server
 * Project path: /Users/item4/Projects/item4.github.io/item4.github.io.lektorproject
 * Output path: /Users/item4/Library/Caches/Lektor/builds/64ad49362b7f45d4919f47f92b714db9
Started source info update
 * Running on http://127.0.0.1:5000/ (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/devserver.py", line 49, in build
    builder.prune()
  File "/Users/item4/Projects/lektor/lektor/builder.py", line 1062, in prune
    for aft in build_state.iter_unreferenced_artifacts(all=all):
  File "/Users/item4/Projects/lektor/lektor/builder.py", 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.
@haseenapa

This comment has been minimized.

haseenapa commented Oct 9, 2016

I have edited /Users/item4/Projects/lektor/lektor/builder.py 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 : http://hakanu.net/sql/2015/08/25/sqlite-unicode-string-problem/

@keikoro

This comment has been minimized.

keikoro commented Mar 11, 2017

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

@keikoro

This comment has been minimized.

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