Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
0be93889
Commit
0be93889
authored
Jul 13, 2013
by
Jason R. Coombs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow other arguments and kwargs to os.open when in the sandbox. Fixes Distribute #386.
parent
fb535e22
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
CHANGES.txt
CHANGES.txt
+6
-0
setuptools/sandbox.py
setuptools/sandbox.py
+3
-3
No files found.
CHANGES.txt
View file @
0be93889
...
...
@@ -2,6 +2,12 @@
CHANGES
=======
-----
0.9.1
-----
* Distribute #386: Allow other positional and keyword arguments to os.open.
---
0.9
---
...
...
setuptools/sandbox.py
View file @
0be93889
...
...
@@ -270,11 +270,11 @@ class DirectorySandbox(AbstractSandbox):
self
.
_violation
(
operation
,
src
,
dst
,
*
args
,
**
kw
)
return
(
src
,
dst
)
def
open
(
self
,
file
,
flags
,
mode
=
0x1FF
):
# 0777
def
open
(
self
,
file
,
flags
,
mode
=
0x1FF
,
*
args
,
**
kw
):
# 0777
"""Called for low-level os.open()"""
if
flags
&
WRITE_FLAGS
and
not
self
.
_ok
(
file
):
self
.
_violation
(
"os.open"
,
file
,
flags
,
mode
)
return
_os
.
open
(
file
,
flags
,
mode
)
self
.
_violation
(
"os.open"
,
file
,
flags
,
mode
,
*
args
,
**
kw
)
return
_os
.
open
(
file
,
flags
,
mode
,
*
args
,
**
kw
)
WRITE_FLAGS
=
reduce
(
operator
.
or_
,
[
getattr
(
_os
,
a
,
0
)
for
a
in
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment