We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 18017c6 commit 59315ccCopy full SHA for 59315cc
prometheus_client/core.py
@@ -505,7 +505,7 @@ class _MmapedDict(object):
505
Not thread safe.
506
"""
507
def __init__(self, filename, read_mode=False):
508
- self._f = open(filename, 'a+b')
+ self._f = open(filename, 'rb' if read_mode else 'a+b')
509
if os.fstat(self._f.fileno()).st_size == 0:
510
self._f.truncate(_INITIAL_MMAP_SIZE)
511
self._capacity = os.fstat(self._f.fileno()).st_size
0 commit comments