Grokproject error for first time Windows users
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grok |
Fix Released
|
High
|
Uli Fouquet |
Bug Description
There is a rather hidden problem with Grokproject that occurs when
running it for the first time under the Windows OS without the win32api
module being available. It can also occur when win32api is available in
the system Python site-packages, but the user is working in a virtual
environment created using "virtualenv --no-site-
This is related to the fix applied for the bug:
https:/
Which addressed problems with Window paths with spaces.
The problem only occurs when initially creating the file "default.cfg"
in the default location of:
"C:\Documents and Settings\
If the file does not exist and an explicit eggs_dir path is not
provided, an attempt is made to create the file.
buildout_default = exist_buildout_
if explicit_eggs_dir:
# Put explicit_eggs_dir in the vars; used by the post command.
vars[
vars[
'# Warning: when you share this buildout.cfg with friends\n'
'# please remove the eggs-directory line as it is hardcoded.\n'
elif buildout_default:
vars[
else:
create_
However, the creation method does a conditional import of win32api which
fails.
def create_
default_dir = os.path.join(HOME, '.buildout')
if not os.path.
eggs_dir = os.path.
if not os.path.
if sys.platform == 'win32':
# Fix for paths with spaces on Windows.
# See https:/
import win32api
eggs_dir = win32api.
default_cfg = os.path.join(HOME, '.buildout', 'default.cfg')
if not os.path.
contents = """[buildout]
eggs-directory = %s
""" % (eggs_dir)
After running grokproject and providing the user and passwd inputs, the
user receives:
Enter user (Name of an initial administrator user): grok
Enter passwd (Password for the initial administrator user):
Downloading info about versions...
Traceback (most recent call last):
File "C:\vgrok\
load_
File "C:\vgrok\
File "C:\vgrok\
File "C:\vgrok\
File "C:\vgrok\
File "C:\vgrok\
lt_file
import win32api
ImportError: No module named win32api
Would it be possible for Grokproject to check for the availability of
the module and either output a sensible warning to the user, or possibly
easy_install pywin32 to satisfy its own requirement?
The people that are likely to run into this will be first time users of
grokproject and buildout, so it will probably be a source of continuing
confusion and questions until the virtualenv developers start to handle
this upstream.
Changed in grok: | |
status: | Fix Committed → Fix Released |
Thanks Steve for the report! I'll look into this tomorrow and hope to have a fix really soon as this could really be a nasty showstopper on win32.
If one of the more win32-oriented developers has a suggestion, please tell!