Why does the kicad Pcbnew file show expecting '(' in line 1971, offset 1?

Why does the kicad Pcbnew file show expecting ‘(’ in line 1971, offset 1?

I already looked at some discussions about this in the forum but still can’t find a solution. Although I looked at the file in the text editor at the mentioned line,

image

This is how it looks, erasing the ‘HEAD’ also doesn’t work.
I updated its version from 7.0 to 8.0, but it still shows the same error.

Kindly give me suggestions and help me overcome this!

Why does the kicad Pcbnew file show expecting ‘(’ in line 1971, offset 1?

Because that’s exactly what happens: The file loading function of Kicad expects to find a ‘(’ character as next valid character, instead it reads the ‘<<<’ characters in line 1971.
This is unexpected, so the file is most probably corrupted. The loading of the file is aborted.

erasing the ‘HEAD’ also doesn’t work

You have probably to erase all characters from lines 1971+1972, until the next valid ‘(’ character. As we don’t know how this file corruption happened there is no guarantee that this will really help. There might be other corruptions in the file as well.

1 Like

This “corruption” is a failed merge, likely from Git.

There will be another line starting with >>>>>> farther down in the file that also has to be removed.

Be careful when using source control with KiCad files that you handle merge conflicts.

3 Likes

…seems some git mess-up on the source file.

2 Likes

Thank you @mf_ibfeew I’ve now found out that the ‘<<<<’ like unwanted commands exist in between several code lines of the pcbnew file. I’ve removed it, now I can open the file.

Yes, @craftyjon Thank you for your reply, I have tried it and it worked. As you said, I suspect this has arisen due to merging the files in GitHub.

Yes, @Claudio.Lorini . You’re right