[issue22966] py_compile: foo.bar.py → __pycache__/foo.cpython-34.pyc

Matthias Klose report at bugs.python.org
Mon Dec 1 17:06:05 CET 2014


Matthias Klose added the comment:

proposed patch:

diff -r 8dacb1a21793 Lib/importlib/_bootstrap.py
--- a/Lib/importlib/_bootstrap.py	Fri Nov 28 13:15:41 2014 +0100
+++ b/Lib/importlib/_bootstrap.py	Mon Dec 01 17:05:00 2014 +0100
@@ -453,7 +453,7 @@
     else:
         suffixes = OPTIMIZED_BYTECODE_SUFFIXES
     head, tail = _path_split(path)
-    base_filename, sep, _ = tail.partition('.')
+    base_filename, sep, _ = tail.rpartition('.')
     tag = sys.implementation.cache_tag
     if tag is None:
         raise NotImplementedError('sys.implementation.cache_tag is None')

----------
stage: test needed -> patch review

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22966>
_______________________________________


More information about the Python-bugs-list mailing list