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.

classification
Title: Minor changes to logging
Type: Stage:
Components: Library (Lib) Versions: Python 2.3
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: nnorwitz Nosy List: gvanrossum, nnorwitz, vinay.sajip
Priority: high Keywords: patch

Created on 2003-04-22 22:37 by vinay.sajip, last changed 2022-04-10 16:08 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
logging.patch vinay.sajip, 2003-04-22 22:37 Patch file for changes to logging
test_logging.zip vinay.sajip, 2003-04-25 10:18 Updated test_logging.py and output/test_logging
Messages (9)
msg43454 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2003-04-22 22:37
__init__.py:
1. Updated version number to 0.4.8 and status to beta.
handlers.py:
1. Replaced explicit Python version check with hasattr to 
determine the running Python's capability.
2. Added Date: header to SMTPHandler
3. Changed HTTPHandler to allow more flexible mapping 
of a LogRecord to a dictionary to be urlencoded.

Regression test ran OK on my system after these 
changes were made.
msg43455 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2003-04-23 00:29
Logged In: YES 
user_id=6380

Unassigning and accepting; someone else please apply this!
msg43456 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-04-23 03:52
Logged In: YES 
user_id=33168

Checked in as:
 * Lib/logging/__init__.py: 1.9
 * Lib/logging/handlers.py: 1.6

I still have the test failure problem.  It's more consistent
on Redhat 9.  Adding a time.sleep(.1) to the test as the
first statement in the finally: in test_main() (line 458)
"fixes" the problem.  Although this is a hack that I don't
want to check in.
msg43457 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2003-04-23 18:22
Logged In: YES 
user_id=6380

If adding a small sleep to the code "fixes" the problem,
there is still a more fundamental problem with the tests.
Vinaj, can you look into this? Do you understand the issue?
I wonder if maybe the tests shouldn't be thread-based at all.

It is okay if this doesn't get resolved before the b1
release; there will be a b2 release a month later. (As long
as it doesn't require API changes -- bugfixes or changes to
the test suite are okay though.)
msg43458 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2003-04-23 22:46
Logged In: YES 
user_id=308438

I can try to look into this, although I don't have access to Red 
Hat 9. I have limited access to Mandrake 9 and will try to run 
tests in that environment; I may not be able to reproduce it. I 
have no problem with simplifying the test - the reason for 
using threads is to give the logging system a reasonably good 
workout. test_logging.py is already quite a bit simpler than 
the test harness I use personally. While the test does create 
threads, it does seem to follow established practice and there 
is no obvious (to me) reason for the problem.

Resolving this issue should not require a change to the API - if 
the worst comes to the worst, we can simplify test_logging to 
do minimal logic tests for logger/handler logic.
msg43459 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2003-04-24 00:32
Logged In: YES 
user_id=6380

Vinaj, I suggest that you don't focus on trying to reproduce
the problem but study the way you have structured the tests
to show to yourself that it *is* possible.  Then think about
a restructuring that avoids this.  E.g. by using an event
variable (see the threading module).  If that doesn't work
for Python 1.5.2,  that doesn't matter IMO.
msg43460 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2003-04-25 10:18
Logged In: YES 
user_id=308438

I attach an updated test_logging.py and output/test_logging 
which avoids the use of thread.join() and uses a condition 
variable instead to synchronize threads. In addition, the TCP 
thread automatically terminates when it sees an end-of-test 
sentinel.
msg43461 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2003-04-25 14:22
Logged In: YES 
user_id=6380

Thanks, checked in!
msg43462 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2003-04-25 14:34
Logged In: YES 
user_id=33168

The test works now on both Redhat 9 and Solaris 8!  Thanks
Vinay.
History
Date User Action Args
2022-04-10 16:08:16adminsetgithub: 38349
2003-04-22 22:37:20vinay.sajipcreate