Code review comment for lp:~luoyonggang/subvertpy/unittest-win32

Revision history for this message
Yonggang Luo (luoyonggang) wrote :

2012/3/11 Jelmer Vernooij <email address hidden>

> > Please read the test result carefully. And you will know why do the
> things in
> > this way.
> > The test result is under
> >
> > Description of the Change
> That only explains *what* is failing for you. It doesn't explain *why* it
> is failing, and why your fix addresses that. That's the bit I'm interested
> in.
>
It's failed just because Python's maketemp didn't return the corrent
tempfile file path.
For example, tempfile.mkdtemp() on windows will gives us with the file path
c:\users\uername\appdata\local\temp\hash_code , but the real file path
is C:\Users\username\AppData\Local\Temp\hash_code.
When I use
  tempfile.mkdtemp(dir =
                os.getenv("TEMP", None) or os.getenv("TMP", None))
it's will give us the exact file path with the windows file system.
TEMP and TMP is recorded by the OS. and even if TEMP and TMP is not exist,
it's sill works, just because dir accept None as
a default input.

The unittest failed, is just because Subversion changed the file path
from c:\users\uername\appdata\local\temp\hash_code
to C:\users\uername\appdata\local\temp\hash_code, but under Windows file
system, these two path represents the same path,
so it's should not be FAILED.
If we use path generated by tempfile.mkdtemp(dir =
                os.getenv("TEMP", None) or os.getenv("TMP", None)), then
subversion will works properly with it.

--
>
> https://code.launchpad.net/~luoyonggang/subvertpy/unittest-win32/+merge/96920
> You are the owner of lp:~luoyonggang/subvertpy/unittest-win32.
>

--
         此致

罗勇刚
Yours
    sincerely,
Yonggang Luo

« Back to merge proposal