Skip to content
New issue

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

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

Already on GitHub? # to your account

Problems in Windows #21

Merged
merged 1 commit into from
Jun 22, 2017
Merged

Problems in Windows #21

merged 1 commit into from
Jun 22, 2017

Conversation

mom1
Copy link
Contributor

@mom1 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

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
Copy link
Member

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

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
Copy link
Contributor Author

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 wemake-services:master Jun 22, 2017
@sobolevn
Copy link
Member

Thanks for your contribution!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants