{"action":"created","issue":{"url":"https://api.github.com/repos/hhatto/autopep8/issues/175","labels_url":"https://api.github.com/repos/hhatto/autopep8/issues/175/labels{/name}","comments_url":"https://api.github.com/repos/hhatto/autopep8/issues/175/comments","events_url":"https://api.github.com/repos/hhatto/autopep8/issues/175/events","html_url":"https://github.com/hhatto/autopep8/issues/175","id":47218889,"number":175,"title":"aggressive + line range not (re)indenting correctly","user":{"login":"hayd","id":1931852,"avatar_url":"https://avatars.githubusercontent.com/u/1931852?v=3","gravatar_id":"","url":"https://api.github.com/users/hayd","html_url":"https://github.com/hayd","followers_url":"https://api.github.com/users/hayd/followers","following_url":"https://api.github.com/users/hayd/following{/other_user}","gists_url":"https://api.github.com/users/hayd/gists{/gist_id}","starred_url":"https://api.github.com/users/hayd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hayd/subscriptions","organizations_url":"https://api.github.com/users/hayd/orgs","repos_url":"https://api.github.com/users/hayd/repos","events_url":"https://api.github.com/users/hayd/events{/privacy}","received_events_url":"https://api.github.com/users/hayd/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hhatto/autopep8/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2014-10-29T23:56:26Z","updated_at":"2015-03-28T02:23:13Z","closed_at":"2015-03-27T21:29:09Z","body":"Promoting [this](https://github.com/hhatto/autopep8/pull/172#issuecomment-59611739) to an issue.\r\n```shell\r\n$ /Users/myint/projects/autopep8/autopep8.py --max-line-length=79 --ignore= /opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/inspect.py --aggressive --aggressive --aggressive --aggressive --range 550 610 -d\r\n```\r\n```diff\r\n--- original//opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/inspect.py\r\n+++ fixed//opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/inspect.py\r\n@@ -547,56 +547,63 @@\r\n     filename = os.path.basename(path)\r\n     suffixes = [(-len(suffix), suffix, mode, mtype)\r\n                     for suffix, mode, mtype in imp.get_suffixes()]\r\n-    suffixes.sort() # try longest suffixes first, in case they overlap\r\n+    suffixes.sort()  # try longest suffixes first, in case they overlap\r\n     for neglen, suffix, mode, mtype in suffixes:\r\n         if filename[neglen:] == suffix:\r\n             return ModuleInfo(filename[:neglen], suffix, mode, mtype)\r\n+\r\n\r\n def getmodulename(path):\r\n     \"\"\"Return the module name for a given file, or None.\"\"\"\r\n     fname = os.path.basename(path)\r\n     # Check for paths that look like an actual module file\r\n-    suffixes = [(-len(suffix), suffix)\r\n-                    for suffix in importlib.machinery.all_suffixes()]\r\n-    suffixes.sort() # try longest suffixes first, in case they overlap\r\n+    suffixes = sorted([(-len(suffix), suffix)\r\n+                       for suffix in importlib.machinery.all_suffixes()])\r\n     for neglen, suffix in suffixes:\r\n         if fname.endswith(suffix):\r\n             return fname[:neglen]\r\n     return None\r\n\r\n+\r\n def getsourcefile(object):\r\n     \"\"\"Return the filename that can be used to locate an object's source.\r\n     Return None if no way can be identified to get the source.\r\n-    \"\"\"\r\n-    filename = getfile(object)\r\n+        \"\"\"\r\n+        filename = getfile(object)\r\n     all_bytecode_suffixes = importlib.machinery.DEBUG_BYTECODE_SUFFIXES[:]\r\n     all_bytecode_suffixes += importlib.machinery.OPTIMIZED_BYTECODE_SUFFIXES[:]\r\n     if any(filename.endswith(s) for s in all_bytecode_suffixes):\r\n         filename = (os.path.splitext(filename)[0] +\r\n                     importlib.machinery.SOURCE_SUFFIXES[0])\r\n-    elif any(filename.endswith(s) for s in\r\n+        elif any(filename.endswith(s) for s in\r\n                  importlib.machinery.EXTENSION_SUFFIXES):\r\n-        return None\r\n+            return None\r\n     if os.path.exists(filename):\r\n         return filename\r\n     # only return a non-existent filename if the module has a PEP 302 loader\r\n-    if getattr(getmodule(object, filename), '__loader__', None) is not None:\r\n+        if getattr(\r\n+                getmodule(\r\n+                    object,\r\n+                    filename),\r\n+                '__loader__',\r\n+                None) is not None:\r\n         return filename\r\n     # or it is in the linecache\r\n-    if filename in linecache.cache:\r\n+        if filename in linecache.cache:\r\n         return filename\r\n+\r\n\r\n def getabsfile(object, _filename=None):\r\n     \"\"\"Return an absolute path to the source or compiled file for an object.\r\n\r\n     The idea is for each object to have a unique origin, so this routine\r\n-    normalizes the result as much as possible.\"\"\"\r\n-    if _filename is None:\r\n-        _filename = getsourcefile(object) or getfile(object)\r\n+        normalizes the result as much as possible.\"\"\"\r\n+        if _filename is None:\r\n+            _filename = getsourcefile(object) or getfile(object)\r\n     return os.path.normcase(os.path.abspath(_filename))\r\n-\r\n-modulesbyfile = {}\r\n+    lesbyfile = {}\r\n _filesbymodname = {}\r\n+\r\n\r\n def getmodule(object, _filename=None):\r\n     \"\"\"Return the module an object was defined in, or None if not found.\"\"\"\r\n```"},"comment":{"url":"https://api.github.com/repos/hhatto/autopep8/issues/comments/87145757","html_url":"https://github.com/hhatto/autopep8/issues/175#issuecomment-87145757","issue_url":"https://api.github.com/repos/hhatto/autopep8/issues/175","id":87145757,"user":{"login":"myint","id":1235108,"avatar_url":"https://avatars.githubusercontent.com/u/1235108?v=3","gravatar_id":"","url":"https://api.github.com/users/myint","html_url":"https://github.com/myint","followers_url":"https://api.github.com/users/myint/followers","following_url":"https://api.github.com/users/myint/following{/other_user}","gists_url":"https://api.github.com/users/myint/gists{/gist_id}","starred_url":"https://api.github.com/users/myint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myint/subscriptions","organizations_url":"https://api.github.com/users/myint/orgs","repos_url":"https://api.github.com/users/myint/repos","events_url":"https://api.github.com/users/myint/events{/privacy}","received_events_url":"https://api.github.com/users/myint/received_events","type":"User","site_admin":false},"created_at":"2015-03-28T02:23:13Z","updated_at":"2015-03-28T02:23:13Z","body":"Thanks and good luck!"}}