Skip to content
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

VTK problems attempting to write to directories with rw- (no execute) #276

Open
durack1 opened this issue Dec 1, 2017 · 0 comments
Open
Milestone

Comments

@durack1
Copy link
Member

durack1 commented Dec 1, 2017

I've encountered a nasty error that occurs when target directories do not have execute permissions for the user.

The code below will replicate the issue:

import os,vcs,shutil,stat
import numpy as np
np.warnings.filterwarnings('ignore') ; # Turn off warnings

# Change to tmp dir
os.chdir('/export/duro/tmp')

data = np.random.rand(10,10)
x = vcs.init(bg=True,geometry=(100,100))
x.plot(data)
if os.path.exists('test'):
    shutil.rmtree('test') ; # Remove existing directory
os.mkdir('test') ; # Default perms 700
mode = stat.S_IMODE(os.stat('test').st_mode)
print mode
x.png('test/test1.png')
print 'png written'
os.chmod('test',600) # Mode from rwx to rw-
mode = stat.S_IMODE(os.stat('test').st_mode)
print mode
x.png('test/test2.png')

The error is:

ERROR: In /export/dout/miniconda2/conda-bld/vtk-cdat_1503063744037/work/IO/Image/vtkPNGWriter.cxx, line 276
vtkPNGWriter (0x2f5dcc0): Unable to open file test/test2.png                                                     

ERROR: In /export/dout/miniconda2/conda-bld/vtk-cdat_1503063744037/work/IO/Image/vtkImageWriter.cxx, line 527
vtkPNGWriter (0x2f5dcc0): Ran out of disk space; deleting file(s) already written

And leads to the directory getting garbled with very weird permissions (that require root perms to change/delete) after the error is thrown. The permissions go from

drwx------  2 duro clim 4.0K Nov 30 16:21 test

to

d--x-wx--T  2 duro clim 4.0K Nov 30 16:21 test

@doutriaux1 @danlipsa @aashish24

@durack1 durack1 changed the title Cleanup problems attempting to write to directories with rw- (no execute) Cleanup VTK problems attempting to write to directories with rw- (no execute) Dec 1, 2017
@durack1 durack1 changed the title Cleanup VTK problems attempting to write to directories with rw- (no execute) VTK problems attempting to write to directories with rw- (no execute) Dec 1, 2017
@doutriaux1 doutriaux1 added this to the Next Release milestone Mar 29, 2018
@doutriaux1 doutriaux1 modified the milestones: 8.1, 8.2 Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants