[issue47158] logging.handlers.SysLogHandler doesn't get cleaned up properly on exit if it throws an exception

2022-03-31 Thread Vinay Sajip


Vinay Sajip  added the comment:

The 3.8 branch is security-fix-only now, I'm afraid. And I'm not sure it's 
worth backporting this.

--
versions:  -Python 3.8

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



[issue45171] stacklevel handling in logging module is inconsistent

2022-03-27 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset c12ba6b2ff7908c8970b978f149d51ecd3fb195c by Jouke Witteveen in 
branch 'main':
bpo-45171: Remove tests of deprecated logger.warn(). (GH-32139)
https://github.com/python/cpython/commit/c12ba6b2ff7908c8970b978f149d51ecd3fb195c


--

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



[issue45171] stacklevel handling in logging module is inconsistent

2022-03-27 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 5ca6d7469be53960843df39bb900e9c3359f127f by Jouke Witteveen in 
branch 'main':
bpo-45171: Fix stacklevel handling in logging. (GH-28287)
https://github.com/python/cpython/commit/5ca6d7469be53960843df39bb900e9c3359f127f


--
nosy: +vinay.sajip

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



[issue46557] Logging captured warnings with a format string unnecessarily groups warnings together

2022-03-15 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset d8066b420b888591f485d132e62979d07abfc3f4 by Michael P. Nitowski 
in branch 'main':
bpo-46557: Log captured warnings without format string (GH-30975)
https://github.com/python/cpython/commit/d8066b420b888591f485d132e62979d07abfc3f4


--
nosy: +vinay.sajip

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



[issue46914] On Osx Monterey(12.x), Logging.handlers.SysLogHandler does not work

2022-03-03 Thread Vinay Sajip


Vinay Sajip  added the comment:

> If so, then it probably good to adjust ... since it still talks about it 
> being expected.

Do you mean just adding a note to the effect that SysLogHandler won't work on 
macOS 12.2 because of changes to the syslog daemon on that platform?

IIRC using the syslog module was not an option at the time SysLogHandler was 
added, I think because of both thread-safety and lack-of-functionality issues.

--

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



[issue46557] Logging captured warnings with a format string unnecessarily groups warnings together

2022-01-28 Thread Vinay Sajip


Change by Vinay Sajip :


--
type: behavior -> enhancement
versions:  -Python 3.10, Python 3.7, Python 3.8, Python 3.9

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



[issue41906] logging.config.dictConfig does not work with callable filters

2022-01-24 Thread Vinay Sajip


Change by Vinay Sajip :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.11 -Python 3.10

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



[issue41906] logging.config.dictConfig does not work with callable filters

2022-01-20 Thread Vinay Sajip


Vinay Sajip  added the comment:

> If you have any preference about the implementation or any pointer

Nothing particular, just try to fit in with the existing code conventions even 
where they don't follow modern idioms (e.g. a lot of the code in this package 
predates PEP 8 and new styles of string formatting).

--

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



[issue41906] logging.config.dictConfig does not work with callable filters

2022-01-19 Thread Vinay Sajip


Vinay Sajip  added the comment:

> Vinay would you consider a patch for logging where dictConfig allows taking 
> objects directly in addition to the reference id?

Sorry I didn't respond to this; it dropped off my radar. Certainly, I would 
consider such a patch.

--

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



[issue46377] TimedRotatingFileHandler "midnight" misleading when interval > 1

2022-01-14 Thread Vinay Sajip


Vinay Sajip  added the comment:

Unfortunately, you can't rely on people always doing "the sensible thing", for 
any number of good reasons. If a particular set of parameter values didn't 
cause failure, it is probably used somewhere.

Anyway, your problem goes away if interval == 1, right? If we were to tighten 
things up (e.g. disallowing interval > 1 with "midnight"), then it would have 
to be done on a deprecation cycle at the very least, ISTM.

--

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



[issue46377] TimedRotatingFileHandler "midnight" misleading when interval > 1

2022-01-14 Thread Vinay Sajip


Vinay Sajip  added the comment:

Making a change without considering backward compatibility is premature. I've 
closed the PR as there appears to be something wrong with it - it references 
hundreds of changed files. Did you look at the 'atTime' keyword parameter of 
TimedRotatingFileHandler?

--

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



[issue42378] logging reopens file with same mode, possibly truncating

2022-01-07 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset e35430bec528dfb1a653cd457ea58b5a08543632 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-42378: fixed log truncation on logging shutdown (GH-27310) (GH-30468)
https://github.com/python/cpython/commit/e35430bec528dfb1a653cd457ea58b5a08543632


--

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



[issue42378] logging reopens file with same mode, possibly truncating

2022-01-07 Thread Vinay Sajip


Vinay Sajip  added the comment:

I guess it got missed during the 3.10 beta cycle by not being backported - it 
might have needed to be cherry-picked. I'll see about getting it backported to 
3.10.

--

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



[issue46292] Add microseconds to logging.LogRecord

2022-01-07 Thread Vinay Sajip


Vinay Sajip  added the comment:

Thanks for the patch. We're need to get contributors to sign a Contributor 
License Agreement (CLA) before we can accept their patches. Would you be 
willing to do this? The process could be smoother, but it's not too bad, and 
here's where you get started:

https://www.python.org/psf/contrib/contrib-form/

--

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



[issue46292] Add microseconds to logging.LogRecord

2022-01-07 Thread Vinay Sajip


Change by Vinay Sajip :


--
versions: +Python 3.11

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



[issue41011] [venv] record which executable and command were used to create a virtual environment

2022-01-06 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset f4e325c21d6d9c2bf70224dc69d707b226f87872 by andrei kulakov in 
branch 'main':
bpo-41011: venv -- add more variables to pyvenv.cfg (GH-30382)
https://github.com/python/cpython/commit/f4e325c21d6d9c2bf70224dc69d707b226f87872


--

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



[issue46251] logger.config.configure_formatter executes arbitrary code

2022-01-06 Thread Vinay Sajip


Vinay Sajip  added the comment:

I'm closing with the assumption that the addition to the documentation covers 
this. If that needs to be improved, this can be reopened with specific 
suggestions.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

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



[issue46251] logger.config.configure_formatter executes arbitrary code

2022-01-06 Thread Vinay Sajip

Vinay Sajip  added the comment:


New changeset 188fbdee0d6721a948eabb81cdcacac371614793 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-46251: Add 'Security Considerations' section to logging configura… 
(GH-30411) (GH-30448)
https://github.com/python/cpython/commit/188fbdee0d6721a948eabb81cdcacac371614793


--

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



[issue46251] logger.config.configure_formatter executes arbitrary code

2022-01-06 Thread Vinay Sajip

Vinay Sajip  added the comment:


New changeset db60ed1170a02189a4fd4b7574e0722dd22c658b by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-46251: Add 'Security Considerations' section to logging configura… 
(GH-30411) (GH-30447)
https://github.com/python/cpython/commit/db60ed1170a02189a4fd4b7574e0722dd22c658b


--

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



[issue46251] logger.config.configure_formatter executes arbitrary code

2022-01-06 Thread Vinay Sajip

Vinay Sajip  added the comment:


New changeset 46c7a6566bca2e974a89c90c35ed1c498d9d3b02 by Vinay Sajip in branch 
'main':
bpo-46251: Add 'Security Considerations' section to logging configura… 
(GH-30411)
https://github.com/python/cpython/commit/46c7a6566bca2e974a89c90c35ed1c498d9d3b02


--

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



[issue46251] logger.config.configure_formatter executes arbitrary code

2022-01-05 Thread Vinay Sajip


Vinay Sajip  added the comment:

I've created a PR to add a "Security Considerations" section in the 
configuration documentation. Comments on the PR are welcome.

--
stage: patch review -> 

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



[issue46251] logger.config.configure_formatter executes arbitrary code

2022-01-05 Thread Vinay Sajip


Change by Vinay Sajip :


--
keywords: +patch
pull_requests: +28617
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30411

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



[issue46251] logger.config.configure_formatter executes arbitrary code

2022-01-04 Thread Vinay Sajip


Vinay Sajip  added the comment:

> "Dont load untrusted config files" is the answer I expected.

Yes. It's the usual convenience vs. security trade-off. To make configuration 
convenient, configurable factories with configurable parameters are provided. 
Can this be misused? Of course.

Digital signing has its place where auditability and accountability are 
important, but it would normally only be used in production where configuration 
changes are subject to a strict process with signoffs. 

There could definitely be stronger warnings in the documentation about trust 
and configurations.

> Is it reasonable to say that all classes  by _resolve() and resolve() should 
> have "logger." at the top of them? If not perhaps the object could have a 
> permitted list of top level packages that defaults to just "logger." but 
> could be extended to others by the developer.

I would think that's going too far, and perhaps it only moves the problem. In 
any case, dictConfig has a mechanism using the "()" key which allows any 
callable, not just a class. This is for a not uncommon use case where the 
callable is a function that returns a logging object (handler/formatter/filter) 
that has been tweaked in some way. But that feature can of course also be used 
with untrusted inputs to produce surprises.

--

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



[issue46200] Discourage logging f-strings due to security considerations

2021-12-31 Thread Vinay Sajip


Vinay Sajip  added the comment:

Another (minor) point against using f-strings or .format is that formatting 
prematurely might be doing unnecessary work - by default, logging formats 
messages lazily, waiting until a message actually needs to be output. This 
could perhaps be more prominently emphasized in the docs where formatting is 
first introduced.

--

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



[issue46063] TimedRotatingFileHandler deletes wrong files

2021-12-14 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 17260e44b5ed3508e3c15f1b7ded761879e91d3e by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-46063: Add 'delay=True' to file handler initialization. (GH-30103) 
(GH-30105)
https://github.com/python/cpython/commit/17260e44b5ed3508e3c15f1b7ded761879e91d3e


--

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



[issue46063] TimedRotatingFileHandler deletes wrong files

2021-12-14 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 908fd691f96403a3c30d85c17dd74ed1f26a60fd by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-46063: Add 'delay=True' to file handler initialization. (GH-30103) 
(GH-30104)
https://github.com/python/cpython/commit/908fd691f96403a3c30d85c17dd74ed1f26a60fd


--

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



[issue46063] TimedRotatingFileHandler deletes wrong files

2021-12-14 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 850aefc2c651110a784cd5478af9774b1f6287a3 by Vinay Sajip in branch 
'main':
bpo-46063: Add 'delay=True' to file handler initialization. (GH-30103)
https://github.com/python/cpython/commit/850aefc2c651110a784cd5478af9774b1f6287a3


--

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



[issue46063] TimedRotatingFileHandler deletes wrong files

2021-12-14 Thread Vinay Sajip


Change by Vinay Sajip :


--
pull_requests: +28326
pull_request: https://github.com/python/cpython/pull/30103

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



[issue46063] TimedRotatingFileHandler deletes wrong files

2021-12-14 Thread Vinay Sajip


Vinay Sajip  added the comment:

Ah ... forgot to set delay=True for the handlers. Will look at this soon.

--

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



[issue46028] 3.11.0a3: sys._base_executable is wrong, breaks venv - it wasn't under 3.11.0a2

2021-12-14 Thread Vinay Sajip


Change by Vinay Sajip :


--
title: 3.11.0a3: under tox, sys._base_executable is wrong -> 3.11.0a3: 
sys._base_executable is wrong, breaks venv - it wasn't under 3.11.0a2

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



[issue23010] "unclosed file" warning when defining unused logging FileHandler in dictConfig

2021-12-14 Thread Vinay Sajip


Change by Vinay Sajip :


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

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



[issue46063] TimedRotatingFileHandler deletes wrong files

2021-12-14 Thread Vinay Sajip


Change by Vinay Sajip :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

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



[issue46063] TimedRotatingFileHandler deletes wrong files

2021-12-13 Thread Vinay Sajip

Vinay Sajip  added the comment:


New changeset 94234228abbb84945a48049a7515dea960bc9834 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-46063: Improve algorithm for computing which rolled-over log file… 
(GH-30093) (GH-30095)
https://github.com/python/cpython/commit/94234228abbb84945a48049a7515dea960bc9834


--

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



[issue46063] TimedRotatingFileHandler deletes wrong files

2021-12-13 Thread Vinay Sajip

Vinay Sajip  added the comment:


New changeset f84e2f6c0aca97c59ec8ce21715ae9bd89893307 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-46063: Improve algorithm for computing which rolled-over log file… 
(GH-30093) (GH-30094)
https://github.com/python/cpython/commit/f84e2f6c0aca97c59ec8ce21715ae9bd89893307


--

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



[issue46063] TimedRotatingFileHandler deletes wrong files

2021-12-13 Thread Vinay Sajip

Vinay Sajip  added the comment:


New changeset cb589d1b6bad4b75852c2e2a471a3800d5efdca7 by Vinay Sajip in branch 
'main':
bpo-46063: Improve algorithm for computing which rolled-over log file… 
(GH-30093)
https://github.com/python/cpython/commit/cb589d1b6bad4b75852c2e2a471a3800d5efdca7


--

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



[issue46028] 3.11.0a3: under tox, sys._base_executable is wrong

2021-12-13 Thread Vinay Sajip


Vinay Sajip  added the comment:

> This is the intended behaviour, and yes it's changed from previous versions 
> ... The previous value was incorrect, hence it was marked as an internal 
> field.

But the value as it's calculated now seems to give a file that doesn't exist - 
how can that be correct?

--

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



[issue46063] TimedRotatingFileHandler deletes wrong files

2021-12-13 Thread Vinay Sajip


Change by Vinay Sajip :


--
keywords: +patch
pull_requests: +28316
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/30093

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



[issue43749] venv module does not copy the correct python exe

2021-12-10 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset bad16f0cf71a6b11ef62f86be6b3d3567cd70a16 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-43749: Ensure current exe is copied when using venv on windows 
(GH-25216) (GH-30033)
https://github.com/python/cpython/commit/bad16f0cf71a6b11ef62f86be6b3d3567cd70a16


--

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



[issue43749] venv module does not copy the correct python exe

2021-12-10 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset bb8d645f3a09645686cf8f66bd46dcfa4efac713 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-43749: Ensure current exe is copied when using venv on windows 
(GH-25216) (GH-30034)
https://github.com/python/cpython/commit/bb8d645f3a09645686cf8f66bd46dcfa4efac713


--

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



[issue43749] venv module does not copy the correct python exe

2021-12-10 Thread Vinay Sajip


Vinay Sajip  added the comment:

*3.8, I meant.

--

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



[issue43749] venv module does not copy the correct python exe

2021-12-10 Thread Vinay Sajip


Vinay Sajip  added the comment:

3.10 and 3.9 - OK, but 3. is security fixes only, I'm afraid.

--

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



[issue35821] Clarify when logging events are propagated when propagate is true

2021-12-07 Thread Vinay Sajip


Change by Vinay Sajip :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

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



[issue35821] Clarify when logging events are propagated when propagate is true

2021-12-07 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset e688568cdfe758a2316ecaf0c8df868d5dde0d83 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-35821: Add an example to Logger.propagate documentation. (GH-29841) 
(GH-29958)
https://github.com/python/cpython/commit/e688568cdfe758a2316ecaf0c8df868d5dde0d83


--

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



[issue35821] Clarify when logging events are propagated when propagate is true

2021-12-07 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset f78c229b4ec8621a9b15c6396b6c91518e8975d6 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-35821: Add an example to Logger.propagate documentation. (GH-29841) 
(GH-29957)
https://github.com/python/cpython/commit/f78c229b4ec8621a9b15c6396b6c91518e8975d6


--

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



[issue35821] Clarify when logging events are propagated when propagate is true

2021-12-07 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 2bf551757e0a7e3cc6ce2ebed2178b82438ac6b5 by Vinay Sajip in branch 
'main':
bpo-35821: Add an example to Logger.propagate documentation. (GH-29841)
https://github.com/python/cpython/commit/2bf551757e0a7e3cc6ce2ebed2178b82438ac6b5


--

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



[issue44391] PC/launcher.c,one more argument than required

2021-11-29 Thread Vinay Sajip


Change by Vinay Sajip :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.9

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



[issue44391] PC/launcher.c,one more argument than required

2021-11-29 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset af39cfa6ca1e5dc4e5d28c1f09a875a14354e4ae by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-44391: Remove unused argument from a varargs call. (GH-29843) 
(GH-29849)
https://github.com/python/cpython/commit/af39cfa6ca1e5dc4e5d28c1f09a875a14354e4ae


--

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



[issue44391] PC/launcher.c,one more argument than required

2021-11-29 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 40a57532a5ad5dfd81ab6c72c5fb2e2dc4509199 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-44391: Remove unused argument from a varargs call. (GH-29843) 
(GH-29850)
https://github.com/python/cpython/commit/40a57532a5ad5dfd81ab6c72c5fb2e2dc4509199


--

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



[issue44391] PC/launcher.c,one more argument than required

2021-11-29 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 4141d94fa608cdf5c8cd3e62f7ea1c27fd41eb8d by Vinay Sajip in branch 
'main':
bpo-44391: Remove unused argument from a varargs call. (GH-29843)
https://github.com/python/cpython/commit/4141d94fa608cdf5c8cd3e62f7ea1c27fd41eb8d


--

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



[issue44391] PC/launcher.c,one more argument than required

2021-11-29 Thread Vinay Sajip


Change by Vinay Sajip :


--
keywords: +patch
pull_requests: +28072
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29843

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



[issue35821] Clarify when logging events are propagated when propagate is true

2021-11-29 Thread Vinay Sajip


Change by Vinay Sajip :


--
keywords: +patch
pull_requests: +28070
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/29841

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



[issue28499] Logging module documentation needs a rework.

2021-11-28 Thread Vinay Sajip


Vinay Sajip  added the comment:

Closing, as no objections raised.

--
resolution:  -> not a bug
stage: needs patch -> resolved
status: open -> closed

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



[issue23010] "unclosed file" warning when defining unused logging FileHandler in dictConfig

2021-11-27 Thread Vinay Sajip


Vinay Sajip  added the comment:

This had dropped off my radar completely, but I still can't see where there's 
an actual bug here. This simplified script:

import logging
import sys

LOGGING = {
'version': 1,
'handlers': {
'logfile': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': '/tmp/debug.log',
},
},
}

print('Starting: %s' % sys.version)
from logging.config import dictConfig
dictConfig(LOGGING)
print('After dictconfig')
print('_handlerList 1, initial:', logging._handlerList, len(logging._handlers))
import importlib
print('_handlerList 2, about to import shutil:', logging._handlerList, 
len(logging._handlers))
import shutil
print('_handlerList 3, just imported shutil:', logging._handlerList, 
len(logging._handlers))
print('')

when run with Python 3.10, produces

Starting: 3.10.0+ (heads/3.10:7203ecd332, Oct 29 2021, 10:04:19) [GCC 7.5.0]
After dictconfig
_handlerList 1, initial: [] 1
_handlerList 2, about to import shutil: [] 1
/home/vinay/.local/lib/python3.10/_compression.py:33: ResourceWarning: unclosed 
file <_io.FileIO name='/tmp/debug.log' mode='ab' closefd=True>
  class DecompressReader(io.RawIOBase):
ResourceWarning: Enable tracemalloc to get the object allocation traceback
_handlerList 3, just imported shutil: [] 0

But ... there are no loggers that use this handler, so the only reference would 
be the weak reference in _handlerList - it gets freed up at some point (in this 
case, when shutil is imported, but I don't believe that's necessarily relevant) 
and that causes the ResourceWarning, but where's the problem? If you either add 
a reference to the handler (by adding it to a logger) or adding "delay: True" 
to the handler configuration dict to delay opening the file, the 
ResourceWarning is no longer seen.

I tested with Python 3.4 - 3.10 and all versions behave the same way - it could 
just be down to where weak references get dumped, which is down to the vagaries 
of GC. I don't see this as a "leak" - the ResourceWarning is showing the 
developer that they opened a file for no particular reason and didn't use it.

--

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



[issue45682] Nicer default logging format

2021-10-31 Thread Vinay Sajip


Vinay Sajip  added the comment:

> They too could pass a format argument themselves rather then relying on the 
> default format never changing.

Changes to the stdlib shouldn't require changing previously working code 
(sometimes months or years old) to fix breakage caused by new stdlib changes.

--

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



[issue45682] Nicer default logging format

2021-10-31 Thread Vinay Sajip


Vinay Sajip  added the comment:

> However in the case of logging, an argument could be made that changing the 
> default would have less impact.

Except that people may have used the current basic format in, for example, unit 
tests, and that code could break after a change like the one proposed. The 
default has been intentionally kept minimal for the very simplest of needs and 
it is easy to override this default using e.g. basicConfig() for simple needs 
or e.g. dictConfig() for more elaborate needs.

For those reasons, I don't think this default should be changed.

--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

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



[issue45628] TimedRotatingFileHandler backupCount not working

2021-10-29 Thread Vinay Sajip


Vinay Sajip  added the comment:

It's possible this crept in during the fix for bpo-44753.

--

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



[issue45628] TimedRotatingFileHandler backupCount not working

2021-10-29 Thread Vinay Sajip


Vinay Sajip  added the comment:

N.B. I was able to reproduce this on recent 3.9 versions as well.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

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



[issue45628] TimedRotatingFileHandler backupCount not working

2021-10-29 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 191a93905a84f272b2232701dc5dcc69987330f5 by Miss Islington (bot) 
in branch '3.10':
[3.10] bpo-45628: Check all parts of the suffix for an extension match. 
(GH-29310) (GH-29314)
https://github.com/python/cpython/commit/191a93905a84f272b2232701dc5dcc69987330f5


--

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



[issue45628] TimedRotatingFileHandler backupCount not working

2021-10-29 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 317e0c99e3804310f4bee23e497d9d84b717d7f7 by Miss Islington (bot) 
in branch '3.9':
[3.9] bpo-45628: Check all parts of the suffix for an extension match. 
(GH-29310) (GH-29313)
https://github.com/python/cpython/commit/317e0c99e3804310f4bee23e497d9d84b717d7f7


--

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



[issue45628] TimedRotatingFileHandler backupCount not working

2021-10-29 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 8a77f59de51f1fd6062f0fefe73ee3059d714144 by Vinay Sajip in branch 
'main':
bpo-45628: Check all parts of the suffix for an extension match. (GH-29310)
https://github.com/python/cpython/commit/8a77f59de51f1fd6062f0fefe73ee3059d714144


--

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



[issue45628] TimedRotatingFileHandler backupCount not working

2021-10-29 Thread Vinay Sajip


Change by Vinay Sajip :


--
keywords: +patch
pull_requests: +27578
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/29310

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



[issue45465] logging messages are needlessly reformatted for every handler

2021-10-15 Thread Vinay Sajip


Vinay Sajip  added the comment:

Oh, I see what you mean now - I was thinking of the overall message formatted 
using a formatter. However, filters can still change a record's attributes and 
getMessage() could behave differently on different calls because of this. 
Changing things in this area could break existing code.

--

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



[issue45465] logging messages are needlessly reformatted for every handler

2021-10-15 Thread Vinay Sajip


Vinay Sajip  added the comment:

A developer may wish to format messages differently for different audiences 
(i.e. different handlers) - for example, omit stack traces. This behaviour is 
by design.

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

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



[issue45401] logging TimedRotatingFileHandler must not rename devices like /dev/null

2021-10-10 Thread Vinay Sajip


Vinay Sajip  added the comment:

Where did you see the warnings? I didn't spot anything in the GitHub Actions 
logs.

--

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



[issue45401] logging TimedRotatingFileHandler must not rename devices like /dev/null

2021-10-10 Thread Vinay Sajip


Change by Vinay Sajip :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

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



[issue45401] logging TimedRotatingFileHandler must not rename devices like /dev/null

2021-10-08 Thread Vinay Sajip


Change by Vinay Sajip :


--
keywords: +patch
pull_requests: +27140
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/28822

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



[issue45401] logging TimedRotatingFileHandler must not rename devices like /dev/null

2021-10-07 Thread Vinay Sajip


Vinay Sajip  added the comment:

RotatingFileHandler is also affected by the same issue.

Both RotatingFileHandler and TimedRotatingFileHandler have a shouldRollover 
method which, if it returns False, should prevent rollover.

I would think that putting something like

if not os.path.isfile(self.baseFilename):
return False

at the top of each of these methods should avoid rolling over any thing that 
isn't a regular file - devices, pipes etc. Would you agree? Can you see any 
drawbacks?

I'm not sure this would cover sockets, but there are separate handlers for 
using sockets so there would be no reason for people to use sockets with file 
handlers. And of course sockets are a completely different sort of beast on 
Windows.

--

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



[issue45027] Allow basicConfig to configure any logger, not just root

2021-09-20 Thread Vinay Sajip


Vinay Sajip  added the comment:

> This selectively _disables_ a logger. That isn't the same thing as 
> selectively _enabling_ only the loggers you want to enable.

Your earlier comment referred to getting unwanted messages from third-party 
loggers. Suppressing the messages implies disabling them in some way.

> That's fair enough, but why make people do the above (which is somewhat 
> unintuitive)

That's your opinion, but it doesn't seem that this view is widespread. We 
provide basicConfig() for simple configuration and dictConfig() for more 
elaborate requirements; dictConfig() was reviewed by Python developers in PEP 
391 and accepted.

> I could also publish this as a separate package on PyPI

By all means, do that. As I've already said, I've no wish to add yet another 
way of configuring logging. If your PyPI package gains wide adoption, we can 
always revisit this.

--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

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



[issue45027] Allow basicConfig to configure any logger, not just root

2021-09-16 Thread Vinay Sajip


Vinay Sajip  added the comment:

> This change serves the purpose of making it easier to configure non-root 
> loggers.

My point was, they don't need to configure non-root loggers (in terms of adding 
handlers) because the root logger's handlers will normally be used for all 
loggers.

> However, if you configure the root logger in your application, you will see 
> those [other libraries'] log messages.

Users certainly don't need an API change to prevent that, should they wish to. 
The following simple call will suffice (using 'gnupg' just as an example):

logging.getLogger('gnupg').setLevel(logging.CRITICAL + 1)

> I would frame this proposal as a third configuration option

As you can see, it's not needed for the purpose you described (avoiding 
messages from third-party loggers).

> it would be nice to adjust the type stubs for dictConfig() to use a TypedDict 
> ... I'm happy to make a PR to Typeshed for it, though!

Sure, sounds like a good idea.

> I also think there should be a note about dictConfig() in the docs for 
> basicConfig() ... Again, I'm happy to make a separate PR for that change.

By all means. You could also look at updating the cookbook content, if you feel 
that parts relating to the concerns expressed in this issue could be expanded 
on.

--

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



[issue44489] _handle_existing_loggers should respect loggers that were manually disabled

2021-09-02 Thread Vinay Sajip


Vinay Sajip  added the comment:

Closing, as no further feedback received on this issue. You can reopen if you 
have an answer to my question.

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

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



[issue45027] Allow basicConfig to configure any logger, not just root

2021-09-02 Thread Vinay Sajip


Vinay Sajip  added the comment:

Thanks, but ...

> I observe that many Python users tend to use basicConfig() even when they 
> would be better served by configuring only the logger(s) needed for their own 
> app/library.

First of all, library developers should not be configuring loggers at all, 
other than adding a NullHandler to their top-level logger.

Secondly, it is fine to configure the root logger and then log to any other 
logger. The default mechanisms mean that handlers added to the root logger are 
used by loggers which are anywhere in the logger hierarchy. So users that are 
using basicConfig() but other loggers than the root logger may be using the 
system as designed.

Thirdly, logging.config.dictConfig() allows usage of a dictionary to configure 
multiple loggers, handlers etc. all at once, for use cases which are more 
demanding than basicConfig(). It doesn't make sense to do what you're 
proposing, since it appears to offer a different way of configuring other 
loggers than the root logger, when dictConfig() already offers that.

So, I am minded to not agree to this change, and would prefer that the PR and 
this issue be closed.

--
nosy: +vinay.sajip

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



[issue44924] logging.handlers.QueueHandler does not maintain the exc_text

2021-08-17 Thread Vinay Sajip


Vinay Sajip  added the comment:

It might be inadvisable to make your suggested change because of backward 
compatibility and breakage of existing code. However, I don't mind updating the 
logging cookbook to mention your suggested method of resolving the issue for 
this use case. I'll leave the issue open until I've done that.

--

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



[issue44924] logging.handlers.QueueHandler does not maintain the exc_text

2021-08-16 Thread Vinay Sajip


Vinay Sajip  added the comment:

Why can you not subclass QueueHandler and override the prepare method to do 
what you want/need?

--

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



[issue40469] TimedRotatingFileHandler rotating on use not time

2021-08-13 Thread Vinay Sajip


Vinay Sajip  added the comment:

> You are far better and more experienced in maintaining widely used opensource 
> codebases so I wouldn't argue with you, but... :)

Well, if a change introduces a problem, it will be my lookout, won't it? Just 
as the original patch for bpo-8117 is proving to be :-)

OK, how about this? We update the PR to add a new use_ctime=False keyword 
argument to TimedRotatingHandler.__init__(). If nothing else changes, the 
behaviour is as it is currently. If use_ctime=True is passed in the 
instantiation, then the constructor will use CTIME rather than MTIME. Will that 
work for you? I'd be OK with that approach.

--

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



[issue40469] TimedRotatingFileHandler rotating on use not time

2021-08-13 Thread Vinay Sajip


Vinay Sajip  added the comment:

I just checked - the relevant code (using MTIME) was added in 2010, as a fix 
for bpo-8117 - around the time that Python 2.6 was released.

--

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



[issue40469] TimedRotatingFileHandler rotating on use not time

2021-08-13 Thread Vinay Sajip


Vinay Sajip  added the comment:

> Well, there is nothing in the documentation that would say the logrotation 
> can be only performed by continously running scripts, thats why. :)

Well, what's the need to rotate based on time when you just run scripts 
sporadically or they're very short-lived? Not trying to argue, just trying to 
understand.

> There are scripts or even daemons written in Python that need to be restarted 
> from time to time. If the logrotate period is greater than restart period the 
> log files will never be rotated, however they could be.

Yes, but generally daemons are long-lived relative to the rotation interval, 
aren't they? "From time to time" certainly implies that to me.

> What is the logic behind checking the MTIME instead of CTIME when one is 
> calculating the age of a file when tries to calculate whether it has to be 
> rotated or not?

I can't remember, that code is over 12 years old and that specific decision 
wasn't documented :-(

> From the code I have to assume that the original author also tried to prepare 
> for the cases where the execution is interrupted and/or restarted and (s)he 
> wanted the TimedLogrotateHandler to be resumed where it was during the 
> previous execution. Dnn't you agree?

I take it you mean TimedRotatingFileHandler. Certainly it assumes that the 
script might be restarted, which is why it opens the file in append mode.

If the computation using MTIME were changed to use CTIME, that would be a 
behaviour change, which could conceivably break someone's code that relied on 
current behaviour (unlikely, but you just never know). I've no other objection 
to using CTIME rather than MTIME - perhaps I'm just being hyper-cautious about 
breakage?

--

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



[issue40469] TimedRotatingFileHandler rotating on use not time

2021-08-12 Thread Vinay Sajip


Vinay Sajip  added the comment:

> The assumed behaviour of TimedRotatingFileHandler is to rotate log files 
> older than configured. Even when the script is executed multiple times.

Ah, but is it? The purpose of TimedRotatingFileHandler is to rotate files based 
on time intervals, and is normally assumed to be for long-running processes 
(where the rotation allows one to focus on logs output during a period of 
interest). What's the practical, real-world use-case for the example scripts 
you added?

--

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



[issue44291] Unify logging.handlers.SysLogHandler behavior with SocketHandlers

2021-08-05 Thread Vinay Sajip


Change by Vinay Sajip :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

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



[issue44291] Unify logging.handlers.SysLogHandler behavior with SocketHandlers

2021-08-05 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 3d315c311676888201f4a3576e4ee3698684a3a2 by Kirill Pinchuk in 
branch 'main':
bpo-44291: Fix reconnection in logging.handlers.SysLogHandler (GH-26490)
https://github.com/python/cpython/commit/3d315c311676888201f4a3576e4ee3698684a3a2


--

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



[issue44186] TimedRotatingFileHandler overwrite log

2021-08-02 Thread Vinay Sajip


Vinay Sajip  added the comment:

OK, I get it now :-)

See my comments on the PR - I think the renaming strategy might need rethinking 
in the presence of a "namer" routine being set. See bpo-43344, bpo-44753. This 
area (TimedRotatingFileHandler) is unfortunately not yet well tested, because 
you would need mocking to avoid delays in test runs. But ideally, we would test 
in the absence and presence of a renamer routine that moved the ".log" to the 
end of the filename.

--

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



[issue43749] venv module does not copy the correct python exe

2021-08-01 Thread Vinay Sajip


Change by Vinay Sajip :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

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



[issue44489] _handle_existing_loggers should respect loggers that were manually disabled

2021-08-01 Thread Vinay Sajip


Vinay Sajip  added the comment:

Why couldn't you just do the logging configuration first, then disable any 
loggers you need to after that?

You can pass a custom configuration dict when instantiating a Sanic app. That 
could contain a setting for the ddtrace logger, e.g. to set its level to 
logging.CRITICAL + 1.

--

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



[issue37880] For argparse add_argument with action='store_const', const should default to None.

2021-08-01 Thread Vinay Sajip


Change by Vinay Sajip :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

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



[issue40469] TimedRotatingFileHandler rotating on use not time

2021-08-01 Thread Vinay Sajip


Vinay Sajip  added the comment:

With this slightly modified test script and the JSON configuration based on the 
YAML, I got the following results after running for a while:

$ more info.log*
::
info.log
::
2021-08-01 07:13:45 INFO Message no. 9
2021-08-01 07:14:15 INFO Message no. 10
::
info.log.2021-08-01_07-09
::
2021-08-01 07:09:45 INFO Message no. 1
2021-08-01 07:10:15 INFO Message no. 2
::
info.log.2021-08-01_07-10
::
2021-08-01 07:10:45 INFO Message no. 3
2021-08-01 07:11:15 INFO Message no. 4
::
info.log.2021-08-01_07-11
::
2021-08-01 07:11:45 INFO Message no. 5
2021-08-01 07:12:15 INFO Message no. 6
::
info.log.2021-08-01_07-12
::
2021-08-01 07:12:45 INFO Message no. 7
2021-08-01 07:13:15 INFO Message no. 8

The test script logs every 30 seconds, so I don't see what the problem is. Can 
you describe it more clearly?

--
keywords:  -patch
Added file: https://bugs.python.org/file50197/log_40469.py

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



[issue40469] TimedRotatingFileHandler rotating on use not time

2021-08-01 Thread Vinay Sajip


Change by Vinay Sajip :


Added file: https://bugs.python.org/file50196/config.json

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



[issue44186] TimedRotatingFileHandler overwrite log

2021-07-31 Thread Vinay Sajip


Vinay Sajip  added the comment:

I modified the provided test script (-> test_44186.py) and added a test shell 
script which runs it twice in succession. What it printed was:

6 51 43
TEST > [INFO] [2021-08-01 06:51:43] : foo 2021-08-01T06:51:43.091681
6 51 43
TEST > [INFO] [2021-08-01 06:51:43] : bar 2021-08-01T06:51:43.138274

and the log files created were

$ more test.log*
::
test.log
::
bar 2021-08-01T06:51:43.138274
::
test.log.2021-07-31
::
foo 2021-08-01T06:51:43.091681

So from what I can see, both logged messages are present and nothing has been 
lost. Can you describe the problem more clearly? I can't see one.

--
Added file: https://bugs.python.org/file50195/test.sh

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



[issue44186] TimedRotatingFileHandler overwrite log

2021-07-31 Thread Vinay Sajip


Change by Vinay Sajip :


Added file: https://bugs.python.org/file50194/log_44186.py

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



[issue43758] dict.config TimedRotatingFileHandler filename .suffix does not function

2021-07-31 Thread Vinay Sajip


Vinay Sajip  added the comment:

This is not the place for asking questions like this - please use Stack 
Overflow or the python-users mailing list.

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

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



[issue37880] For argparse add_argument with action='store_const', const should default to None.

2021-07-31 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 0ad173249d287794d53e6a1fe2d58bb2adee2276 by Jack DeVries in 
branch 'main':
bpo-37880: for argparse add_argument with action='store_const', const now 
defaults to None. (GH-26707)
https://github.com/python/cpython/commit/0ad173249d287794d53e6a1fe2d58bb2adee2276


--

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



[issue44753] backupCount is not respected in TimedRotatingFileHandler when namer is specified

2021-07-30 Thread Vinay Sajip


Vinay Sajip  added the comment:

Thanks for the bug report.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

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



[issue44753] backupCount is not respected in TimedRotatingFileHandler when namer is specified

2021-07-30 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 6e6dc2517379289932c68fc986ee3994468374fc by Miss Islington (bot) 
in branch '3.10':
bpo-44753: Don't use logfile extension when determining old files to be deleted 
(GH-27475) (GH-27487)
https://github.com/python/cpython/commit/6e6dc2517379289932c68fc986ee3994468374fc


--

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



[issue44753] backupCount is not respected in TimedRotatingFileHandler when namer is specified

2021-07-30 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 882e4761c63ae76d994b57bbcd7e5adbf2aa7b4f by Miss Islington (bot) 
in branch '3.9':
bpo-44753: Don't use logfile extension when determining old files to be deleted 
(GH-27475) (GH-27486)
https://github.com/python/cpython/commit/882e4761c63ae76d994b57bbcd7e5adbf2aa7b4f


--

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



[issue44753] backupCount is not respected in TimedRotatingFileHandler when namer is specified

2021-07-30 Thread Vinay Sajip


Vinay Sajip  added the comment:

Should be fixed in main, leaving open until backports are done.

--
versions: +Python 3.10, Python 3.9 -Python 3.8

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



[issue44753] backupCount is not respected in TimedRotatingFileHandler when namer is specified

2021-07-30 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 6ff890380971752299325bd28eab80ec936975cf by Vinay Sajip in branch 
'main':
bpo-44753: Don't use logfile extension when determining old files to be deleted 
(GH-27475)
https://github.com/python/cpython/commit/6ff890380971752299325bd28eab80ec936975cf


--

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



[issue44753] backupCount is not respected in TimedRotatingFileHandler when namer is specified

2021-07-30 Thread Vinay Sajip


Change by Vinay Sajip :


--
keywords: +patch
pull_requests: +25994
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/27475

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



[issue43344] RotatingFileHandler breaks file type associations

2021-07-29 Thread Vinay Sajip


Vinay Sajip  added the comment:

> Could you please share best practices, looks like this documentation is 
> missing.

I don't think so, because the implementation of the namer is up to the user.

Note that this specific issue relates to RotatingFileHandler, not 
TimedRotatingFileHandler. I will take a look at the other issue you raised.

--

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



[issue44753] backupCount is not respected in TimedRotatingFileHandler when namer is specified

2021-07-29 Thread Vinay Sajip


Change by Vinay Sajip :


--
nosy: +vinay.sajip

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



[issue44388] venv API Docs for EnvBuilder.ensure_directories incorrectly describe behavior

2021-07-28 Thread Vinay Sajip


Change by Vinay Sajip :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

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



[issue43184] Missing docs for LoggerAdapter manager and name property

2021-07-28 Thread Vinay Sajip


Change by Vinay Sajip :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

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



[issue44399] log rotator cookbook example might waste disk space

2021-07-28 Thread Vinay Sajip


Change by Vinay Sajip :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

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



  1   2   3   4   5   6   7   8   9   10   >