Can't delocate wheel with AttributeError after a regex returns no match in `parse_install_name`.
See original GitHub issueI’m running delocate on github actions on a osx build and it errors out with the following error:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/bin/delocate-wheel", line 8, in <module>
sys.exit(main())
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/cmd/delocate_wheel.py", line 71, in main
check_verbose=opts.verbose)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/delocating.py", line 377, in delocate_wheel
lib_filt_func, copy_filt_func)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/delocating.py", line 289, in delocate_path
return copy_recurse(lib_path, copy_filt_func, copied)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/delocating.py", line 145, in copy_recurse
_copy_required(lib_path, copy_filt_func, copied_libs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/delocating.py", line 201, in _copy_required
lib_dict = tree_libs(lib_path)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/libsana.py", line 60, in tree_libs
for install_name in get_install_names(depending_libpath):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/tools.py", line 219, in get_install_names
names = tuple(parse_install_name(line)[0] for line in lines[1:])
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/tools.py", line 219, in <genexpr>
names = tuple(parse_install_name(line)[0] for line in lines[1:])
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/delocate/tools.py", line 151, in parse_install_name
return IN_RE.match(line).groups()
AttributeError: 'NoneType' object has no attribute 'groups'
The command I’m running is delocate-wheel dist/*.whl
, and the result of ls dist/
prints ffpyplayer-4.3.2.dev0-cp36-cp36m-macosx_10_9_x86_64.whl
indicating that the file is there.
Issue Analytics
- State:
- Created 3 years ago
- Comments:21 (3 by maintainers)
Top Results From Across the Web
Regex: AttributeError: 'NoneType' object has no attribute 'groups'
You are getting AttributeError because you're calling groups on None , which hasn't any methods. regex.search returning None means the regex couldn't find ......
Read more >re — Regular expression operations — Python 3.11.1 ...
Source code: Lib/re/ This module provides regular expression matching ... these do not allow back-tracking when the expression following it fails to match....
Read more >Best Practices for Regular Expressions in .NET - Microsoft Learn
Regular expression patterns are often written to match valid input. That is, developers examine the text that they want to match and then...
Read more >[3.6.4] AttributeError: module 'regex' has no attribute 'Pattern'
Since I upgraded nltk from 3.6.2 to 3.6.4, the following code : from nltk.tokenize.casual import TweetTokenizer, casual_tokenize raises the ...
Read more >regex · PyPI
Keeps the part of the entire match after the position where \K occurred; the part before it is discarded. It does not affect...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can always build wheels for the two architectures, delocate them, and then fuse them into one wheel with the
delocate-fuse
command.That’s perfect, showing the otool output makes it clear what happened.
https://github.com/matthew-brett/delocate/blob/9c2c6a42c96b02602ce8d2059423a77e257a1a98/delocate/tools.py#L252
This code here removes only the first line which is supposed to be the “architecture” line and then doesn’t expect there to be a 2nd architecture. This seems to cause the current error.
Right now I don’t know what the correct way of handling this is supposed to be. I’d guess ignoring the separate architectures and merging the sets of libraries might work. I wasn’t able to reproduce the error so I can’t write a test for this.