This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 jmfauth
收信人 barry, jmfauth, ocean-city
日期 2008-08-18.14:51:07
SpamBayes Score 3.51612e-08
Marked as misclassified
Message-id <1219071068.68.0.168654367901.issue2384@psf.upfronthosting.co.za>
In-reply-to
内容
Py3.0b2. This bug seems to be quite annoying. Especially when one works
with a main module importing modules which are importing modules and so
on, all modules having an encoding declaration. The Traceback (and the
user) is (are) a little bit lost.

---------
# -*- coding: cp1252 -*-
# modb.py

def fb():
    i = 1
    j = 0
    r =  i / j    
-----------
# -*- coding: cp1252 -*-
# moda.py

import modb

def fa():
    modb.fb()
-----------
# -*- coding: cp1252 -*-
# main.py

import moda

def main():
    moda.fa()

if __name__ == '__main__':
    main()
-----------

Running main.py leads to an

>c:\python30\pythonw -u "main.py"
(Traceback (most recent call last):
  File "main.py", line 11, in <module>
    
  File "main.py", line 8, in main
    
  File "C:\jm\jmpy3\moda.py", line 8, in fa
    
  File "C:\jm\jmpy3\modb.py", line 8, in fb
    
ZeroDivisionError: int division or modulo by zero
>Exit code: 1
历史
日期 用户 动作 参数
2008-08-18 14:51:08jmfauth修改recipients: + jmfauth, barry, ocean-city
2008-08-18 14:51:08jmfauth修改messageid: <1219071068.68.0.168654367901.issue2384@psf.upfronthosting.co.za>
2008-08-18 14:51:07jmfauth链接issue2384 messages
2008-08-18 14:51:07jmfauth创建