New submission from Yuval Greenfield <ubershme...@gmail.com>:

These lines fail on Windows in a surprising way:

    # -*- coding: utf8 -*-
    import threading
    print("threading %s" % threading)


Normally they would throw this:

  ```File 
"C:\Python36\Lib\site-packages\missinglink_kernel\callback\log_monitor.py", 
line 1
SyntaxError: encoding problem: utf8```

But attached is a file that throws this instead:

```
Traceback (most recent call last):
  File 
"C:\Python36\Lib\site-packages\missinglink_kernel\callback\log_monitor.py", 
line 2, in <module>
    import threading
NameError: name 'threading' is not defined
```

It seems that the amount of lines in the file will cause the exception hiding 
bug to manifest.

This issue did reproduce on my Windows machine here:

* Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit 
(AMD64)] on win32
* Python 3.7.1 (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)] :: 
Anaconda, Inc. on win32
* Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit 
(Intel)] on win32

It did NOT reproduce on my Mac at all:

It does not repro on my mac at all:
* Python 3.7.1 (default, Dec 14 2018, 13:28:58)  [Clang 4.0.1 
(tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
* Python 3.6.5 |Anaconda, Inc.| (default, Apr 26 2018, 08:42:37) [GCC 4.2.1 
Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin

----------
components: Windows
files: log_monitor.py
messages: 341420
nosy: paul.moore, steve.dower, tim.golden, ubershmekel, zach.ware
priority: normal
severity: normal
status: open
title: Invalid coding error hidden on Windows
type: compile error
versions: Python 3.7
Added file: https://bugs.python.org/file48300/log_monitor.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36800>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to