Skip to content

.dump in apsw.Shell broken on non ascii locales in windows #142

@rogerbinns

Description

@rogerbinns

From [email protected] on August 23, 2013 05:25:49

This line in command_dump() http://code.google.com/p/apsw/source/browse/tools/shell.py#1094 Uses time.strftime('%c')

This produces a locale dependent time bytestring on python 2.x. This bytestring is later co-erced to unicode here http://code.google.com/p/apsw/source/browse/tools/shell.py#2404 as unicode(text)

This fails on some windows installs, presumably installs where strftime produces a bytestring with non-ascii bytes.

The call to strftime should be changed to use a local independent time tring, perhaps:

time.ctime()

For an example of this bug in the field, see https://bugs.launchpad.net/bugs/1215819

Original issue: http://code.google.com/p/apsw/issues/detail?id=142

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions