Correct the following 2 error message, when the default.dru ist used (0.65)#14
Open
McAwesomeville wants to merge 1 commit intoNVSL:masterfrom
Open
Correct the following 2 error message, when the default.dru ist used (0.65)#14McAwesomeville wants to merge 1 commit intoNVSL:masterfrom
McAwesomeville wants to merge 1 commit intoNVSL:masterfrom
Conversation
Error message 1:
File "d:/swoop-06.5/test_library_technologies.py", line 49, in add_lbr
lbrf = Swoop.EagleFile.from_file(file)
File "c:\program files\python37\lib\site-packages\swoop-0.6.5-py3.7.egg\Swoop\Swoop.py", line 1224, in from_file
n = cls.from_stream(cls.get_library_file_type(), f, bestEffort, DRUFile, pickle, filename=filename)
File "c:\program files\python37\lib\site-packages\swoop-0.6.5-py3.7.egg\Swoop\Swoop.py", line 1184, in from_stream
ef.DRUFile = DRU.DRUFile(s)
File "c:\program files\python37\lib\site-packages\swoop-0.6.5-py3.7.egg\Swoop\DRU.py", line 20, in __init__
self.open(stream, filename=filename);
File "c:\program files\python37\lib\site-packages\swoop-0.6.5-py3.7.egg\Swoop\DRU.py", line 30, in open
m = re.match("^(\w+)(\[(\w+)\])? = (.*)$", l);
File "c:\program files\python37\lib\re.py", line 173, in match
return _compile(pattern, flags).match(string)
TypeError: cannot use a string pattern on a bytes-like object
=> Solution: Decode the file
error 2:
File "c:\program files\python37\lib\site-packages\swoop-0.6.5-py3.7.egg\Swoop\DRU.py", line 51, in open
assert m is not None, "Unknown value format in '{}': {}".format(filename,values[i])
AssertionError: Unknown value format in 'None': 0.035mm
Solution:
default.dru is encoded with windows lf. \r is not detected (this error just occurs on the last value in the line.
https://stackoverflow.com/questions/31399999/windows-newline-symbol-in-python-bytes-regex
Note that $ matches \n but does not match \r\n (the combination of carriage return and newline characters, or CR/LF). To match the CR/LF character combination, include \r?$ in the regular expression pattern.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I use Win 10 and I loaded a library in python 3.7. I got two error messages:
Error message 1:
Solution: Decode the file
Error message 2:
Solution:
default.dru is encoded with windows lf. \r is not detected (this error just occurs on the last value in the line.
Quelle: stackoverflow: $ Windows newline symbol in Python bytes regex: