# Path: ranger.py
# ARGV = sys.argv[1:sys.argv.index('--')] if '--' in sys.argv else sys.argv[1:]


import string
import re
import os
from io import open
from ranger import PY3
from ranger.core.shared import FileManagerAware
            else:
                real = None

            # determine if there have been changes
            if current == original and current != real:
                continue   # another ranger instance has changed the bookmark

            if key not in self.dct:
                del real_dict[key]   # the user has deleted it
            else:
                real_dict[key] = current   # the user has changed it

        self._set_dict(real_dict, original=real_dict_copy)

    def save(self):
        """Save the bookmarks to the bookmarkfile.

        This is done automatically after every modification if autosave is True.
        """
        self.update()
        if self.path is None:
            return

        path_new = self.path + '.new'
        try:
            with open(path_new, 'w', encoding="utf-8") as fobj:
                for key, value in self.dct.items():
                    if key in ALLOWED_KEYS \
                            and key not in self.nonpersistent_bookmarks:
                        key_value = "{0}:{1}\n".format(key, value)

# Path: ranger.py
# ARGV = sys.argv[1:sys.argv.index('--')] if '--' in sys.argv else sys.argv[1:]


# Path: ranger/container/bookmarks.py
import string
import re
import os
from io import open
from ranger import PY3
from ranger.core.shared import FileManagerAware

            else:
                real = None

            # determine if there have been changes
            if current == original and current != real:
                continue   # another ranger instance has changed the bookmark

            if key not in self.dct:
                del real_dict[key]   # the user has deleted it
            else:
                real_dict[key] = current   # the user has changed it

        self._set_dict(real_dict, original=real_dict_copy)

    def save(self):
        """Save the bookmarks to the bookmarkfile.

        This is done automatically after every modification if autosave is True.
        """
        self.update()
        if self.path is None:
            return

        path_new = self.path + '.new'
        try:
            with open(path_new, 'w', encoding="utf-8") as fobj:
                for key, value in self.dct.items():
                    if key in ALLOWED_KEYS \
                            and key not in self.nonpersistent_bookmarks:
                        key_value = "{0}:{1}\n".format(key, value)

                        if not PY3 and isinstance(key_value, str):