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

find_file errors on windows #1908

Closed
jstenar opened this issue Jun 11, 2012 · 5 comments
Closed

find_file errors on windows #1908

jstenar opened this issue Jun 11, 2012 · 5 comments

Comments

@jstenar
Copy link
Member

jstenar commented Jun 11, 2012

Commit 275c90e introduced a failing test.

======================================================================
FAIL: IPython.core.tests.test_oinspect.test_find_file
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\python27\lib\site-packages\nose\case.py", line 197, in runTest
    self.test(*self.arg)
  File "C:\python27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\core\tests\test_oinspect.py", line 53, in test_find_file
    os.path.abspath(__file__))
AssertionError: 'c:\\python27\\lib\\site-packages\\ipython-0.13.dev-py2.7.egg\\ipython\\core\\tests\\test_oinspect.py' != 'C:\\python27\\lib\\site-packages\\ipython-0.13.dev-py2.7.egg\\IPython\\core\\tests\\test_oinspect.pyc'
    "'c:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\ipython\\\\core\\\\tests\\\\test_oinspect.py' != 'C:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\IPython\\\\core\\\\tests\\\\test_oinspect.pyc'" = '%s != %s' % (safe_repr('c:\\python27\\lib\\site-packages\\ipython-0.13.dev-py2.7.egg\\ipython\\core\\tests\\test_oinspect.py'), safe_repr('C:\\python27\\lib\\site-packages\\ipython-0.13.dev-py2.7.egg\\IPython\\core\\tests\\test_oinspect.pyc'))
    "'c:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\ipython\\\\core\\\\tests\\\\test_oinspect.py' != 'C:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\IPython\\\\core\\\\tests\\\\test_oinspect.pyc'" = self._formatMessage("'c:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\ipython\\\\core\\\\tests\\\\test_oinspect.py' != 'C:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\IPython\\\\core\\\\tests\\\\test_oinspect.pyc'", "'c:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\ipython\\\\core\\\\tests\\\\test_oinspect.py' != 'C:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\IPython\\\\core\\\\tests\\\\test_oinspect.pyc'")
>>  raise self.failureException("'c:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\ipython\\\\core\\\\tests\\\\test_oinspect.py' != 'C:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\IPython\\\\core\\\\tests\\\\test_oinspect.pyc'")
@jstenar
Copy link
Member Author

jstenar commented Jun 11, 2012

Commit 842dc5e introduces two more:

======================================================================
FAIL: IPython.core.tests.test_oinspect.test_find_file_decorated1
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\python27\lib\site-packages\nose\case.py", line 197, in runTest
    self.test(*self.arg)
  File "C:\python27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\core\tests\test_oinspect.py", line 71, in test_find_file_decorated1
    os.path.abspath(__file__))
AssertionError: 'c:\\python27\\lib\\site-packages\\ipython-0.13.dev-py2.7.egg\\ipython\\core\\tests\\test_oinspect.py' != 'C:\\python27\\lib\\site-packages\\ipython-0.13.dev-py2.7.egg\\IPython\\core\\tests\\test_oinspect.pyc'
    "'c:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\ipython\\\\core\\\\tests\\\\test_oinspect.py' != 'C:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\IPython\\\\core\\\\tests\\\\test_oinspect.pyc'" = '%s != %s' % (safe_repr('c:\\python27\\lib\\site-packages\\ipython-0.13.dev-py2.7.egg\\ipython\\core\\tests\\test_oinspect.py'), safe_repr('C:\\python27\\lib\\site-packages\\ipython-0.13.dev-py2.7.egg\\IPython\\core\\tests\\test_oinspect.pyc'))
    "'c:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\ipython\\\\core\\\\tests\\\\test_oinspect.py' != 'C:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\IPython\\\\core\\\\tests\\\\test_oinspect.pyc'" = self._formatMessage("'c:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\ipython\\\\core\\\\tests\\\\test_oinspect.py' != 'C:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\IPython\\\\core\\\\tests\\\\test_oinspect.pyc'", "'c:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\ipython\\\\core\\\\tests\\\\test_oinspect.py' != 'C:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\IPython\\\\core\\\\tests\\\\test_oinspect.pyc'")
>>  raise self.failureException("'c:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\ipython\\\\core\\\\tests\\\\test_oinspect.py' != 'C:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\IPython\\\\core\\\\tests\\\\test_oinspect.pyc'")


======================================================================
FAIL: IPython.core.tests.test_oinspect.test_find_file_decorated2
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\python27\lib\site-packages\nose\case.py", line 197, in runTest
    self.test(*self.arg)
  File "C:\python27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\core\tests\test_oinspect.py", line 86, in test_find_file_decorated2
    os.path.abspath(__file__))
AssertionError: 'c:\\python27\\lib\\site-packages\\ipython-0.13.dev-py2.7.egg\\ipython\\core\\tests\\test_oinspect.py' != 'C:\\python27\\lib\\site-packages\\ipython-0.13.dev-py2.7.egg\\IPython\\core\\tests\\test_oinspect.pyc'
    "'c:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\ipython\\\\core\\\\tests\\\\test_oinspect.py' != 'C:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\IPython\\\\core\\\\tests\\\\test_oinspect.pyc'" = '%s != %s' % (safe_repr('c:\\python27\\lib\\site-packages\\ipython-0.13.dev-py2.7.egg\\ipython\\core\\tests\\test_oinspect.py'), safe_repr('C:\\python27\\lib\\site-packages\\ipython-0.13.dev-py2.7.egg\\IPython\\core\\tests\\test_oinspect.pyc'))
    "'c:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\ipython\\\\core\\\\tests\\\\test_oinspect.py' != 'C:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\IPython\\\\core\\\\tests\\\\test_oinspect.pyc'" = self._formatMessage("'c:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\ipython\\\\core\\\\tests\\\\test_oinspect.py' != 'C:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\IPython\\\\core\\\\tests\\\\test_oinspect.pyc'", "'c:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\ipython\\\\core\\\\tests\\\\test_oinspect.py' != 'C:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\IPython\\\\core\\\\tests\\\\test_oinspect.pyc'")
>>  raise self.failureException("'c:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\ipython\\\\core\\\\tests\\\\test_oinspect.py' != 'C:\\\\python27\\\\lib\\\\site-packages\\\\ipython-0.13.dev-py2.7.egg\\\\IPython\\\\core\\\\tests\\\\test_oinspect.pyc'")

@takluyver
Copy link
Member

I think these should be fixed by f4c8529 - can you confirm that?

@jstenar
Copy link
Member Author

jstenar commented Jun 11, 2012

Thomas Kluyver skrev 2012-06-11 19:59:

I think these should be fixed by f4c8529 - can you confirm that?

Unfortunately that patch is not enough. We need case insensitive
comparison on windows:

AssertionError:
'c:\python27\lib\site-packages\ipython-0.13.dev-py2.7.egg\ipython\core\tests\test_oinspect.py'

!

'C:\python27\lib\site-packages\ipython-0.13.dev-py2.7.egg\IPython\core\tests\test_oinspect.py'

The drive character is uppercase for one and lowercase for the other

@takluyver
Copy link
Member

Do you want to do a quick patch using os.path.normcase()?

@jstenar
Copy link
Member Author

jstenar commented Jun 11, 2012

PR #1909 fixes the failing tests for me on windows

@fperez fperez closed this as completed in 4af3a6a Jun 11, 2012
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this issue Nov 3, 2014
Use os.path.normcase for safe filename comparisons.

Closes ipython#1908.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants