(profile_path)
| 149 | from collections import defaultdict |
| 150 | |
| 151 | def open_picture(profile_path): |
| 152 | try: |
| 153 | return open(profile_path, "a+b") |
| 154 | except OSError: |
| 155 | print(f"Failed to open path {profile_path}") |
| 156 | raise |
| 157 | |
| 158 | pictures = defaultdict(open_picture) |
| 159 | handle = pictures[path] |