Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]Save() Error during saving the project: 'str' object has no attribute '_get_comment' #361

Open
xuwenxindeai opened this issue Nov 22, 2024 · 1 comment
Labels

Comments

@xuwenxindeai
Copy link

Describe the bug
A clear and concise description of what the bug is.

project = XcodeProject.load(kProjectFilePath)
project.save()

System information

  1. pbxproj version used: 4.1.0
  2. python version used: 3.9
  3. Xcode version used:15.4

Error during saving the project: 'str' object has no attribute '_get_comment'
Error: 'str' object has no attribute '_get_comment'
Traceback (most recent call last):
File "/Users/iospack/Desktop/BaoHeAutoPackge/script/archive.py", line 96, in _modifyProject
project.save()
File "/Users/iospack/Library/Python/3.9/lib/python/site-packages/pbxproj/XcodeProject.py", line 56, in save
file.write(self.repr() + "\n")
File "/Users/iospack/Library/Python/3.9/lib/python/site-packages/pbxproj/XcodeProject.py", line 65, in repr
return '// !$UTF8$!\n' + super(XcodeProject, self).repr()
File "/Users/iospack/Library/Python/3.9/lib/python/site-packages/pbxproj/PBXGenericObject.py", line 76, in repr
return self._print_object()
File "/Users/iospack/Library/Python/3.9/lib/python/site-packages/pbxproj/PBXGenericObject.py", line 81, in _print_object
value = self._format(self[key], indent_depth, entry_separator, object_start,
File "/Users/iospack/Library/Python/3.9/lib/python/site-packages/pbxproj/PBXGenericObject.py", line 102, in _format
value = value._print_object(indentation_depth + indentation_increment,
File "/Users/iospack/Library/Python/3.9/lib/python/site-packages/pbxproj/PBXObjects.py", line 47, in _print_object
result += f'{indent_depth}\t{value.get_id().repr()} = {obj};\n'
File "/Users/iospack/Library/Python/3.9/lib/python/site-packages/pbxproj/PBXKey.py", line 8, in repr
comment = self._get_comment()
File "/Users/iospack/Library/Python/3.9/lib/python/site-packages/pbxproj/PBXKey.py", line 20, in _get_comment
return self.get_parent()._resolve_comment(self)
File "/Users/iospack/Library/Python/3.9/lib/python/site-packages/pbxproj/PBXGenericObject.py", line 158, in _resolve_comment
return self[key]._get_comment()
File "/Users/iospack/Library/Python/3.9/lib/python/site-packages/pbxproj/pbxsections/PBXBuildFile.py", line 45, in _get_comment
comment = self.fileRef._get_comment()
AttributeError: 'str' object has no attribute '_get_comment'

@xuwenxindeai
Copy link
Author

project.pbxproj.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant