Digital-Sapphire/PyUpdater

Whitespace in app name is preserved in filenames

dennisvang opened this issue · 5 comments

Summary

Suppose our app name is "My App", then after building e.g. version 1.0 on windows, filenames for the archive and the executable (inside the archive), are "My App-win-1.0.zip" and "My App.exe", respectively.

Problem

Spaces (and capitals) in path names can be problematic.

How to reproduce

  1. Create a new app, initialize pyupdater with an app name that contains whitespace, e.g. "My App"
  2. Run pyupdater build ...

Observed behavior

Archive and executable filenames contain whitespace, e.g. "My App-win-1.0.zip" and "My App.exe"

Expected behavior

I would expect whitespace to be replaced by dashes or underscores.
Moreover, I would expect lowercase output.

For example: "my-app-win-1.0.zip" and "my-app.exe"

Can you explain why embedded spaces in path names can be a problem? Windows uses them all the time, e.g. in Program Files. Works fine with anything where you aren't typing the full filename, and in CMD, filename completion will automagically quote file paths with spaces.Yes, it hasn't been standard in Unix, but again, filename completion will -quote the spaces.

@RussNelson There are just too many things that can go wrong, e.g. when scripting.

Just type "whitespace path bug", or something similar, into your favourite search engine.

I agree. A problem in Linux. Not Windows. Windows users expect filenames to have spaces. If you're going to complain about a problem on Linux, then you shouldn't use a Windows package as an example.

I agree. A problem in Linux. Not Windows. Windows users expect filenames to have spaces. ...

Plenty of whitespace confusion on Windows too.

... If you're going to complain about a problem on Linux, then you shouldn't use a Windows package as an example.

PyUpdater is not a "Windows package."
It supports Windows, macOS, Linux, and more.

Let's say, then, that your change would be accepted. How would people specify that they want their program name to be passed-through to the filename with no changes?