View Issue Details

IDProjectCategoryView StatusLast Update
0002513FreeCADBugpublic2016-05-11 08:22
ReporterDrInequality Assigned Towmayer  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformamd64OSLinuxOS VersionUbuntu
Product Version0.15 
Fixed in Version0.17 
Summary0002513: No write permission for new file (python)
DescriptionFails to create a new file in the current working directory. Works for any relative or absolute path.

Output is:
FreeCAD 0.16, Libs: 0.16R6700 (Git)
...
Reading STEP file......
Traceback (most recent call last):
  File "xform.py", line 14, in <module>
    Mesh.export(o, 'out.stl')
RuntimeError: No write permission for file: out.stl
Steps To ReproduceThis python script:

import sys
sys.path.append('/usr/lib/freecad/lib/')
import FreeCAD
import Import
import Part
import Mesh


Part.open('in.stp')
o = [ FreeCAD.getDocument("Unnamed").findObjects()[0] ]
Mesh.export(o, 'out.stl')

run with an appropriate in.stp in the current working directory
Additional InformationLooks like it tries to access() the file, which fails and then it makes no attempt whatsoever to
open() the file for writing
TagsNo tags attached.
FreeCAD Information

Activities

ezzieyguywuf

2016-05-07 22:34

developer   ~0007069

I can confirm that this issue exists. I will work on fixing it.

ezzieyguywuf

2016-05-08 23:18

developer   ~0007071

I have a fix and have submitted a pull request: https://github.com/ezzieyguywuf/FreeCAD-1

Related Changesets

FreeCAD: master 4ebb62be

2016-05-09 01:07:23

Wolfgang E. Sanyer


Committer: wmayer Details Diff
Fixed bug ID0002513, where Mesh.export failed.

The failure occered when Mesh.export was passed just a filename, such as 'out.stl'. If
'/some/path/out.stl' was passed it succeeded.
Affected Issues
0002513
mod - src/Base/FileInfo.cpp Diff File
mod - src/Mod/Mesh/App/Core/MeshIO.cpp Diff File

FreeCAD: master f3a5deec

2016-05-10 22:47:14

wmayer

Details Diff
+ on Windows use the unicode version to get cwd
+ on other platforms use getcwd in a platform independent way
Affected Issues
0002513
mod - src/Base/FileInfo.cpp Diff File

FreeCAD: master d7d347b2

2016-05-11 09:24:29

wmayer

Details Diff
+ if getcwd fails then use '.' Affected Issues
0002513
mod - src/Base/FileInfo.cpp Diff File

Issue History

Date Modified Username Field Change
2016-04-17 12:05 DrInequality New Issue
2016-05-07 22:34 ezzieyguywuf Note Added: 0007069
2016-05-08 23:18 ezzieyguywuf Note Added: 0007071
2016-05-11 08:21 wmayer Changeset attached => FreeCAD Master master 4ebb62be
2016-05-11 08:21 wmayer Changeset attached => FreeCAD Master master f3a5deec
2016-05-11 08:21 wmayer Changeset attached => FreeCAD Master master d7d347b2
2016-05-11 08:22 wmayer Status new => closed
2016-05-11 08:22 wmayer Assigned To => wmayer
2016-05-11 08:22 wmayer Resolution open => fixed
2016-05-11 08:22 wmayer Fixed in Version => 0.17