Skip to content

quit() raises an error in KLayout Python Console (0.28.14) #1565

@Kazzz-S

Description

@Kazzz-S

I'm making KLayout 0.28.14 DMGs for MacOS as usual.

HW*.dmg packages for MacOS include the start-console.py script which starts the KLayout executable as a Python console interpreter. In the Mac environment, this is used to install various Python modules with the pip command.
If the console terminal is terminated with the quit() command, an error occurs

ERROR: Unexpected text after numeric value: '...None'.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

which was not present in 0.28.13 (and earlier).


After installing "HW-klayout-0.28.14-macOS-Monterey-1-qt5Brew-RsysPhb311.dmg":

MacBookPro2{sekigawa} MacOS (1)% ./start-console.py
Python 3.11.6 (main, Nov  2 2023, 04:51:19) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(KLayout Python Console)
>>> import pip
>>> pip.main( ['list'] )
WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.
Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.
To avoid this problem you can invoke Python with '-m pip' instead of running pip directly.
Package         Version
--------------- ------------
contourpy       1.2.0
cycler          0.12.1
fonttools       4.46.0
kiwisolver      1.4.5
matplotlib      3.8.2
numpy           1.26.2
packaging       23.2
pandas          2.1.4
Pillow          10.1.0
pip             23.3.1
pyparsing       3.1.1
python-dateutil 2.8.2
pytz            2023.3.post1
scipy           1.11.4
setuptools      69.0.2
six             1.16.0
tzdata          2023.3
wheel           0.42.0
0
>>> quit()
ERROR: Unexpected text after numeric value: '...None'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The pip commands ran successfully. So the problem is not serious.
Also note that sys.exit(0) does not raise any error flags, as shown below.

MacBookPro2{sekigawa} MacOS (2)% ./start-console.py
Python 3.11.6 (main, Nov  2 2023, 04:51:19) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(KLayout Python Console)
>>> sys.exit(0)
MacBookPro2{sekigawa} MacOS (3)%

The same symptoms are observed in "HW-klayout-0.28.14-macOS-[Ventura|Sonoma(yet to make)]-1-qt5Brew-RsysPhb311.dmg".

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions