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

Problems in Windows #21

Merged
merged 1 commit into from Jun 22, 2017

Conversation

Projects
None yet
2 participants
@mom1
Contributor

mom1 commented Jun 22, 2017

Приветствую!!!

Пример такой:

include(
'base/middleware.py',
'base/debug_toolbar.py',
'base/*.py',
)

glob возвращает для первого и второго параметра

C:...\project\settings\base/middleware.py
C:...\project\settings\base/debug_toolbar.py

glob возвращает для тех же файлов но с паттерном 'base/*.py'

C:...\project\settings\base\debug_toolbar.py
C:...\project\settings\base\middleware.py

В результате, MIDDLEWARE_CLASSES не содержит изменений из debug_toolbar

Problems in Windows
include(
'base/middleware.py',
'base/debug_toolbar.py',
'base/*.py',
)

glob return for first and second
C:\...\project\settings\base/middleware.py
C:\...\project\settings\base/debug_toolbar.py

glob return for 'base/*.py'
C:\...\project\settings\base\debug_toolbar.py
C:\...\project\settings\base\middleware.py

As a result, MIDDLEWARE_CLASSES does not contain any changes from debug_toolbar
@sobolevn

This comment has been minimized.

Owner

sobolevn commented Jun 22, 2017

Здравствуйте! Я предпочитаю на гитхабе использовать английский, чтобы другие пользователи понимали, что происходит.

Quick translation: there was an issue with glob ordering on windows.

glob is not really reliable. It's order may vary for different environments.
It is better to hardcode the ordering, if it is important. glob is useful in cases when you just need to include every file, and order does not really matter.

Does this addition fix issue with windows and globing?
Are there any other issues on windows?

Thanks!

@mom1

This comment has been minimized.

Contributor

mom1 commented Jun 22, 2017

Everything would be fine but the path file are different ( \ and / )
Because of this, the file import test fails and the file is imported again but not in the correct sequence.
os.path.abspath (included_file)
Converts path to platform format

Yes, this addition fix issue with windows and globing!
I did not find other problems!

@sobolevn sobolevn merged commit 0f037ae into sobolevn:master Jun 22, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@sobolevn

This comment has been minimized.

Owner

sobolevn commented Jun 22, 2017

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment