Skip to content

Commit 1a0dd5a

Browse files
authored
[libc++] Avoid duplicate LWGXYZ prefixes in status tables (#148874)
When synchronizing the status tables with Github issues, we use the title of the Github issue as the name of the paper in the status table. However, the Github issue titles are prefixed with PXYZ or LWGXYZ (which is useful to quickly find papers), and that is redundant in the context of status tables. This patch ensures that we don't add that redundant PXYZ or LWGXYZ prefix. As a drive-by, also specify the encoding for opening files explicitly, which fixes issues on Windows.
1 parent 5d3b057 commit 1a0dd5a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libcxx/utils/synchronize_csv_status_files.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def from_github_issue(issue: Dict):# -> PaperInfo:
231231

232232
return PaperInfo(
233233
paper_number=paper,
234-
paper_name=issue['title'],
234+
paper_name=issue['title'].removeprefix(paper + ': '),
235235
status=PaperStatus.from_github_issue(issue),
236236
meeting=issue.get('meeting Voted', None),
237237
first_released_version=None, # TODO
@@ -269,14 +269,14 @@ def merge(paper: PaperInfo, gh: PaperInfo) -> PaperInfo:
269269

270270
def load_csv(file: pathlib.Path) -> List[Tuple]:
271271
rows = []
272-
with open(file, newline='') as f:
272+
with open(file, newline='', encoding='utf-8') as f:
273273
reader = csv.reader(f, delimiter=',')
274274
for row in reader:
275275
rows.append(row)
276276
return rows
277277

278278
def write_csv(output: pathlib.Path, rows: List[Tuple]):
279-
with open(output, 'w', newline='') as f:
279+
with open(output, 'w', newline='', encoding='utf-8') as f:
280280
writer = csv.writer(f, quoting=csv.QUOTE_ALL, lineterminator='\n')
281281
for row in rows:
282282
writer.writerow(row)
@@ -417,7 +417,7 @@ def main(argv):
417417
# Load all the Github issues tracking papers from Github.
418418
if args.load_github_from:
419419
print(f"Loading all issues from {args.load_github_from}")
420-
with open(args.load_github_from, 'r') as f:
420+
with open(args.load_github_from, 'r', encoding='utf-8') as f:
421421
project_info = json.load(f)
422422
else:
423423
print("Loading all issues from Github")

0 commit comments

Comments
 (0)