DB backup utility doesn't handle unicode output from iterdump
See original GitHub issueObserved 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:
- Created 6 years ago
- Comments:15 (15 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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 runningkolibri manage dbbackup
Fixed in #2955