I am using Python 3.9
Basically trying to implement the code to get sha1 of file using code as per accepted answer given on below link ->
Generating one MD5/SHA1 checksum of multiple files in Python
on this link also, in accepted answer, one of expert mention to CLOSE the file but when implementing the code to close the file, its not working and giving below error. Also in the accepted code not able to implement with open.
And by below written code, just tried to check whether file opened in rb mode with .read is actually getting closed using close() or able to check whether file is automatically closed after .read using .closed(). both not working and giving error same as given below.
import os
filename = r'/home/test/test.jar'
fo = open(filename, 'rb').read()
print(f'is closed {fo.closed}')
Error: -
AttributeError: 'bytes' object has no attribute 'closed'
```python-BaseException```
Please advice.....Thanks!