~ubuntu-branches/ubuntu/utopic/command-not-found/utopic

« back to all changes in this revision

Viewing changes to command-not-found

  • Committer: Package Import Robot
  • Author(s): Dimitri John Ledkov, Anthony Wong
  • Date: 2014-03-21 12:04:22 UTC
  • Revision ID: package-import@ubuntu.com-20140321120422-ne89bum3sas5pbbi
Tags: 0.3ubuntu10

[ Anthony Wong ] 
Fix locale.Error: unsupported locale setting bug (LP: #1029204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
    if sys.version < '3':
38
38
        kwargs["unicode"] = True
39
39
    cnf.install(**kwargs)
40
 
    locale.setlocale(locale.LC_ALL, '')
 
40
    try:
 
41
        locale.setlocale(locale.LC_ALL, '')
 
42
    except locale.Error:
 
43
        locale.setlocale(locale.LC_ALL, 'C')
41
44
 
42
45
 
43
46
def fix_sys_argv(encoding=None):