Can't open saved project.

Issue #406 resolved
Андрей Б. created an issue

Can’t open saved project. Run FlatCAM → save project → close FlatCAM → open FlatCAM → open project → crush

When locale set to C (export LC_ALL=C):

date
Tue Apr 28 11:12:43 MSK 2020

flatcam_beta $ git status
On branch Beta
Your branch is up to date with 'origin/Beta'.

latcam_beta $ git pull
Already up to date.

admin1@n1-78 ~/cnc/flatcam_beta $ python3 --version
Python 3.6.10

flatcam_beta $ python3 FlatCAM.py 
[INFO][MainThread] FlatCAM Starting...
[DEBUG][MainThread] Application path is /home/admin1/cnc/flatcam_beta
[DEBUG][MainThread] Started in /home/admin1/cnc/flatcam_beta
[DEBUG][MainThread] FlatCAM defaults loaded from: current_defaults
[DEBUG][MainThread] FlatCAMGUI.__init__() --> UI state restored from QSettings.
[DEBUG][MainThread] FlatCAMGUI.__init__() --> UI layout restored from QSettings. Layout = compact
[DEBUG][MainThread] App.save_project_auto_update() --> updated the interval timeout.
[DEBUG][MainThread] App.__init__() --> Applied Russian language.
[DEBUG][MainThread] Finished Preferences GUI form initialization.
[DEBUG][MainThread] Finished creating Object Collection.
[DEBUG][MainThread] Setting up canvas: 3D
[DEBUG][MainThread] Finished Canvas initialization in 0.28430747985839844 seconds.
[DEBUG][MainThread] Finished creating Workers crew.
[DEBUG][MainThread] Finished connecting Signals.
[DEBUG][MainThread] TCL Shell has been initialized.
[DEBUG][MainThread] Tools are installed.
[DEBUG][MainThread] Recent items list has been populated.
[DEBUG] Initialization of the FlatCAM Geometry Editor is finished ...
[DEBUG][MainThread] Initialization of the FlatCAM Excellon Editor is finished ...
[DEBUG][MainThread] Initialization of the FlatCAM Gerber Editor is finished ...
[DEBUG][MainThread] Finished adding FlatCAM Editor's.
[DEBUG][MainThread] END of constructor. Releasing control.


at this moment in interface: File -> open project.


[DEBUG][MainThread] on_file_openproject()
[DEBUG][MainThread] Opening project: /home/admin1/Kicad/wifi_led/FlatCam_project.FlatPrj
[ERROR][MainThread] Failed to parse project file, trying to see if it loads as an LZMA archive: /home/admin1/Kicad/wifi_led/FlatCam_project.FlatPrj because 'ascii' codec can't decode byte 0xfd in position 0: ordinal not in range(128)
[DEBUG][MainThread] on_file_new()
WARNING: Traceback (most recent call last):
  File "/home/admin1/cnc/flatcam_beta/FlatCAMApp.py", line 9605, in on_file_openproject
    self.open_project(filename)
  File "/home/admin1/cnc/flatcam_beta/FlatCAMApp.py", line 11657, in open_project
    self.on_file_new()
  File "/home/admin1/cnc/flatcam_beta/FlatCAMApp.py", line 9374, in on_file_new
    self.init_tcl()
AttributeError: 'App' object has no attribute 'init_tcl'
Aborted

In case of locale set to LANG=ru_RU.utf8 a bit differ in line:

[ERROR][MainThread] Failed to parse project file, trying to see if it loads as an LZMA archive: /home/admin1/Kicad/wifi_led/FlatCam_project.FlatPrj because 'utf-8' codec can't decode byte 0xfd in position 0: invalid start byte

Sorry this is first bug report in my live :).

Comments (3)

  1. Marius Stanciu

    Hi,

    Ok Andrei, I guess you just encountered a bug that I’ve introduced in the past few days. I just moved that method elsewhere 🙂

    In any case, in this new version loading older FLatCAM projects may not be possible anymore (I’m not sure about this, needs to be checked). You will have to use the version 8.991 in that case.
    I will make the modification in max one hour and post the changes to the repo.

    Thanks for the report,
    Marius

  2. Marius Stanciu
    • some minor changes in the Python version detection
    • added a new Tcl Command named SetPath which will set a path to be used by the Tcl commands. Once set will serve as a fallback path in case that the files fail to be opened first time. It will be persistent, saved in preferences.
    • added the GUI for the new Open Example in the FIle -> Scripting menu.
    • I am modifying all the open ... handlers to add a parameter that will flag if the method was launched from Tcl Shell. This way if the method will fail to open the filename (which include the path) it will try to open from a set fallback path.
    • fixed issue #406, bug introduced recently (leftover changes).
    • modified the ImportSVG Tcl command name to OpenSVG (open_svg alias)
    • added a new Tcl command named OpenDXF (open_dxf alias)
    • fixed some errors in Scripting features
    • added a new Tcl command named GetPath as a convenient way to get the current default path stored in App.defaults['global_tcl_path']

    → <<cset eed7e3d62003>>

  3. Log in to comment