classification
Title: python 3.5 magic number
Type: behavior Stage:
Components: Build Versions: Python 3.5
process
Status: closed Resolution: third party
Dependencies: Superseder:
Assigned To: Nosy List: Mariatta, brett.cannon, doko, serhiy.storchaka, zach.ware, 曹忠
Priority: normal Keywords:

Created on 2016-10-18 00:29 by 曹忠, last changed 2016-10-25 08:38 by 曹忠. This issue is now closed.

Messages (6)
msg278830 - (view) Author: 曹忠 (曹忠) Date: 2016-10-18 00:29
On debian 9 and python 3.5.2:
>>> imp.get_magic()
b'\x17\r\r\n'

On windows and python 3.5.2
>>> imp.get_magic()
b'\x16\r\r\n'

the same python version, magic number is the same, why not?
msg278837 - (view) Author: Mariatta (Mariatta) * (Python committer) Date: 2016-10-18 03:11
Hi.
imp.get_magic() is deprecated since 3.4, see the documentation here
https://docs.python.org/3/library/imp.html?highlight=get_magic#imp.get_magic

You should use importlib.util.MAGIC_NUMBER instead.

Please try it.
Thanks.
msg278958 - (view) Author: 曹忠 (曹忠) Date: 2016-10-19 01:51
I try, still the same:
On debian 9 and python 3.5.2:
>>> importlib.util.MAGIC_NUMBER
b'\x17\r\r\n'

On windows and python 3.5.2
>>> importlib.util.MAGIC_NUMBER
b'\x16\r\r\n'
msg278960 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2016-10-19 03:18
I suspect Debian 9's Python 3.5.2 has patches beyond v3.5.2, including the patch from #27286 (34d24c51eab6).

What problem is this causing for you?
msg279317 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2016-10-24 16:28
Closing this as a third-party Debian issue (if it even matters as bytecode is an optimization local to a machine and so different magic numbers shouldn't matter).
msg279376 - (view) Author: 曹忠 (曹忠) Date: 2016-10-25 08:38
Thanks, I see.

Brett Cannon <report@bugs.python.org>于2016年10月25日 周二 00:28写道:

Brett Cannon added the comment:

Closing this as a third-party Debian issue (if it even matters as bytecode
is an optimization local to a machine and so different magic numbers
shouldn't matter).

----------
nosy: +brett.cannon
resolution:  -> third party
status: open -> closed

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue28465>
_______________________________________

-- 

Thanks & Best Regards!
曹 忠(Joo Tsao)

广州市盈丰计算机科技有限公司

Address: 广州天河区科韵路12号之一3A02室
Mobile: 137 6331 0068
Tel: +86 020 3829 6735
Fax: +86 020 3829 6726
History
Date User Action Args
2016-10-25 08:38:25曹忠setmessages: + msg279376
2016-10-24 16:28:28brett.cannonsetstatus: open -> closed

nosy: + brett.cannon
messages: + msg279317

resolution: third party
2016-10-19 03:18:02zach.waresetnosy: + serhiy.storchaka, doko, zach.ware
messages: + msg278960
2016-10-19 01:51:39曹忠setmessages: + msg278958
2016-10-18 03:11:28Mariattasetnosy: + Mariatta
messages: + msg278837
2016-10-18 00:29:06曹忠create