Ticket #6032 enhancement new

Opened 19 months ago

Last modified 9 months ago

make twisted.internet.endpoints importable on Windows when pywin32 is not installed

Reported by: tray Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: davidsarah Branch:
Author: Launchpad Bug:

Description (last modified by exarkun) (diff)

Using Twisted 12.2, twisted.internet.endpoints cannot be imported on Windows unless pywin32 is available:

 Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "twisted\web\client.py", line 21, in <module>
    from twisted.internet.endpoints import TCP4ClientEndpoint, SSL4ClientEndpoint
  File "twisted\internet\endpoints.py", line 28, in <module>
    from twisted.internet import stdio
  File "twisted\internet\stdio.py", line 28, in <module>
    from twisted.internet import _win32stdio
  File "twisted\internet\_win32stdio.py", line 7, in <module>
    import win32api
ImportError: No module named win32api

As demonstrated by this traceback, this also affects any module that depends on endpoints. The pywin32 dependency is only necessary for stdio; other endpoints should be usable even if it is not installed.

This likely requires a Windows version of the no-modules builder to be set up first - see < https://bugs.launchpad.net/twisted-buildbot-configuration/+bug/1059240>.

Change History

1

Changed 19 months ago by exarkun

  • priority changed from high to normal
  • type changed from regression to enhancement
  • description modified (diff)
  • summary changed from Either making pywin32 a requirement, or don't have endpoints break when it is missing to make twisted.internet.endpoints importable on Windows when pywin32 is not installed

2

Changed 19 months ago by exarkun

  • description modified (diff)

3

Changed 9 months ago by davidsarah

  • cc davidsarah added

This would fix Tahoe-LAFS ticket  https://tahoe-lafs.org/trac/tahoe-lafs/ticket/2028 .

Note: See TracTickets for help on using tickets.