kronenthaler/mod-pbxproj

[BUG] This one project loads but doesn't save

Closed this issue · 2 comments

Describe the bug
I have a project file (attached) that can be loaded, but when saved errors out with a backtrace.

System information

  1. pbxproj version used: 3.4.0
  2. python version used: 3.9.13
  3. Xcode version used: 13.4.1 (13F100)

To Reproduce
Steps to reproduce the behavior:

  1. Download the project file and test.py and unzip into a directory: test.zip

  2. python3 test.py

  3. See error:

% python3 test.py
Traceback (most recent call last):
  File "/Users/tobynelson/Code/InformAppTESTING/Inform/zoom/ZoomCocoa.xcodeproj/test.py", line 4, in <module>
    project.save()
  File "/usr/local/lib/python3.9/site-packages/pbxproj/XcodeProject.py", line 56, in save
    file.write(self.__repr__() + "\n")
  File "/usr/local/lib/python3.9/site-packages/pbxproj/XcodeProject.py", line 65, in __repr__
    return '// !$*UTF8*$!\n' + super(XcodeProject, self).__repr__()
  File "/usr/local/lib/python3.9/site-packages/pbxproj/PBXGenericObject.py", line 75, in __repr__
    return self._print_object()
  File "/usr/local/lib/python3.9/site-packages/pbxproj/PBXGenericObject.py", line 80, in _print_object
    value = self._format(self[key], indent_depth, entry_separator, object_start,
  File "/usr/local/lib/python3.9/site-packages/pbxproj/PBXGenericObject.py", line 101, in _format
    value = value._print_object(indentation_depth + indentation_increment,
  File "/usr/local/lib/python3.9/site-packages/pbxproj/PBXObjects.py", line 45, in _print_object
    obj = value._print_object(indent_depth + '\t', entry_separator, object_start,
  File "/usr/local/lib/python3.9/site-packages/pbxproj/PBXGenericObject.py", line 80, in _print_object
    value = self._format(self[key], indent_depth, entry_separator, object_start,
  File "/usr/local/lib/python3.9/site-packages/pbxproj/PBXGenericObject.py", line 111, in _format
    value = value.__repr__()
  File "/usr/local/lib/python3.9/site-packages/pbxproj/PBXKey.py", line 8, in __repr__
    comment = self._get_comment()
  File "/usr/local/lib/python3.9/site-packages/pbxproj/PBXKey.py", line 20, in _get_comment
    return self.get_parent()._resolve_comment(self)
  File "/usr/local/lib/python3.9/site-packages/pbxproj/PBXGenericObject.py", line 162, in _resolve_comment
    return parent._resolve_comment(key)
  File "/usr/local/lib/python3.9/site-packages/pbxproj/PBXGenericObject.py", line 162, in _resolve_comment
    return parent._resolve_comment(key)
  File "/usr/local/lib/python3.9/site-packages/pbxproj/PBXGenericObject.py", line 157, in _resolve_comment
    return self[key]._get_comment()
  File "/usr/local/lib/python3.9/site-packages/pbxproj/pbxsections/XCConfigurationList.py", line 6, in _get_comment
    info = self._get_section()
  File "/usr/local/lib/python3.9/site-packages/pbxproj/pbxsections/XCConfigurationList.py", line 18, in _get_section
    project = projects.__next__()
StopIteration

Expected behavior
The project file should be written without any change.

This issue has become stale, the required information has not been provided and it is been marked for closure in the next 10 days

That's a disappointing response.