On 07/10/2016 13:39, BartC wrote:
On 07/10/2016 06:30, Oz-in-DFW wrote:

I'm getting an error message on an os.path.getsize call;

But the main error appears to be due to the presence of quotes, whether
at each end, or inside the path, enclosing an element with spaces for
example. Try using len(path)>10000 instead; it might be near enough (the
10000 sounds arbitrary anyway).

Forget that. Apparently .getsize returns the size of the file not the length of the path! (That os.path. bit misled me.)

In that case just leave out the quotes. I don't think you need them even if the file-path contains embedded spaces. That would be an issue on a command-line (as spaces separate parameters), not inside a string.

But if quotes are present in user-input that represents a file-name, then they might need to be removed.

--
Bartc
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to