[Buildroot] scanpypi tool python error - local variable 'download' referenced before assignment

Yegor Yefremov yegorslists at googlemail.com
Wed Jun 13 07:40:33 UTC 2018


On Fri, Jun 8, 2018 at 7:25 AM, Yegor Yefremov
<yegorslists at googlemail.com> wrote:
> Hi all,
>
> On Thu, Jun 7, 2018 at 11:16 PM, Arnout Vandecappelle <arnout at mind.be> wrote:
>>
>>
>> On 06-06-18 17:29, Jaap Crezee wrote:
>>> Hi all,
>>>
>>>
>>> Is this a known issue?
>>>
>>> [jaap at jaap /data/work/htc/git/buildroot_development ]$ git log -1
>>> commit f3d114a1effd8a6ef773bee14fe49ea6d8d7c350 (HEAD, tag: 2018.05)
>>> Author: Peter Korsgaard <peter at korsgaard.com>
>>> Date:   Fri Jun 1 22:22:57 2018 +0200
>>>
>>>     Update for 2018.05
>>>
>>>     Signed-off-by: Peter Korsgaard <peter at korsgaard.com>
>>> [jaap at jaap /data/work/htc/git/buildroot_development ]$ ./utils/scanpypi azure-iothub-device-client
>>> buildroot package name for azure-iothub-device-client: python-azure-iothub-device-client
>>> Package: python-azure-iothub-device-client
>>> Fetching package azure-iothub-device-client
>>> Traceback (most recent call last):
>>>   File "./utils/scanpypi", line 716, in <module>
>>>     main()
>>>   File "./utils/scanpypi", line 648, in main
>>>     package.download_package()
>>>   File "./utils/scanpypi", line 217, in download_package
>>>     if download.__class__ == six.moves.urllib.error.HTTPError:
>>> UnboundLocalError: local variable 'download' referenced before assignment
>>> [jaap at jaap /data/work/htc/git/buildroot_development ]$
>>
>>  This happens because the metadata doesn't contain urls.
>>
>>  scanpypi is not at all robust against unexpected metadata contents. I think we
>> should add some exception handling there that just prints the metadata (or the
>> relevant parts of it), and continues with other packages (in case it's a
>> dependency of the package that was requested).
>>
>>  Yegor?
>
> I'll take care about this.

This is very strange package and it is distributed only as binary
Wheel file. I've reworked the error handling and now the error says,
the package doesn't provide a source archive.

If you still want to add this package, you'll have to treat it as
CMake package.See [1]

[1] https://github.com/Azure/azure-iot-sdk-python/tree/master/device/iothub_client_python

Yegor



More information about the buildroot mailing list