Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using should check case of file name #12586

Closed
eschnett opened this issue Aug 12, 2015 · 6 comments
Closed

using should check case of file name #12586

eschnett opened this issue Aug 12, 2015 · 6 comments

Comments

@eschnett
Copy link
Contributor

I accidentally typed using hDF5, and Julia accepted this. This should not have worked; the proper module name is HDF5 (with all upper case letters).

I am using OS X with a case-insensitive file system. That is, while the case of the file name is ignored when looking for a file, the file name still has a particular case that can be checked.

I would have expected Julia to reject the command using hDF5 by noting that yes, there is a file that can be opened under the name hDF5.jl, but this file's name is actually HDF5.jl, so it doesn't match.

@StefanKarpinski
Copy link
Member

Yes, this would be a very good thing to change. When searching for filenames with using, we should additionally check that that the canonical name of the found file matches the expected case of it and not consider it to be a match if it doesn't, and thus continue to search. We may want to do the same for include, although that's less clear since that's more of a "load this file and eval it".

@ScottPJones
Copy link
Contributor

This would be very good, I think it should also be done for include, to help prevent case typos from silently working on Windows and OS X case-insensitive file systems, and then code failing when moved to Unix/Linux or an OS X case-sensitive file system (like I normally use now).

@stevengj
Copy link
Member

See also #9007 and Python PEP 235. (Python just implemented its own directory walking to solve this.)

@Sisyphuss
Copy link

I don't think that worth the work. Making it case sensitive is only a burden to the brain: 'TimeIt', "Timeit", or "timeit"? In addition, it will encourage people to use the same name with different cases to name different packages.

@stevengj
Copy link
Member

@Sisyphuss, even if we wanted to allow case insensitivity (which would be inconsistent with the rest of Julia), the problem is that the behavior is inconsistent between platforms.

@malmaud
Copy link
Contributor

malmaud commented Oct 11, 2015

Dup of #5789. Would be nice to get this fixed.

@malmaud malmaud closed this as completed Oct 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants