I have a script that recollect data and insert in a dictionary. I use the same script in different vm's and just works in one of them.
The dict is like that:
{'data1': {'/home/data1': 273}, 'data2': {'/home/data2': 2}, 'data3': {'/home/data3': 10}, 'data4': {'/home/data4': 1}}
And i should order by the value of the numbers, so i should have the next dict:
{'data1': {'/home/data1': 273},'data3': {'/home/data3': 10}, 'data2': {'/home/data2': 2},'data4': {'/home/data4': 1}}
he code of the sorted dict is like that:
directorios = sorted(dicta.items(), key=lambda x: [int(x) for x in x[1].values()], reverse = True)
The curious thing is that using the same script and getting the same dictionary but with different values in different virtual machines, in one of them i get the script works and the dictionary its perfectly sorted but in the other one i get the next error:
directorios = sorted(dicta.items(), key=lambda x: [int(x) for x in x[1].values()], reverse = True)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
Both VM's have the same Python Version. Any ideas?