question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Spaces in file names are looking for troubles

See original GitHub issue

What is the purpose of naming a file script (dev).tmpl? Oh, I see, to prove that Setuptools can support funny file names. Great.

I read bug #134, and especially jaraco’s comment on Jan 3, 2016. There is a third principle, besides least astonishment and robustness, and it is the readability. As an invisible character, a space cannot be distinguished from other invisible characters, such as tab and a plethora of UTF-8 space variations. How easily can you tell script (dev).tmpl from script (dev).tmpl? (Hint: one of them has multiple spaces, but you need to inspect HTML code to tell). An accidental misspell can hardly catch your eyeballs.

Certainly, script-dev.tmpl would have looked too simple, eh? So here’s a fourth principle, KISS.

The URI syntax (rfc3986) provides for a set of unreserved characters (ALPHA / DIGIT / "-" / "." / "_" / "~"), whereby the rest, including spaces, has to be percent-encoded. What doddering fools!

Email syntax allows for spaces in the local-part of an email address, provided that spaces are quoted. However, SMTP wording is “a host that expects to receive mail SHOULD avoid [them]”.

Some SQL implementation provide for spaces in variable names. I’d guess you’re looking forward for the next version of Python to support a similar feature too, possibly varying quotation styles from a version to the next. Real progress, eh?

I hope I didn’t annoy you by re-opening a bug that you consider a feature. I guess I won’t be the last one, until you fix it.

Best Ale

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
jaracocommented, Mar 21, 2019

Sorry, but spaces are valid in filenames and systems and tools should support them.

2reactions
RuRocommented, Jan 7, 2020

Have you considered renaming the file to

script\x00 (🥴`'); DROP TABLE packages;--.tmpl‮

? I think, that will significantly increase the “strength” of this file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What technical reasons exist for not using space characters in ...
If you think spaces are bad, try dealing with files with newlines ( '\n' ) in their names. (Unix-like systems actually allow this;...
Read more >
Why shouldn't spaces be used in filenames on the computer?
All modern filesystems handle spaces in filenames without any problems, and they often make the names more readable and easy to understand.
Read more >
Will spaces in filenames cause problems for AEM?
Solved: Hello. We have users who are uploading files and creating directories with spaces in their names. We discovered the existence of ...
Read more >
Spaces in file names make it impossible to package for Solaris ...
The script template.py file name causes packaging of setuptools to fail, because the Solaris 8, 9, ... Spaces in file names are looking...
Read more >
c# - Spaces in filenames causing problem - Stack Overflow
When I tried to print file names with spaces it's adding '#' in the place of space in file name which creating problems...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found