Commit Graph

276 Commits

Author SHA1 Message Date
Łukasz Langa ce9e625445 bpo-31457: Don't omit inner ``process()`` calls with nested LogAdapters (#4044)
This used to be the case on Python 2.  Commit
212b590e11 changed the implementation for Python
3, making the `log()` method of LogAdapter call `logger._log()` directly.  This
makes nested log adapters not execute their ``process()`` method.  This patch
fixes the issue.

Also, now proxying `name`, too, to make `repr()` work with nested log adapters.

New tests added.
2017-10-19 10:24:55 -07:00
Łukasz Langa 0b6a118a45 bpo-31457: Make the `LoggerAdapter.manager` property settable (#4042)
Due to a bug in the initial fix, the setter was in fact creating a different
property.  This is now fixed.
2017-10-18 17:28:51 -07:00
Christian Heimes a170fa162d bpo-31346: Use PROTOCOL_TLS_CLIENT/SERVER (#3058)
Replaces PROTOCOL_TLSv* and PROTOCOL_SSLv23 with PROTOCOL_TLS_CLIENT and
PROTOCOL_TLS_SERVER.

Signed-off-by: Christian Heimes <christian@python.org>
2017-09-15 20:27:30 +02:00
Victor Stinner b9b69003d9 bpo-31234: Add support.join_thread() helper (#3587)
join_thread() joins a thread but raises an AssertionError if the
thread is still alive after timeout seconds.
2017-09-14 14:40:56 -07:00
Łukasz Langa 1bbd482bcf bpo-31457: Allow for nested LoggerAdapter objects (#3551)
Some of the proxied methods use internal Logger state which isn't proxied,
causing failures if an adapter is applied to another adapter.

This commit fixes the issue, adds a new test for the use case.
2017-09-14 11:34:47 -04:00
Victor Stinner b8f4163da3 bpo-31233: socketserver.ThreadingMixIn.server_close() (#3523)
socketserver.ThreadingMixIn now keeps a list of non-daemonic threads
to wait until all these threads complete in server_close().

Reenable test_logging skipped tests.

Fix SocketHandlerTest.tearDown(): close the socket handler before
stopping the server, so the server can join threads.
2017-09-13 01:47:22 -07:00
Antoine Pitrou a6a4dc816d bpo-31370: Remove support for threads-less builds (#3385)
* Remove Setup.config
* Always define WITH_THREAD for compatibility.
2017-09-07 18:56:24 +02:00
Victor Stinner a7719e27b3 bpo-31235: Fix ResourceWarning in test_logging (#3147) 2017-08-19 00:34:00 +02:00
Victor Stinner 6966960468 bpo-30830: test_logging uses threading_setup/cleanup (#3137)
* bpo-30830: test_logging uses threading_setup/cleanup

Replace @support.reap_threads on some methods with
support.threading_setup() in setUp() and support.threading_cleanup()
in tearDown() in BaseTest.

* bpo-30830: test_logging disables threaded socketserver tests

Disable tests because of socketserver.ThreadingMixIn leaks threads,
whereas leaking threads now makes a test to fail on buildbots.

Disable tests until socketserver is fixed: bpo-31233.

* Skip also setup_via_listener()
2017-08-18 23:47:54 +02:00
Preston Landers 6ea56d2ebc bpo-31080: Allowed logging.config.fileConfig() to accept both args and kwargs. (GH-2979) 2017-08-02 21:44:28 +01:00
favll adfe3440f6 bpo-31084: QueueHandler now formats messages correctly. (GH-2954) 2017-08-01 19:12:26 +01:00
Vinay Sajip 2543f50033 bpo-30522: Implemented a method to allow setting a logging.StreamHander's stream. (GH-2921) 2017-07-30 10:41:45 +01:00
Avram Lubkin 78c18a9b9a bpo-30962: Added caching to Logger.isEnabledFor() (GH-2752) 2017-07-30 10:36:33 +01:00
Vinay Sajip 6260d9f203 bpo-30520: Implemented pickling for loggers. (#1956)
Implemented pickling for loggers.
2017-06-06 16:34:29 +01:00
Xiang Zhang 0b4b57df96 bpo-30378: Fix the problem that SysLogHandler can't handle IPv6 addresses (#1676) 2017-06-01 21:11:56 +08:00
Victor Stinner 8ca2f2faef bpo-30131: test_logging now joins queue threads (#1298)
QueueListenerTest of test_logging now closes the multiprocessing
Queue and joins its thread to prevent leaking dangling threads to
following tests.

Add also @support.reap_threads to detect earlier if a test leaks
threads (and try to "cleanup" these threads).
2017-04-26 15:56:25 +02:00
Victor Stinner 4bcfa3a236 bpo-30131: Cleanup threads in test_logging (#1275)
* Use @support.reap_threads on unit tests creating threads
* Call TestCase.fail() on thread.join(timeout) failure
2017-04-25 00:41:36 +02:00
Vinay Sajip d4f5001bac Issue #29220: Merged fixes from 3.6. 2017-01-11 17:44:07 +00:00
Vinay Sajip a861d48817 Issue #292Merged fixes from 3.5. 2017-01-11 17:41:28 +00:00
Vinay Sajip 924aaae4c2 Issue #29220: Improved fix and test. 2017-01-11 17:35:36 +00:00
Vinay Sajip 8b866d5429 Closes #29220: Fixed regression in logging.getLevelName(). 2017-01-11 06:57:55 +00:00
Vinay Sajip 9ebb245db8 Closes #29177: Merged fix from 3.6. 2017-01-09 16:55:24 +00:00
Vinay Sajip 1e6499c19c Fixes #29177: Improved resilience of logging tests which use socket servers.
Thanks to Xavier de Gaye for the report and patch improvements.
2017-01-09 16:54:12 +00:00
Vinay Sajip d489ac9102 Closes #28524: added default level for logging.disable(). 2016-12-31 11:40:11 +00:00
Xavier de Gaye d178e69ad8 Issue 28668: Merge 3.5 2016-11-15 17:03:12 +01:00
Xavier de Gaye 49e8f2d204 Issue 28668: Skip tests where instanciation of multiprocessing.Queue
would raise ImportError
2016-11-15 16:57:52 +01:00
Martin Panter 94332cba0f Issue #28480: Adjust or skip tests if multithreading is disabled 2016-10-20 05:10:44 +00:00
Vinay Sajip d61910c598 Fixes #27930: improved QueueListener behaviour. 2016-09-08 01:13:39 +01:00
Vinay Sajip db8f46321f Added back test code lost during merge. 2016-09-08 01:37:03 +01:00
Serhiy Storchaka a793037d80 Issue #19527: Fixed tests with defined COUNT_ALLOCS. 2016-07-03 22:27:26 +03:00
Vinay Sajip 1bf197eb14 Fixed #27251: corrected string/bytes handling in credentials. 2016-06-07 21:19:55 +01:00
Vinay Sajip 3f445f799a Closes #25411: Merged fix from 3.4. 2015-10-17 16:17:52 +01:00
Vinay Sajip 277640af0f Closes #25411: Improved Unicode support in SMTPHandler. 2015-10-17 16:13:10 +01:00
Zachary Ware 479ac6654c Issue #25097: Merge with 3.4 2015-10-06 15:28:56 -05:00
Zachary Ware 106ddf07b3 Issue #25097: Re-raise any other pywin32 error 2015-10-06 15:28:43 -05:00
Zachary Ware af34b248d1 Issue #25097: Merge with 3.4 2015-10-06 15:22:41 -05:00
Zachary Ware 22226c5595 Issue #25097: fix Windows error number access 2015-10-06 15:22:13 -05:00
Vinay Sajip d5963e615d Fixes #25097: Merged fi from 3.4. 2015-10-01 20:38:53 +01:00
Vinay Sajip 223349cfb8 Fixes #25097: Windows test is skipped if there are insufficient privileges, rather than failing. 2015-10-01 20:37:54 +01:00
Serhiy Storchaka 750eae1bd4 Issue #24678: Fixed raiseExceptions typo in logging tests.
Patch by Jacek Kołodziej.
2015-07-21 22:39:26 +03:00
Serhiy Storchaka 296b347db7 Issue #24678: Fixed raiseExceptions typo in logging tests.
Patch by Jacek Kołodziej.
2015-07-21 22:40:18 +03:00
Berker Peksag ce643913a9 Issue #9517: Move script_helper to the support package.
Patch by Christie Wilson.
2015-05-06 06:33:17 +03:00
Vinay Sajip 3505bd82a9 Issue #23207: merged fix from 3.4. 2015-03-18 08:49:57 +00:00
Vinay Sajip d55436ace3 Issue #23207: Improved kwarg validation. 2015-03-18 08:47:58 +00:00
Vinay Sajip 365701add9 Added respect_handler_level to QueueListener. 2015-02-09 19:49:00 +00:00
Ned Deily 3bbb37e09b Issue #23211: Fix patch for 3.4 differences. 2015-01-17 17:31:13 -08:00
Ned Deily cad3eb6d5d Issue #23211: merge from 3.4 2015-01-17 16:59:50 -08:00
Ned Deily 1e012e6c7f Issue #23211: Workaround test_logging failure on some OS X 10.6 systems:
getaddrinfo("localhost") can fail depending on the name server configuration,
use "127.0.0.0" instead.
2015-01-17 16:57:19 -08:00
Benjamin Peterson 43052a14c1 add context parameter to HTTPHandler (closes #22788) 2014-11-23 20:36:44 -06:00
Benjamin Peterson 6c22e65773 merge 3.4 (#22788) 2014-11-23 20:38:13 -06:00