From e7a98b150fc7c08562889ee2ec2773253ba4fb38 2013-04-24 04:07:58 From: Min RK Date: 2013-04-24 04:07:58 Subject: [PATCH] Merge pull request #3212 from jusic/master fix check_startup_dir inside py2exe On Windows inside a py2exe'd environment, README_STARTUP does not get copied into library.zip. Added a warning and a skip if the file IPython/config/profile/README_STARTUP is missing. closes #2563 --- diff --git a/IPython/core/profiledir.py b/IPython/core/profiledir.py index ba6861f..536dff6 100644 --- a/IPython/core/profiledir.py +++ b/IPython/core/profiledir.py @@ -100,7 +100,11 @@ class ProfileDir(LoggingConfigurable): os.mkdir(self.startup_dir) readme = os.path.join(self.startup_dir, 'README') src = os.path.join(get_ipython_package_dir(), u'config', u'profile', u'README_STARTUP') - if not os.path.exists(readme): + + if not os.path.exists(src): + self.log.warn("Could not copy README_STARTUP to startup dir. Source file %s does not exist." % src) + + if os.path.exists(src) and not os.path.exists(readme): shutil.copy(src, readme) def _security_dir_changed(self, name, old, new):