[issue39513] NameError: name 'open' is not defined

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

> Issue26789 is about asyncio, but this issue about logging.

I chose to reassign Issue26789 to the logging module.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39513] NameError: name 'open' is not defined

2020-10-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Issue26789 is about asyncio, but this issue about logging.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39513] NameError: name 'open' is not defined

2020-10-30 Thread STINNER Victor


STINNER Victor  added the comment:

I mark this issue as a duplicate of bpo-26789.

--
nosy: +vstinner
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> asyncio: Please do not log during shutdown

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39513] NameError: name 'open' is not defined

2020-10-30 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think this is a multi-level problem, and it perhaps should be solved on 
different levels separately.

As for logging, it can be used at shutdown by user code, it may help to 
understand the problem with the user code, and it may work most of time. But if 
it happen too late, it fails, and the printed traceback does not help but 
confuses user. The logging module should try the best to help the user. It 
should be ready to handle such situation. It is not failure of the end user 
that this error happens, and they cannot do anything in any way, so it is 
better to suppress the confusion traceback (maybe emit a warning?).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39513] NameError: name 'open' is not defined

2020-02-02 Thread Vinay Sajip


Vinay Sajip  added the comment:

Well, my comment/request was prompted by whether this issue is a duplicate of 
bpo-26789, because it's not clear from the OP. If it is, then it can be closed 
as such. I don't think this is specifically a logging problem, more a case of 
how things become inaccessible as the interpreter shuts down. Any code which 
calls "open" (or some other builtins) would run into this problem, not just and 
not specifically logging. I'm not sure, but I don't believe we have a good 
answer to this problem in general.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39513] NameError: name 'open' is not defined

2020-02-01 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Symptoms as when try to log very late at shutdown stage, when the content of 
the builtin module is restored to its original value which does not include 
open imported from io.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39513] NameError: name 'open' is not defined

2020-02-01 Thread Vinay Sajip


Vinay Sajip  added the comment:

Please attach a small script which allows reproduction of this issue - 
otherwise, it's unlikely we'll be able to make much progress, and I'll probably 
close it in a week or so if you haven't been able to do this. Thanks!

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39513] NameError: name 'open' is not defined

2020-01-31 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

See also https://bugs.python.org/issue26789

--
nosy: +vinay.sajip, xtreak
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39513] NameError: name 'open' is not defined

2020-01-31 Thread Sandeep


New submission from Sandeep :

Hi 
   I wrote a python script which gets file from other server and it works fine 
till the time I don't introduces logging feature to it. 
Please advice how to fix below

This is the code I am using for logging '

import logging
logging.basicConfig(filename=localLogfile, level=logging.DEBUG)

--Error Message 

Traceback (most recent call last):
  File "/d01/python3/lib64/python3.6/site-packages/pysftp/__init__.py", line 
1013, in __del__
  File "/d01/python3/lib64/python3.6/site-packages/pysftp/__init__.py", line 
785, in close
  File "/d01/python3/lib64/python3.6/site-packages/paramiko/sftp_client.py", 
line 194, in close
  File "/d01/python3/lib64/python3.6/site-packages/paramiko/sftp_client.py", 
line 185, in _log
  File "/d01/python3/lib64/python3.6/site-packages/paramiko/sftp.py", line 158, 
in _log
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/logging/__init__.py", line 
1372, in log
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/logging/__init__.py", line 
1442, in _log
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/logging/__init__.py", line 
1452, in handle
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/logging/__init__.py", line 
1514, in callHandlers
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/logging/__init__.py", line 
863, in handle
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/logging/__init__.py", line 
1069, in emit
  File "/opt/rh/rh-python36/root/usr/lib64/python3.6/logging/__init__.py", line 
1059, in _open
NameError: name 'open' is not defined

--
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39513] NameError: name 'open' is not defined

2020-01-31 Thread Sandeep


Change by Sandeep :


--
components: Library (Lib)
nosy: Sandeep
priority: normal
severity: normal
status: open
title: NameError: name 'open' is not defined
type: crash
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com