id summary reporter owner description type status component version severity resolution keywords cc stage has_patch needs_docs needs_tests needs_better_patch easy ui_ux 27436 migrations.test_commands.MakeMigrationsTests fail on Windows when run on a different drive than C: Zbigniew Siciarz Zbigniew Siciarz "Some of the test cases in MakeMigrationsTests fail on Windows due to inability to find a relative path between files located on separate drives. The tests create a temporary migrations directory using `tempfile.mkdtemp`, which on Windows creates a directory under C:\Temp (or C:\Users\\AppData\Local\Temp). If one clones Django source code to a drive other than C:, then the makemigrations command tests fail with an error like the following (Windows 7, Python 3.5.1): {{{ ERROR: test_makemigrations_non_interactive_not_null_alteration (migrations.test_commands.MakeMigrationsTests) ---------------------------------------------------------------------- Traceback (most recent call last): File ""D:\dev\django\tests\migrations\test_commands.py"", line 834, in test_makemigrations_non_interactive_not_null_alteration call_command(""makemigrations"", ""migrations"", interactive=False, stdout=out) File ""d:\dev\django\django\core\management\__init__.py"", line 130, in call_command return command.execute(*args, **defaults) File ""d:\dev\django\django\core\management\base.py"", line 330, in execute output = self.handle(*args, **options) File ""d:\dev\django\django\core\management\commands\makemigrations.py"", line 193, in handle self.write_migration_files(changes) File ""d:\dev\django\django\core\management\commands\makemigrations.py"", line 211, in write_migration_files migration_string = os.path.relpath(writer.path) File ""D:\Miniconda3\lib\ntpath.py"", line 574, in relpath path_drive, start_drive)) ValueError: path is on mount 'C:', start on mount 'D:' }}} Since the value returned from `relpath` is used only for display and not for any I/O, I'd suggest catching this `ValueError` and using an absolute path in that case." Bug closed Core (Management commands) dev Normal fixed Ready for checkin 1 0 0 0 0 0