[issue42119] Error when debugging logging.FileHandler subclass __init__ method

2021-09-12 Thread Andrei Kulakov


Andrei Kulakov  added the comment:

Changing from not a bug to duplicate of #20853.

--
resolution: not a bug -> duplicate
superseder:  -> pdb "args" crashes when an arg is not printable

___
Python tracker 

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



[issue42119] Error when debugging logging.FileHandler subclass __init__ method

2021-09-10 Thread Andrei Kulakov


Change by Andrei Kulakov :


--
nosy: +kj
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue42119] Error when debugging logging.FileHandler subclass __init__ method

2021-07-28 Thread Andrei Kulakov

Andrei Kulakov  added the comment:

Françoise:

You can simply set the two attrs required by __repr__ in the pdb session:

./python.exe ~/temp/a.py
--INS--
> /Users/ak/opensource/cpython/Lib/logging/__init__.py(1152)__init__()
-> filename = os.fspath(filename)
(Pdb) self.level=1
(Pdb) self.baseFilename='test.log'
(Pdb) a
self = 
filename = 'test.log'
mode = 'a'
encoding = None
delay = False
errors = None
(Pdb)

I think this can be closed as it's not a bug and there's a workaround as shown 
above.

--
nosy: +andrei.avk
versions: +Python 3.10, Python 3.11, Python 3.9

___
Python tracker 

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



[issue42119] Error when debugging logging.FileHandler subclass __init__ method

2020-10-22 Thread Françoise CONIL

New submission from Françoise CONIL :

In pdb, when I hit "a" to see __init__ parameters of a logging.FileHandler 
subclass, I get an error because __repr__ needs a logging level. The level has 
been removed from the parameters by configure_handler() when it instanciates 
the handler. The level is set after the handler instanciation.

I do not know if it can be changed or if I missed something.

Traceback (most recent call last):
  File "/usr/lib/python3.8/logging/config.py", line 563, in configure
handler = self.configure_handler(handlers[name])
  File "/usr/lib/python3.8/logging/config.py", line 744, in configure_handler
result = factory(**kwargs)
  File 
"/home/fconil/Progs/python/logging/multiprocesses-to-files-with-dict.py", line 
53, in __init__
pfilename = f"{filename}-{os.getpid()}.log"
  File 
"/home/fconil/Progs/python/logging/multiprocesses-to-files-with-dict.py", line 
53, in __init__
pfilename = f"{filename}-{os.getpid()}.log"
  File "/usr/lib/python3.8/bdb.py", line 88, in trace_dispatch
return self.dispatch_line(frame)
  File "/usr/lib/python3.8/bdb.py", line 112, in dispatch_line
self.user_line(frame)
  File "/usr/lib/python3.8/pdb.py", line 262, in user_line
self.interaction(frame, None)
  File "/usr/lib/python3.8/pdb.py", line 357, in interaction
self._cmdloop()
  File "/usr/lib/python3.8/pdb.py", line 322, in _cmdloop
self.cmdloop()
  File "/usr/lib/python3.8/cmd.py", line 138, in cmdloop
stop = self.onecmd(line)
  File "/usr/lib/python3.8/pdb.py", line 423, in onecmd
return cmd.Cmd.onecmd(self, line)
  File "/usr/lib/python3.8/cmd.py", line 217, in onecmd
return func(arg)
  File "/usr/lib/python3.8/pdb.py", line 1146, in do_args
self.message('%s = %r' % (name, dict[name]))
  File "/usr/lib/python3.8/logging/__init__.py", line 1186, in __repr__
level = getLevelName(self.level)
AttributeError: 'MultiFileHandler' object has no attribute 'level'

--
components: Library (Lib)
files: multiprocesses-to-files-with-dict.py
messages: 379313
nosy: fcodvpt
priority: normal
severity: normal
status: open
title: Error when debugging logging.FileHandler subclass __init__ method
type: enhancement
versions: Python 3.8
Added file: 
https://bugs.python.org/file49535/multiprocesses-to-files-with-dict.py

___
Python tracker 

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