Git Product home page Git Product logo

Comments (8)

lidanqing123 avatar lidanqing123 commented on June 24, 2024

图片

from nuitka.

lidanqing123 avatar lidanqing123 commented on June 24, 2024

https://learn.microsoft.com/en-us/windows/wsl/case-sensitivity

from nuitka.

kayhayen avatar kayhayen commented on June 24, 2024

I removed one use of it the other day, where it checks for .ico suffix, simply because it is code duplication with hasFileExtension but I guess, that one does it too.

from nuitka.

kayhayen avatar kayhayen commented on June 24, 2024

Using os.path.normpath does not allow for case insensitive approaches, so Python doesn't support it. I only tried with 3.10, but that what matters. So it seems we need our own function. The below code illustrates the main use of it. A new function that takes your setting into account is definitely doable, lets see if we find something existing.

def areSamePaths(path1, path2):
    """Decide if two paths the same.

    Args:
        path1: First path
        path2: Second path

    Returns:
        Boolean value indicating if the two paths point to the
        same path.

    Notes:

        Case differences ignored on platforms where that is the
        norm, and with it normalized, and turned absolute paths, and
        even short paths, it then becomes a mere string compare after that.
    """

    path1 = os.path.abspath(os.path.normpath(path1))
    path2 = os.path.abspath(os.path.normpath(path2))

    if os.path.exists(path1) and os.path.exists(path2):
        path1 = getExternalUsePath(path1)
        path2 = getExternalUsePath(path2)

    path1 = os.path.normcase(path1)
    path2 = os.path.normcase(path2)

    return path1 == path2

from nuitka.

kayhayen avatar kayhayen commented on June 24, 2024

I have replaced uses of assignments from os.path.normcase that then can cause these filenames to be wrong, there were a few more things like that, and the code could be done better in all cases by using APIs that compare without modifying.

Generally it cannot be avoided. Comparisons cannot be made real, i.e. it's virtually impossible to detect if a folder has this attribute set in Python. The C API for that is very ugly, and even then, it's very unclear when it must be done or not, e.g. when searching for a module, when it's filename based and wrong in Python or not.

But I believe it might work better for you now.

from nuitka.

kayhayen avatar kayhayen commented on June 24, 2024

Thanks for your report, this is fixed on the factory branch, which is a development version under rapid development. You can try it out by going here: https://nuitka.net/doc/factory.html

Feedback if this is working is very welcome, just please do not share plans of doing it, but rather confirmations or denials of it working.

from nuitka.

kayhayen avatar kayhayen commented on June 24, 2024

These changes are now on develop, let me know if it works for you now.

from nuitka.

kayhayen avatar kayhayen commented on June 24, 2024

This is part of the stable release 2.0 that I just made.

from nuitka.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.