classification
Title: fail on filename with space at the end
Type: behavior Stage: resolved
Components: Distutils, Distutils2 Versions: Python 3.2, Python 3.3, Python 3.4, Python 2.7, 3rd party
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: alexis, eric.araujo, loewis, steve.dower, tarek, techtonik, terry.reedy
Priority: normal Keywords:

Created on 2011-04-26 16:51 by techtonik, last changed 2021-02-03 18:30 by steve.dower. This issue is now closed.

Messages (8)
msg134480 - (view) Author: anatoly techtonik (techtonik) Date: 2011-04-26 16:51
I know this is a minor bug, but still.. Windows allows creation of filenames like "use MoveBufferArea " (note space at the end). When such file is present in current directory, `setup.py sdist` fails with `error: use MoveBufferArea : The system cannot find the file specified`.
msg134534 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-04-27 08:30
Do you get the bug if you put such a filename in the MANIFEST file, or MANIFEST.in, or data_files argument, or something else, or all of them?  If it’s a MANIFEST bug, can you test with quotes around the filename?
msg134539 - (view) Author: anatoly techtonik (techtonik) Date: 2011-04-27 09:24
The mere presence of this file in directory with setup.py files this error. It is not added in any files.
msg134540 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-04-27 09:26
Wow.  Can you set DISTUTILS_DEBUG=1 in your environment and then copy the full traceback here?  Try to see if other commands like build or check cause the error too.
msg134541 - (view) Author: anatoly techtonik (techtonik) Date: 2011-04-27 09:33
>python setup.py sdist
{{{
Distribution.parse_config_files():
options (after parsing config files):
no commands known yet
options (after parsing command line):
option dict for 'sdist' command:
  {}
running sdist
Distribution.get_command_obj(): creating 'sdist' command object
checking if setup.py newer than MANIFEST
error: some file : The system cannot find the file specified
Traceback (most recent call last):
  File "setup.py", line 17, in <module>
    'Operating System :: OS Independent',
  File "C:\Python25\lib\distutils\core.py", line 151, in setup
    dist.run_commands()
  File "C:\Python25\lib\distutils\dist.py", line 974, in run_commands
    self.run_command(cmd)
  File "C:\Python25\lib\distutils\dist.py", line 994, in run_command
    cmd_obj.run()
  File "C:\Python25\lib\distutils\command\sdist.py", line 143, in run
    self.get_file_list()
  File "C:\Python25\lib\distutils\command\sdist.py", line 237, in get_file_list
    self.filelist.findall()
  File "C:\Python25\lib\distutils\filelist.py", line 48, in findall
    self.allfiles = findall(dir)
  File "C:\Python25\lib\distutils\filelist.py", line 298, in findall
    stat = os.stat(fullname)
WindowsError: [Error 2] The system cannot find the file specified: 'some file '
}}}
msg134542 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-04-27 09:39
> WindowsError: [Error 2] The system cannot find the file specified: 'some file '

The strange thing is that the filename is correct (I feared it was a strip() call somewhere that caused the bug), and that you get a WindowsError.  This makes me think that the fault lies in the OS, not in distutils.  I can’t reproduce your bug on linux2.
msg134815 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2011-04-29 22:06
Windows Explorer does not so allow, but yes, Windows does. With xp
>>> os.stat('some file ')
nt.stat_result(st_mode=33206, st_ino=6473924464520118, st_dev=0, st_nlink=1, st_uid=0, st_gid=0, st_size=13, st_atime=1304114221, st_mtime=1304114055, st_ctime=1304113961)

Same with full path.

I would go into distutils\filelist.py and print(repr(fullname)) just before the os.stat call to see if there is anything strange. Maybe also try same call interactively like I did above, outside disutils context.
msg386430 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2021-02-03 18:30
Distutils is now deprecated (see PEP 632) and all tagged issues are being closed. From now until removal, only release blocking issues will be considered for distutils.

If this issue does not relate to distutils, please remove the component and reopen it. If you believe it still requires a fix, most likely the issue should be re-reported at https://github.com/pypa/setuptools
History
Date User Action Args
2021-02-03 18:30:37steve.dowersetstatus: open -> closed

nosy: + steve.dower
messages: + msg386430

resolution: out of date
stage: resolved
2013-10-14 01:43:13ezio.melottisettype: behavior
versions: + Python 3.4, - Python 3.1
2011-04-29 22:06:27terry.reedysetnosy: + terry.reedy
messages: + msg134815
2011-04-27 09:39:58eric.araujosetnosy: + loewis
messages: + msg134542
2011-04-27 09:33:54techtoniksetmessages: + msg134541
2011-04-27 09:26:23eric.araujosetmessages: + msg134540
2011-04-27 09:24:47techtoniksetmessages: + msg134539
2011-04-27 08:30:25eric.araujosetversions: + 3rd party, - Python 2.6, Python 2.5
nosy: + alexis

messages: + msg134534

assignee: tarek -> eric.araujo
components: + Distutils2
2011-04-26 16:52:06techtoniksettitle: fail if file with space at the end is present -> fail on filename with space at the end
2011-04-26 16:51:46techtonikcreate