[issue21052] Consider dropping ImportWarning for empty sys.path_hooks and sys.meta_path
Masami HIRATA added the comment: Hi, I can reproduce this issue with the following steps. $ uname -a Linux ashrose 3.2.0-65-generic #99-Ubuntu SMP Fri Jul 4 21:03:29 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux $ python3.4 --version Python 3.4.1 $ touch spam.txt $ python3.4 -Wa -c class A: pass; a = open('spam.txt') sys:1: ResourceWarning: unclosed file _io.TextIOWrapper name='spam.txt' mode='r' encoding='UTF-8' _frozen_importlib:2150: ImportWarning: sys.meta_path is empty _frozen_importlib:2150: ImportWarning: sys.meta_path is empty _frozen_importlib:2150: ImportWarning: sys.meta_path is empty _frozen_importlib:2150: ImportWarning: sys.meta_path is empty _frozen_importlib:2150: ImportWarning: sys.meta_path is empty ... $ python3.4 -Wa -c a = open('spam.txt') sys:1: ResourceWarning: unclosed file _io.TextIOWrapper name='spam.txt' mode='r' encoding='UTF-8' $ python3.4 -Wa -c class A: pass; open('spam.txt') -c:1: ResourceWarning: unclosed file _io.TextIOWrapper name='spam.txt' mode='r' encoding='UTF-8' $ -- nosy: +msmhrt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21052 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21925] ResouceWarning sometimes doesn't display
New submission from Masami HIRATA: It seems that ResouceWarning about unclosed file handles with '-W all' option sometimes doesn't display. Is this behaviour normal? $ uname -a Linux ashrose 3.2.0-65-generic #99-Ubuntu SMP Fri Jul 4 21:03:29 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux $ python3.4 --version Python 3.4.1 $ touch spam.txt $ echo 'a = open(spam.txt)' test_warning.py $ $ python3.4 -W all test_warning.py $ python3.4 -W all test_warning.py sys:1: ResourceWarning: unclosed file _io.TextIOWrapper name='spam.txt' mode='r' encoding='UTF-8' $ python3.4 -W all test_warning.py sys:1: ResourceWarning: unclosed file _io.TextIOWrapper name='spam.txt' mode='r' encoding='UTF-8' $ python3.4 -W all test_warning.py $ python3.4 -W all test_warning.py $ python3.4 -W all test_warning.py $ python3.4 -W all test_warning.py $ python3.4 -W all test_warning.py sys:1: ResourceWarning: unclosed file _io.TextIOWrapper name='spam.txt' mode='r' encoding='UTF-8' $ -- components: Interpreter Core messages: 222390 nosy: msmhrt priority: normal severity: normal status: open title: ResouceWarning sometimes doesn't display type: resource usage versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21925 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21897] frame.f_locals causes segfault on Python =3.4.1
Masami HIRATA added the comment: Thanks, pitrou. Your patch seems ok to me. $ python3.4.1_with_patch -m unittest . -- Ran 1 test in 0.001s It seems that this issue is same as https://bitbucket.org/hpk42/pytest/issue/528/test-causes-segfault . -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21897 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue21897] frame.f_locals causes segfault on Python =3.4.1
New submission from Masami HIRATA: It seems that frame.f_locals causes segfault on Python =3.4.1 $ uname -a Linux ashrose 3.2.0-61-generic #93-Ubuntu SMP Fri May 2 21:31:50 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux $ ls test1.py $ cat test1.py import unittest class TestCallable(unittest.TestCase): def test_callable(self): try: with self.assertRaises(IndexError): def raise_error(): raise TypeError (lambda: raise_error())() except TypeError as exception: exception.__traceback__.tb_next.tb_frame.f_locals $ python3.4.1 -m unittest Segmentation fault $ python3.4.0 -m unittest . -- Ran 1 test in 0.001s OK $ python3.3.5 -m unittest . -- Ran 1 test in 0.000s OK $ gdb /home/python/local/3.4.1mgs/bin/python3.4.1 ... (gdb) run -m unittest Starting program: /home/python/local/3.4.1mgs/bin/python3.4.1 -m unittest [Thread debugging using libthread_db enabled] Using host libthread_db library /lib/x86_64-linux-gnu/libthread_db.so.1. Program received signal SIGSEGV, Segmentation fault. map_to_dict (deref=1, values=0x75e97510, dict=0x75e8f588, nmap=optimized out, map=0x760e0278) at Objects/frameobject.c:791 791 value = PyCell_GET(value); (gdb) bt #0 map_to_dict (deref=1, values=0x75e97510, dict=0x75e8f588, nmap=optimized out, map=0x760e0278) at Objects/frameobject.c:791 #1 PyFrame_FastToLocalsWithError (f=0x75e97398) at Objects/frameobject.c:915 #2 0x779beaa9 in frame_getlocals (f=0x75e97398, closure=optimized out) at Objects/frameobject.c:24 #3 0x779deff3 in _PyObject_GenericGetAttrWithDict (obj=0x75e97398, name=0x77fcdbb0, dict=0x0) at Objects/object.c:1043 #4 0x77a57891 in PyEval_EvalFrameEx (f=optimized out, throwflag=optimized out) at Python/ceval.c:2411 #5 0x77a5df3c in PyEval_EvalCodeEx (_co=optimized out, globals=optimized out, locals=optimized out, args=optimized out, argcount=1, kws=0x790f48, kwcount=0, defs=0x0, defcount=0, kwdefs=0x0, closure=0x0) at Python/ceval.c:3578 #6 0x77a5ca61 in fast_function (nk=optimized out, na=optimized out, n=optimized out, pp_stack=0x7fffbbf0, func=0x76115158) at Python/ceval.c:4334 #7 call_function (oparg=optimized out, pp_stack=0x7fffbbf0) at Python/ceval.c:4252 #8 PyEval_EvalFrameEx (f=optimized out, throwflag=optimized out) at Python/ceval.c:2829 #9 0x77a5df3c in PyEval_EvalCodeEx (_co=optimized out, globals=optimized out, locals=optimized out, args=optimized out, argcount=2, kws=0x77fad060, kwcount=0, defs=0x7617cd48, defcount=1, kwdefs=0x0, closure=0x0) at Python/ceval.c:3578 #10 0x779bf28c in function_call (func=0x76192400, arg=0x76101c08, kw=0x75e8f248) at Objects/funcobject.c:632 #11 0x7799300e in PyObject_Call (func=0x76192400, arg=optimized out, kw=optimized out) at Objects/abstract.c:2067 #12 0x77a56871 in ext_do_call (nk=0, na=1, flags=optimized out, pp_stack=0x7fffbec0, func=0x76192400) at Python/ceval.c:4551 #13 PyEval_EvalFrameEx (f=optimized out, throwflag=optimized out) at Python/ceval.c:2869 ---Type return to continue, or q return to quit--- -- components: Interpreter Core messages: 222029 nosy: msmhrt priority: normal severity: normal status: open title: frame.f_locals causes segfault on Python =3.4.1 type: crash versions: Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21897 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20330] PEP 342 is outdated
New submission from Masami HIRATA: Although PEP 342 says foo(yield 42) is legal, Lib/test/test_grammar.py says: # Requires parentheses as call argument def g(): f((yield 1)) check_syntax_error(self, def g(): f(yield 1)) BTW, It seems that foo(yield 42) written in ECMAScript 6 is OK. -- assignee: docs@python components: Documentation messages: 208650 nosy: docs@python, msmhrt priority: normal severity: normal status: open title: PEP 342 is outdated versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20330 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17708] sys.flags.hash_randomization doesn't return correct value
Masami HIRATA added the comment: It seems there is a misunderstanding on my part. Python v3.3.1 documentation says, sys.flags The struct sequence flags exposes the status of command line flags. The attributes are read only. I think that sys.flags.hash_randomization should be always 1 on Python v3.3.1 because the documentation says, -R Kept for compatibility. On Python 3.3 and greater, hash randomization is turned on by default. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17708 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17708] sys.flags.hash_randomization doesn't return correct value
Masami HIRATA added the comment: We should add 'randomization' and 'seed' attribute to sys.hash_info, I think. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17708 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17708] sys.flags.hash_randomization doesn't return correct value
New submission from Masami HIRATA: OS: Windows 7 Starter Edition SP1 (32-bit) Python: 3.3.1 (python-3.3.1.msi) It seems that sys.flags.hash_randomization doesn't return correct value Output: C:\set PYTHONHASHSEED=random C:\C:\Python33\python.exe Python 3.3.1 (v3.3.1:d9893d13c628, Apr 6 2013, 20:25:12) [MSC v.1600 32 bit (In tel)] on win32 Type help, copyright, credits or license for more information. import sys sys.flags.hash_randomization 1 ^Z C:\set PYTHONHASHSEED=1 C:\C:\Python33\python.exe Python 3.3.1 (v3.3.1:d9893d13c628, Apr 6 2013, 20:25:12) [MSC v.1600 32 bit (In tel)] on win32 Type help, copyright, credits or license for more information. import sys sys.flags.hash_randomization 1 ^Z C:\set PYTHONHASHSEED=12345 C:\C:\Python33\python.exe ... import sys sys.flags.hash_randomization 12345 ^Z Output I Expected: C:\set PYTHONHASHSEED=random C:\C:\Python33\python.exe ... import sys sys.flags.hash_randomization True ^Z C:\set PYTHONHASHSEED=1 C:\C:\Python33\python.exe ... import sys sys.flags.hash_randomization False ^Z C:\set PYTHONHASHSEED=12345 C:\C:\Python33\python.exe ... import sys sys.flags.hash_randomization False ^Z -- components: Library (Lib) messages: 186693 nosy: msmhrt priority: normal severity: normal status: open title: sys.flags.hash_randomization doesn't return correct value versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17708 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16557] PEP 380 isn't reflected in the Functional Programming HOWTO
New submission from Masami HIRATA: Although PEP 380 says: 2. In a generator, the statement :: return value is semantically equivalent to :: raise StopIteration(value) Functional Programming HOWTO (Doc/howto/functional.rst) says: ``return`` with a value, such as ``return 5``, is a syntax error inside a generator function. -- assignee: docs@python components: Documentation messages: 176407 nosy: docs@python, msmhrt priority: normal severity: normal status: open title: PEP 380 isn't reflected in the Functional Programming HOWTO versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16557 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16322] time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding
Masami HIRATA added the comment: Is there any progress on this issue? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16322 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16322] time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding
Masami HIRATA added the comment: And what is the value.of locale.getpreferredencoding(False)? import locale locale.getpreferredencoding(False) 'cp932' -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16322 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16322] time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding
New submission from Masami HIRATA: OS: Windows 7 Starter Edition SP1 (32-bit) Japanese version Python: 3.3.0 for Windows x86 (python-3.3.0.msi) time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding. C:\Python33python.exe Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit (In tel)] on win32 Type help, copyright, credits or license for more information. import time time.tzname[0] '\x93\x8c\x8b\x9e (\x95W\x8f\x80\x8e\x9e)' time.tzname[0].encode('iso-8859-1').decode('mbcs') '東京 (標準時)' '東京 (標準時)' means 'Tokyo (Standard Time)' in Japanese. time.tzname on Python 3.2.3 for Windows works correctly. C:\Python32python.exe Python 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)] on win 32 Type help, copyright, credits or license for more information. import time time.tzname[0] '東京 (標準時)' -- components: Windows messages: 173755 nosy: msmhrt priority: normal severity: normal status: open title: time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding type: behavior versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16322 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16322] time.tzname on Python 3.3.0 for Windows is decoded by wrong encoding
Masami HIRATA added the comment: What show sys.getdefaultencoding(), sys.getfilesystemencoding(), and locale.getpreferredencoding()? C:\Python33python.exe Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit (In tel)] on win32 Type help, copyright, credits or license for more information. import sys sys.getdefaultencoding() 'utf-8' sys.getfilesystemencoding() 'mbcs' import locale locale.getpreferredencoding() 'cp932' 'cp932' is the same as 'mbcs' in the Japanese environment. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16322 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16116] Can not install C extension modules to inside a venv on Python 3.3.0 for Win32
Masami HIRATA added the comment: I attached new log file. (generated with 3.3.0 + your patch) -- Added file: http://bugs.python.org/file27685/Python33_with_venv_3.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16116 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16116] Can not install C extension modules to inside a venv on Python 3.3.0 for Win32
Masami HIRATA added the comment: So you agree that it's working? Yes, the patch works correctly. Thank you! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16116 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16116] Can not install C extension modules to inside a venv on Python 3.3.0 for Win32
Masami HIRATA added the comment: Could well be a similar problem; I'll look into it. Is there any progress? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16116 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16116] Can not install C extension modules to inside a venv on Python 3.3.0 for Win32
Masami HIRATA added the comment: I have tested the workaround and it works correctly. Please see attached log file. -- Added file: http://bugs.python.org/file27429/Python33_with_venv_2.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16116 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16116] Can not install C extension modules to inside a venv on Python 3.3.0 for Win32
Masami HIRATA added the comment: btw, it seems to me that -IC:\Python33\include -IC:\Python33\include should be -IC:\Users\msmhrt\mypython\3.3.0\include -IC:\Python33\include. What do you think about it? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16116 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16116] Can not install C extension modules to inside a venv on Python 3.3.0 for Win32
New submission from Masami HIRATA: I'm trying to install C extension modules inside a venv. It works outside a venv and inside a virtualenv-1.8.2 but breaks inside the venv. OS: Windows 7 Starter Edition SP1 (32-bit) Python: 3.3.0 (python-3.3.0.msi) Compiler: Microsoft Visual C++ 2010 Express SP1 -- components: Library (Lib) files: Python33_with_venv.txt messages: 171875 nosy: msmhrt priority: normal severity: normal status: open title: Can not install C extension modules to inside a venv on Python 3.3.0 for Win32 type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file27397/Python33_with_venv.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16116 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16116] Can not install C extension modules to inside a venv on Python 3.3.0 for Win32
Changes by Masami HIRATA msm...@gmail.com: Added file: http://bugs.python.org/file27398/Python33_with_virtualenv.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16116 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16116] Can not install C extension modules to inside a venv on Python 3.3.0 for Win32
Changes by Masami HIRATA msm...@gmail.com: Added file: http://bugs.python.org/file27399/Python33_without_venv.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16116 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com