Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhelpful traceback if sdk_dir is None #600

Closed
ghost opened this issue May 29, 2012 · 2 comments
Closed

Unhelpful traceback if sdk_dir is None #600

ghost opened this issue May 29, 2012 · 2 comments

Comments

@ghost
Copy link

ghost commented May 29, 2012

In setup.py, the global variable sdk_dir is set on line 310 by find_platform_sdk_dir().

If find_platform_sdk_dir() can't find a Platform SDK it returns None, since os.environ.get("MSSdk") on line 162 returns None.

Later, sdk_dir is used as the first argument to os.path.join on line 604, but this fails with a slightly unhelpful traceback:

Traceback (most recent call last):
File "setup.py", line 1945, in <module>
""" % dirs).split(),
File "setup.py", line 604, in __init__
if os.path.isfile(os.path.join(sdk_dir, "include", "activdbg.h")):
File "H:\external\local_windows_32_vc8\python27\lib\ntpath.py", line 96, in join
assert len(path) > 0
TypeError: object of type 'NoneType' has no len()

A check for "if sdk_dir is None" after line 310 with a relevant error messge would be nice :-)

I'm hitting this problem because I'm building with Visual Studio 2005, whose Platform SDK is at C:\Program Files (x86)\Microsoft Visual Studio 8\VC\PlatformSDK (on a 64bit system, but building the 32bit binaries).

Thanks for all the hard work on this package!

Reported by: stevenwinfield

Original Ticket: pywin32/bugs/600

@ghost
Copy link
Author

ghost commented Feb 12, 2016

Having the same issue when running through Wine.

Original comment by: wernight

@ghost ghost assigned ghost and unassigned ghost Oct 24, 2017
@Avasam
Copy link
Collaborator

Avasam commented Mar 12, 2024

@mhammond I believe this should be closed by #1936

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants