Closed shen-qin closed 1 year ago
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
Hello @shen-qin,
Thank you for your contribution, I think the problem here is in the wait_for_analysis_completion
function that this script is using:
https://github.com/VirusTotal/vt-py/blob/d44c39a4814154e7bb774486454467c8b9db69e7/vt/client.py#L752-L761
There should only be one wait_for_analysis_completion
function, but even if we use the two, the second one should be something like this:
async def wait_for_analysis_completion(self, analysis):
return await self._wait_for_analysis_completion(analysis)
Can you modify your PR to fix this? Thank you!
Regards, Marta
Hello @mgmacias95,
Thank you for pointing that out!
I have made the relevant modifications :)
Regards, Shen Qin
I encountered
AttributeError: 'coroutine' object has no attribute 'stats'
when I was using upload_files.py. This is how I fixed the issue.Original Code:
Modified Code:
Explanation:
In the original code, the
stats
attribute is directly accessed from the coroutine objectcompleted_analysis
. However, since thecompleted_analysis
is a coroutine, it needs to be awaited to retrieve the result.Therefore I made the above modifications and this is my rationale:
completed_analysis
, we obtain the actual result of the analysis.analysis_result
before accessing thestats
attribute ofanalysis_result
This modification ensures that you correctly retrieve and access the analysis result before accessing its attributes. This change should resolve the
AttributeError: 'coroutine' object has no attribute 'stats'
and produce the desired output.