Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pyopencl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Klöckner
pyopencl
Commits
fae41617
Commit
fae41617
authored
10 years ago
by
Bruce Merry
Browse files
Options
Downloads
Patches
Plain Diff
Use appdirs module to get appropriate cache directory.
This fixes an insecure temporary file creation bug on UNIX-like systems.
parent
4608e164
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pyopencl/cache.py
+5
-6
5 additions, 6 deletions
pyopencl/cache.py
setup.py
+1
-0
1 addition, 0 deletions
setup.py
with
6 additions
and
6 deletions
pyopencl/cache.py
+
5
−
6
View file @
fae41617
...
...
@@ -337,16 +337,15 @@ def _create_built_program_from_source_cached(ctx, src, options, devices, cache_d
option_idx
+=
1
if
cache_dir
is
None
:
from
tempfile
import
gettempdir
import
getpass
cache_dir
=
join
(
gettempdir
(),
"
pyopencl-compiler-cache-v2-uid%s-py%s
"
%
(
getpass
.
getuser
(),
"
.
"
.
join
(
str
(
i
)
for
i
in
sys
.
version_info
)))
import
appdirs
cache_dir
=
join
(
appdirs
.
user_cache_dir
(
"
pyopencl
"
,
"
pyopencl
"
),
"
pyopencl-compiler-cache-v2-py%s
"
%
(
"
.
"
.
join
(
str
(
i
)
for
i
in
sys
.
version_info
),))
# {{{ ensure cache directory exists
try
:
os
.
m
k
dir
(
cache_dir
)
os
.
m
ake
dir
s
(
cache_dir
)
except
OSError
,
e
:
from
errno
import
EEXIST
if
e
.
errno
!=
EEXIST
:
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
0
View file @
fae41617
...
...
@@ -208,6 +208,7 @@ def main():
"
pytools>=2014.2
"
,
"
pytest>=2
"
,
"
decorator>=3.2.0
"
,
"
appdirs>=1.4.0
"
,
# "Mako>=0.3.6",
],
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment