Merge ~racb/git-ubuntu:revert-locale into git-ubuntu:master

Proposed by Robie Basak
Status: Merged
Merged at revision: a8b933327e7a6afd3b6da831281783d746dad05a
Proposed branch: ~racb/git-ubuntu:revert-locale
Merge into: git-ubuntu:master
Diff against target: 55 lines (+0/-19)
2 files modified
gitubuntu/git_repository.py (+0/-14)
gitubuntu/importer.py (+0/-5)
Reviewer Review Type Date Requested Status
git-ubuntu developers Pending
Review via email: mp+390254@code.launchpad.net

Commit message

Make Jenkins happy

To post a comment you must log in.
Revision history for this message
Robie Basak (racb) wrote :

I didn't think that as a revert this needed a review, but I'm filing an MP and bug to track it as part of a larger assessment of the current state of things. I do intend to land this to master at some point.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/gitubuntu/git_repository.py b/gitubuntu/git_repository.py
2index be0bab3..49ec9df 100644
3--- a/gitubuntu/git_repository.py
4+++ b/gitubuntu/git_repository.py
5@@ -8,7 +8,6 @@ import datetime
6 import enum
7 from functools import lru_cache
8 import itertools
9-import locale
10 import logging
11 import os
12 import posixpath
13@@ -808,19 +807,6 @@ class Changelog:
14 changelog_timestamp_string,
15 )
16
17- # Ensure that strptime will parse using the standard English names for
18- # weekdays and months. We actually want to check for C.UTF-8, but
19- # something seems to convert that to en_US.UTF-8. Either will do. It
20- # would be an improvement for this function to become
21- # locale-setting-independent, but that would mean finding some other
22- # way to reproducibly parse changelog timestamps and finding that isn't
23- # a priority right now.
24- assert any([
25- locale.getlocale(locale.LC_TIME) == ('C', 'UTF-8'),
26- locale.getlocale(locale.LC_TIME) == ('en_US', 'UTF-8'),
27- locale.getlocale(locale.LC_TIME) == (None, None)
28- ])
29-
30 acceptable_date_formats = [
31 '%a, %d %b %Y %H:%M:%S %z', # standard
32 '%A, %d %b %Y %H:%M:%S %z', # full day of week
33diff --git a/gitubuntu/importer.py b/gitubuntu/importer.py
34index 6a64a45..b2a9916 100644
35--- a/gitubuntu/importer.py
36+++ b/gitubuntu/importer.py
37@@ -28,7 +28,6 @@ import argparse
38 import datetime
39 import functools
40 import getpass
41-import locale
42 import logging
43 import os
44 import re
45@@ -487,10 +486,6 @@ def main(
46 Returns 0 on successful import (which includes non-fatal failures);
47 1 otherwise.
48 """
49- # For import reproduciblity, we must use the C.UTF-8 locale to parse dates,
50- # etc.
51- locale.setlocale(locale.LC_ALL, 'C.UTF-8')
52-
53 logging.info('Ubuntu Server Team importer v%s' % VERSION)
54
55 if not repo:

Subscribers

People subscribed via source and target branches