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
diff --git a/gitubuntu/git_repository.py b/gitubuntu/git_repository.py
index be0bab3..49ec9df 100644
--- a/gitubuntu/git_repository.py
+++ b/gitubuntu/git_repository.py
@@ -8,7 +8,6 @@ import datetime
8import enum8import enum
9from functools import lru_cache9from functools import lru_cache
10import itertools10import itertools
11import locale
12import logging11import logging
13import os12import os
14import posixpath13import posixpath
@@ -808,19 +807,6 @@ class Changelog:
808 changelog_timestamp_string,807 changelog_timestamp_string,
809 )808 )
810809
811 # Ensure that strptime will parse using the standard English names for
812 # weekdays and months. We actually want to check for C.UTF-8, but
813 # something seems to convert that to en_US.UTF-8. Either will do. It
814 # would be an improvement for this function to become
815 # locale-setting-independent, but that would mean finding some other
816 # way to reproducibly parse changelog timestamps and finding that isn't
817 # a priority right now.
818 assert any([
819 locale.getlocale(locale.LC_TIME) == ('C', 'UTF-8'),
820 locale.getlocale(locale.LC_TIME) == ('en_US', 'UTF-8'),
821 locale.getlocale(locale.LC_TIME) == (None, None)
822 ])
823
824 acceptable_date_formats = [810 acceptable_date_formats = [
825 '%a, %d %b %Y %H:%M:%S %z', # standard811 '%a, %d %b %Y %H:%M:%S %z', # standard
826 '%A, %d %b %Y %H:%M:%S %z', # full day of week812 '%A, %d %b %Y %H:%M:%S %z', # full day of week
diff --git a/gitubuntu/importer.py b/gitubuntu/importer.py
index 6a64a45..b2a9916 100644
--- a/gitubuntu/importer.py
+++ b/gitubuntu/importer.py
@@ -28,7 +28,6 @@ import argparse
28import datetime28import datetime
29import functools29import functools
30import getpass30import getpass
31import locale
32import logging31import logging
33import os32import os
34import re33import re
@@ -487,10 +486,6 @@ def main(
487 Returns 0 on successful import (which includes non-fatal failures);486 Returns 0 on successful import (which includes non-fatal failures);
488 1 otherwise.487 1 otherwise.
489 """488 """
490 # For import reproduciblity, we must use the C.UTF-8 locale to parse dates,
491 # etc.
492 locale.setlocale(locale.LC_ALL, 'C.UTF-8')
493
494 logging.info('Ubuntu Server Team importer v%s' % VERSION)489 logging.info('Ubuntu Server Team importer v%s' % VERSION)
495490
496 if not repo:491 if not repo:

Subscribers

People subscribed via source and target branches