From 7cac8787a49dc99d9a147501151a519933afc5f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Sat, 19 Mar 2022 21:21:19 +0100 Subject: [PATCH] [OpenSCAD] Avoid writing temporary parse cache file Creating the parsetab.py cache file in a system wide fixed location (e.g. /tmp/parsetab.py) creates problems when a computer is used by different users. Also the file is never removed, which is not very nice. Caching provides hardly any benefit here, as it only takes milliseconds, and may even be negated by the additional required filesystem operations. Fixes (part of) #6315. --- src/Mod/OpenSCAD/importCSG.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Mod/OpenSCAD/importCSG.py b/src/Mod/OpenSCAD/importCSG.py index aa10bd51d0..09e4cec9b4 100644 --- a/src/Mod/OpenSCAD/importCSG.py +++ b/src/Mod/OpenSCAD/importCSG.py @@ -35,7 +35,6 @@ printverbose = False import FreeCAD import io import os -import tempfile import ply.lex as lex import ply.yacc as yacc @@ -178,9 +177,9 @@ def processcsg(filename): # Build the parser if printverbose: print('Load Parser') - # No debug out otherwise Linux has protection exception - temp = tempfile.gettempdir() - parser = yacc.yacc(debug=False,outputdir=temp) + # Disable generation of debug ('parser.out') and table cache ('parsetab.py'), + # as it requires a writable location + parser = yacc.yacc(debug=False, write_tables=False) if printverbose: print('Parser Loaded') # Give the lexer some input #f=open('test.scad', 'r')