Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue28668

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:instanciation of multiprocessing.Queue raises ImportError in test_logging
Type:behaviorStage:resolved
Components:TestsVersions:Python 3.7, Python 3.6, Python 3.5
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: davin, python-dev, serhiy.storchaka, vinay.sajip, xdegaye
Priority:normalKeywords:patch

Created on2016-11-11 15:48 byxdegaye, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
test__multiprocessing_queue.patchxdegaye,2016-11-11 15:47review
test_multiprocessing_queue_2.patchxdegaye,2016-11-12 10:46using a plain decorator with no argumentreview
Pull Requests
URLStatusLinkedEdit
PR 4560mergedxdegaye,2017-11-25 14:33
Messages (9)
msg280589 -(view)Author: Xavier de Gaye (xdegaye)*(Python triager)Date: 2016-11-11 15:47
Occurs on Android that has a broken shared semaphore implementation (issue 26924).Patch attached.One of the backtraces:======================================================================ERROR: test_handle_called_with_mp_queue (test.test_logging.QueueListenerTest)----------------------------------------------------------------------Traceback (most recent call last):  File "/sdcard/org.bitbucket.pyona/lib/python3.7/multiprocessing/synchronize.py", line 29, in <module>    from _multiprocessing import SemLock, sem_unlinkImportError: cannot import name 'sem_unlink'During handling of the above exception, another exception occurred:Traceback (most recent call last):  File "/sdcard/org.bitbucket.pyona/lib/python3.7/unittest/mock.py", line 1179, in patched    return func(*args, **keywargs)  File "/sdcard/org.bitbucket.pyona/lib/python3.7/test/test_logging.py", line 3130, in test_handle_called_with_mp_queue    log_queue = multiprocessing.Queue()  File "/sdcard/org.bitbucket.pyona/lib/python3.7/multiprocessing/context.py", line 102, in Queue    return Queue(maxsize, ctx=self.get_context())  File "/sdcard/org.bitbucket.pyona/lib/python3.7/multiprocessing/queues.py", line 39, in __init__    from .synchronize import SEM_VALUE_MAX as maxsize  File "/sdcard/org.bitbucket.pyona/lib/python3.7/multiprocessing/synchronize.py", line 34, in <module>    " function, seeissue 3770.")ImportError: This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, seeissue 3770.
msg280593 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2016-11-11 16:16
The decorator doesn't need arguments. I would make it similar to skip_unless_symlink.
msg280649 -(view)Author: Xavier de Gaye (xdegaye)*(Python triager)Date: 2016-11-12 10:46
When the test is to be skipped:  * The decorator in the previous patch (a decorator with arguments that takes no argument) returns a decorator which is unittest.skip (to be applied to the test method).  * On the other side, the skip_unless_symlink decorator pattern (no argument) applies the unittest.skip decorator to the test method and returns the decorated test method.This new patch uses the second method suggested by Serhiy.
msg280651 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2016-11-12 11:18
requires_multiprocessing_queue is used only in test_logging. Is it worth to add it in test.support?
msg280654 -(view)Author: Xavier de Gaye (xdegaye)*(Python triager)Date: 2016-11-12 12:12
IMHO other tests in the future may instantiate multiprocessing.Queue() and come up with another new decorator when the test fails on the (yet to come) Android buildbot, ignoring that one already exists if we move the decorator to the test_logging module.
msg280660 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2016-11-12 12:41
Okay. test_multiprocessing_queue_2.patch LGTM.
msg280862 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2016-11-15 16:06
New changeseta377e6987821 by Xavier de Gaye in branch '3.5':Issue 28668: Skip tests where instanciation of multiprocessing.Queuehttps://hg.python.org/cpython/rev/a377e6987821New changesete5404ba1b19e by Xavier de Gaye in branch '3.6':Issue 28668: Merge 3.5https://hg.python.org/cpython/rev/e5404ba1b19eNew changeset1f0b0ecf7dc1 by Xavier de Gaye in branch 'default':Issue 28668: Merge 3.6https://hg.python.org/cpython/rev/1f0b0ecf7dc1
msg306958 -(view)Author: Xavier de Gaye (xdegaye)*(Python triager)Date: 2017-11-25 14:40
The multiprocessing module is not functional when the multiprocessing.synchronize module cannot be imported and all the multiprocessing tests are skipped in that case. Use the same idiom (i.e. test.support.import_module('multiprocessing.synchronize')) to skip the tests when the platform sem_open implementation is broken and remove test.support.requires_multiprocessing_queue.
msg307366 -(view)Author: Xavier de Gaye (xdegaye)*(Python triager)Date: 2017-12-01 07:08
New changesetbf2b65e413ca5ec705c7e2f463d0d75e947588a4 by xdegaye in branch 'master':bpo-28668: test.support.requires_multiprocessing_queue is removed (GH-4560)https://github.com/python/cpython/commit/bf2b65e413ca5ec705c7e2f463d0d75e947588a4
History
DateUserActionArgs
2022-04-11 14:58:39adminsetgithub: 72854
2017-12-01 07:09:37xdegayesetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2017-12-01 07:08:51xdegayesetmessages: +msg307366
2017-11-25 14:40:48xdegayesetstatus: closed -> open
resolution: fixed -> (no value)
messages: +msg306958

stage: resolved -> patch review
2017-11-25 14:33:14xdegayesetpull_requests: +pull_request4489
2016-11-15 18:51:55xdegayesetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2016-11-15 16:06:56python-devsetnosy: +python-dev
messages: +msg280862
2016-11-12 12:41:54serhiy.storchakasetmessages: +msg280660
2016-11-12 12:12:28xdegayesetmessages: +msg280654
2016-11-12 11:38:54xdegayelinkissue26865 dependencies
2016-11-12 11:18:30serhiy.storchakasetmessages: +msg280651
2016-11-12 10:46:29xdegayesetfiles: +test_multiprocessing_queue_2.patch

messages: +msg280649
2016-11-11 20:01:41davinsetnosy: +davin
2016-11-11 16:16:17serhiy.storchakasetnosy: +serhiy.storchaka
messages: +msg280593
2016-11-11 15:48:00xdegayecreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp