pyflakes script not executable on Windows

Bug #794331 reported by Jason R. Coombs
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Pyflakes
Fix Released
Low
Unassigned

Bug Description

Pyflakes script is installed on Windows without any extension. As a result, on Windows, it has no file type and cannot be executed from a command-line. Consider using setuptools console_script entry_points or adding a .py extension when installing under Windows.

PS C:\Users\jaraco> easy_install pyflakes
Searching for pyflakes
Reading http://pypi.python.org/simple/pyflakes/
Reading http://www.divmod.org/projects/pyflakes
Reading http://www.divmod.org/trac/wiki/DivmodPyflakes
Best match: pyflakes 0.4.0
Downloading http://pypi.python.org/packages/source/p/pyflakes/pyflakes-0.4.0.tar.gz#md5=630a72510aae8758f48cf60e4fa17176
Processing pyflakes-0.4.0.tar.gz
Running pyflakes-0.4.0\setup.py -q bdist_egg --dist-dir c:\users\jaraco\appdata\local\temp\easy_install-bi_1bs\pyflakes-0.4.0\egg-dist-tmp-u6vcvn
hgtools.SubprocessManager('.') could not find files: abort: There is no Mercurial repository here (.hg not found)!
zip_safe flag not set; analyzing archive contents...
pyflakes.checker: module references __file__
pyflakes.checker: module references __path__
pyflakes.test.test_undefined_names: module references __file__
pyflakes.test.test_undefined_names: module references __path__
Adding pyflakes 0.4.0 to easy-install.pth file
Installing pyflakes script to C:\Python\Scripts

Installed c:\python\lib\site-packages\pyflakes-0.4.0-py2.7.egg
Processing dependencies for pyflakes
Finished processing dependencies for pyflakes

Revision history for this message
Michael Foord (mfoord) wrote :

I get this trying to use pyflakes on Windows (Python 2.6 - windows 7 - pyflakes 0.4.0):

C:\My Dropbox\RoboRally\RoboRallyIronPython
> pyflakes MyBrain.py
Traceback (most recent call last):
  File "C:\Python26\Scripts\pyflakes.py", line 3, in <module>
    from pyflakes.scripts.pyflakes import main
  File "C:\Python26\Scripts\pyflakes.py", line 3, in <module>
    from pyflakes.scripts.pyflakes import main
ImportError: No module named scripts.pyflakes

That is after installation with easy_install. Using pip it doesn't install an executable script for Windows at all.

Revision history for this message
Sorin Sbarnea (ssbarnea) wrote :

In fact pyflakes doesnt install an executable at all on windows. It must install a pyflakes.bat with the following content

@echo off
rem Use python to execute the python script having the same name as this batch
rem file, but without any extension, located in the same directory as this
rem batch file
python "%~dpn0" %*

I have 22 other scripts following the same recipe, or you could try to comeone with an pyflakes.exe but I'm sure it's not what you want.

Revision history for this message
Lorenzo Bolognini (lbolognini) wrote :

The fix for this is super easy. Just rename the Scripts\pyflakes file something like runpyflakes also if it had an extension it would be nice.

Solution for this bug was found here:

http://stackoverflow.com/questions/11444245/how-can-i-get-pyflakes-to-run-on-windows

Revision history for this message
Florent (florent.x) wrote :

The missing entry_point is proposed in this patch:
http://bazaar.launchpad.net/~witsch/divmod.org/Pyflakes/revision/2699

Florent (florent.x)
Changed in pyflakes:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Florent (florent.x) wrote :

Merged with revision 60 (rev 59.1.4)

Changed in pyflakes:
status: Confirmed → Fix Committed
Florent (florent.x)
Changed in pyflakes:
milestone: none → 0.6.1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.