What values do you get out of file.get_var what does inventory end up as? keep in mind get_var only takes a boolean true/false parameter, you should not be giving it values as an argument.
player_pos_x = file.get_var() # no value, use default for `allow_objects`