save on windows 7 fails permissions check

Bug #495552 reported by foundation
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fractal Fr0st
Fix Released
High
Vitor Bosshard

Bug Description

When you go to save a flame fractal (generated by the random batch script) if you just hit save, you get an error (see error trace below). If you do save as the path says parameters/random_batch, but if you hit browse the default folder is C:\Program Files (x86)\fr0st\parameters

Since windows 7 requires UAC to temporarily have administrator privileges to write to the program files directory, I am guessing the error message below is failing because of ability to write to program files. (which you also get if you save as with default, or save as browse and leave the folder in program files)

I would suggest that the default should be the parameters folder created in the users directory for the initial save, and after that the default file should be the previously saved file (yes even for save as, since you are saving a flame to a file, rather than saving a whole file)

Error:
Traceback (most recent call last):
  File "fr0stlib\gui\__init__.pyc", line 476, in OnFlameSaveAs
  File "fr0stlib\gui\__init__.pyc", line 419, in OnFlameNew2
  File "fr0stlib\gui\__init__.pyc", line 624, in SaveFlame
  File "fr0stlib\__init__.pyc", line 989, in save_flames
IOError: [Errno 13] Permission denied: 'parameters/random_batch.flame'

Platform: win32

Config:
{'Bits': 0,
 'Edit-Post-Xform': False,
 'Gradient-Settings': {'hue': (0, 1),
                       'nodes': (4, 6),
                       'saturation': (0, 1),
                       'value': (0.25, 1)},
 'Img-Dir': u'C:\\Users\\bryn\\Documents\\fr0st\\renders',
 'Img-Type': u'.png',
 'Large-Preview-Settings': {'estimator': 0,
                            'filter_radius': 0.75,
                            'quality': 25,
                            'spatial_oversample': 2},
 'Lock-Axes': False,
 'Preview-Settings': {'estimator': 0, 'filter_radius': 0, 'quality': 5},
 'Rect-Editor': None,
 'Rect-Main': None,
 'Rect-Preview': None,
 'Render-Settings': {'buffer_depth': 33,
                     'earlyclip': True,
                     'estimator': 9.0,
                     'estimator_curve': 0.40000000000000002,
                     'estimator_minimum': 0.0,
                     'filter_kernel': 0,
                     'filter_radius': 0.20000000000000001,
                     'nthreads': 0,
                     'quality': 5000,
                     'spatial_oversample': 2,
                     'transparent': False},
 'Var-Preview-Settings': {'depth': 1, 'numvals': 20, 'range': 2},
 'Variation-Preview': False,
 'World-Pivot': True,
 'active-vars': ('linear',
                 'sinusoidal',
                 'spherical',
                 'swirl',
                 'horseshoe',
                 'polar',
                 'handkerchief',
                 'heart',
                 'disc',
                 'spiral',
                 'hyperbolic',
                 'diamond',
                 'ex',
                 'julia',
                 'bent',
                 'waves',
                 'fisheye',
                 'popcorn',
                 'exponential',
                 'power',
                 'cosine',
                 'rings',
                 'fan',
                 'blob',
                 'pdj',
                 'fan2',
                 'rings2',
                 'eyefish',
                 'bubble',
                 'cylinder',
                 'perspective',
                 'noise',
                 'julian',
                 'juliascope',
                 'blur',
                 'gaussian_blur',
                 'radial_blur',
                 'pie',
                 'ngon',
                 'curl',
                 'rectangles',
                 'arch',
                 'tangent',
                 'square',
                 'rays',
                 'blade',
                 'secant2',
                 'twintrian',
                 'cross',
                 'disc2',
                 'super_shape',
                 'flower',
                 'conic',
                 'parabola',
                 'bent2',
                 'bipolar',
                 'boarders',
                 'butterfly',
                 'cell',
                 'cpow',
                 'curve',
                 'edisc',
                 'elliptic',
                 'escher',
                 'foci',
                 'lazysusan',
                 'loonie',
                 'pre_blur',
                 'modulus',
                 'oscilloscope',
                 'polar2',
                 'popcorn2',
                 'scry',
                 'separation',
                 'split',
                 'splits',
                 'stripes',
                 'wedge',
                 'wedge_julia',
                 'wedge_sph',
                 'whorl',
                 'waves2',
                 'exp',
                 'log',
                 'sin',
                 'cos',
                 'tan',
                 'sec',
                 'csc',
                 'cot',
                 'sinh',
                 'cosh',
                 'tanh',
                 'sech',
                 'csch',
                 'coth',
                 'auger'),
 'flamepath': 'samples.flame',
 'renderer': 'flam3'}

Flame Path:
'parameters/random_batch.flame'

UserParametersDir: C:\Users\bryn\Documents\fr0st\parameters
RendersDir: C:\Users\bryn\Documents\fr0st\renders
UserScriptsDir: C:\Users\bryn\Documents\fr0st\scripts
ConfigDir: C:\Users\bryn\Documents\fr0st
Frozen: True
AppBaseDir: C:\Program Files (x86)\fr0st
IconsDir: C:\Program Files (x86)\fr0st\icons

Revision history for this message
Vitor Bosshard (algorias) wrote :

It looks like there are 2 problems here:

1) The app is not checking if a save path is legal. Fr0st should just refuse to save, but it tries anyway and causes an exception.

2) The path of the parameters dir is not correctly found on windows 7.

Could you please test the following:

-Does it work when you manually change the path to a folder where you *do* have write access?

-Does it work when you just start fr0st and try saving one of the default flames? What path is shown in the dialog in that case?

Changed in fr0st:
importance: Undecided → High
assignee: nobody → Vitor Bosshard (algorias)
milestone: none → 1.0.0beta2
status: New → Incomplete
Revision history for this message
foundation (brynf) wrote :

If I just start fr0st and try to save one of the default ones, it saves it to c:\users\bryn\my documents\fr0st\parameters but I don't know if that is because I had already saved one of the defaults and thus changed the default.

the random batch shows in the dialog for the path to where it is going to save "parameters/random_batch" where as the default ones show the full c:\blahblahblah

Re: just manually changing path (assuming you mean click browse and select a folder) of a random batch, yeah I was able to save flames to a flame file in the above my docs folder.

Revision history for this message
Vitor Bosshard (algorias) wrote :

Ok, this is a problem with the random batch script specifically. If you replace "parameters/random_batch.flame" with just "random_batch.flame", it will give you an absolute path that works correctly.

There is currently an issue with the save_flames function, which it doesn't handle paths very well at all. This will be fixed for version 1.1

Therefore, problem 1) remains valid, while 2) is specific to this one script.

Changed in fr0st:
status: Incomplete → Confirmed
milestone: 1.0.0beta2 → none
Revision history for this message
Bobby R. Ward (bobbyrward) wrote :

I just got Win7 installed. I can take a look at this as I have time if you'd like.

Revision history for this message
Vitor Bosshard (algorias) wrote : Re: [Bug 495552] Re: save on windows 7 fails permissions check

I recently committed some changes to pathing (the save_flames
function, specifically) that should take care of this problem. No
paths receive any special treatment anymore, they're just calculated
relative to the fr0st user dir (which is defined as the cwd). Please
test current behaviour thoroughly before (and if) you make any
changes.

Changed in fr0st:
milestone: none → 1.1.0beta
Revision history for this message
Vitor Bosshard (algorias) wrote :

With the latest changes (r854) all paths are checked before saving occurs. This addresses point 1 of the bug, which was keeping it open.

Changed in fr0st:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.