Tests fail in Python 3 with non UTF-8 locale

Bug #1196754 reported by Barry Warsaw
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
configglue
Fix Released
Low
Ricardo Kirkner

Bug Description

$ LC_ALL='POSIX' python3 setup.py test

This fails the test_save_config_non_ascii test. This is important because I'm adding support to the Debian packaging for Python 3 and in an sbuild environment, the tests are run in the POSIX locale.

Related branches

Revision history for this message
Barry Warsaw (barry) wrote :

======================================================================
ERROR: test_save_config_non_ascii (configglue.tests.test_parser.TestSchemaConfigParser)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/barry/projects/ubuntu/configglue/configglue-1.1.0/configglue/tests/test_parser.py", line 1005, in test_save_config_non_ascii
    self._check_save_file(expected)
  File "/home/barry/projects/ubuntu/configglue/configglue-1.1.0/configglue/tests/test_parser.py", line 1015, in _check_save_file
    self.parser.save(open(filename, 'w'))
  File "/home/barry/projects/ubuntu/configglue/configglue-1.1.0/configglue/parser.py", line 599, in save
    self.write(fp)
  File "/home/barry/projects/ubuntu/configglue/configglue-1.1.0/configglue/parser.py", line 584, in write
    fp.write("%s\n" % (key))
UnicodeEncodeError: 'ascii' codec can't encode character '\xf3' in position 7: ordinal not in range(128)

Dave Morley (davmor2)
Changed in configglue:
assignee: nobody → Ricardo Kirkner (ricardokirkner)
status: New → Confirmed
importance: Undecided → Low
tags: added: u1-by-dev u1-on-production
Changed in configglue:
status: Confirmed → In Progress
Changed in configglue:
status: In Progress → Fix Committed
Changed in configglue:
status: Fix Committed → Fix Released
Changed in configglue:
milestone: none → 1.1.1
Dave Morley (davmor2)
tags: added: u1-notrack
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.