python 2.7 - Mock import of ctypes fails with unsupported operand on Read The Docs -
i have small windows module relies on ctypes core module. on project rtd site page module comes empty. looking @ latest successful build log https://readthedocs.org/builds/apt/2900858/ there failure during make html stage.
file "/var/build/user_builds/apt/checkouts/latest/knownpaths.py", line 5, in <module> ctypes import windll, wintypes file "/usr/lib/python2.7/ctypes/wintypes.py", line 23, in <module> class variant_bool(_simplecdata): valueerror: _type_ 'v' not supported
following faq entry https://read-the-docs.readthedocs.org/en/latest/faq.html#i-get-import-errors-on-libraries-that-depend-on-c-modules tried fake import ctypes using mock
, doing cause build fail completely. can tell, i'm no means expert in area, it's because mock missing math functions:
file "/var/build/user_builds/apt/checkouts/latest/knownpaths.py", line 13, in guid ("data4", wintypes.byte * 8) typeerror: unsupported operand type(s) *: 'mock' , 'int'
research on error leads 3 search hits, relevant mock missing (at least) true division operator: https://mail.python.org/pipermail/python-bugs-list/2014-march/235709.html
am following right path? can ctypes used in project on rtd , need persevere, or need give , use sphinx local machine?
here current mock block my conf.py:
try: #py3 import unittest.mock import magicmock except importerror: #py27 import mock import mock magicmock class mock(magicmock): @classmethod def __getattr__(cls, name): return mock() mock_modules = ['ctypes'] sys.modules.update((mod_name, mock()) mod_name in mock_modules)
// cross post https://github.com/rtfd/readthedocs.org/issues/1342. 0 responses after week looking farther afield. //
initially thought ctypes needed mocked, turns out needed work closer home , mock module calls ctypes, not ctypes itself.
- mock_modules = ['ctypes'] + mock_modules = ['knownpaths']
thank @dunes, comment thought off-track , not going help. gave enough of turning mind , path of investigation land me in right place after all. not teachings teaching when first grace one's attention. ;-)
Comments
Post a Comment