Skip to content

utils: adjust to support long paths on windows #22332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion utils/jobstats/jobstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import itertools
import json
import os
import platform
import random
import re

Expand Down Expand Up @@ -315,7 +316,13 @@ def load_stats_dir(path, select_module=[], select_stat=[],
continue
jobargs = [mg["input"], mg["triple"], mg["out"], mg["opt"]]

with open(os.path.join(root, f)) as fp:
if platform.system() == 'Windows':
p = unicode(u"\\\\?\\%s" % os.path.abspath(os.path.join(root,
f)))
else:
p = os.path.join(root, f)

with open(p) as fp:
j = json.load(fp)
dur_usec = 1
stats = dict()
Expand Down