question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DB backup utility doesn't handle unicode output from iterdump

See original GitHub issue

Observed behavior

When running kolibri, if database backup runs, it returns an error saying that charmap codec cannot encode character ‘\u259’.

Expected behavior

Backup should be created without errors

User-facing consequences

Could prevent a usable backup from being created

Errors and logs

Command Line:

Traceback (most recent call last):
  File "C:\Users\alanc\AppData\Local\Programs\Python\Python35\Lib\runpy.py", lin
e 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\alanc\AppData\Local\Programs\Python\Python35\Lib\runpy.py", lin
e 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\alanc\Kolibri\kolibri\kolibri\__main__.py", line 8, in <module>
    main(args=sys.argv[1:])
  File "C:\Users\alanc\Kolibri\kolibri\kolibri\utils\cli.py", line 632, in main
    initialize(debug=debug)
  File "C:\Users\alanc\Kolibri\kolibri\kolibri\utils\cli.py", line 200, in initi
alize
    backup = dbbackup(version)
  File "C:\Users\alanc\Kolibri\kolibri\kolibri\core\deviceadmin\utils.py", line
90, in dbbackup
    f.write(line)
  File "C:\Users\alanc\AppData\Local\Programs\Python\Python35\Lib\encodings\cp12
52.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u0259' in position
104: character maps to <undefined>

Steps to reproduce

Run yarn install and/or yarn run devserver on Windows 10 through Git bash.

Context

  • Kolibri version: develop
  • Operating system: Windows 10
  • Browser: NA

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
benjaomingcommented, Dec 23, 2017

@radinamatic beware that these are two different errors both caused by the cp1252 encoding on Windows.

The one with dbbackup/dbrestore can only be provoked either by changing versions so dbbackup is invoked automatically, or you can test it manually by running kolibri manage dbbackup

0reactions
benjaomingcommented, Jan 12, 2018

Fixed in #2955

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use unicode character format to import & export data - SQL ...
The Unicode character data format allows data to be exported from a SQL Server instance by using a code page that differs from...
Read more >
MySQL "incorrect string value" error when save unicode string ...
The failed values listed above can be updated into PostgreSQL table when I switched the database backend in Django. It's strange. mysql> SHOW...
Read more >
sqlite3 — DB-API 2.0 interface for SQLite databases — Python ...
Tutorial teaches how to use the sqlite3 module. Reference describes the classes and functions this module defines. How-to guides details how to handle...
Read more >
Dogwrap doesn't support unicode characters #371 - GitHub
The dogwrap python script fails completely when there is a unicode character output as described above. This is extremely problematic because it ...
Read more >
Manage Unicode Characters in Data Using T-SQL - SQLShack
In this article, we'll give some valuable information on how to use Unicode in SQL Server and various problems that arise from the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found