[issue11939] Implement stat.st_dev and os.path.samefile on windows

2013-01-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

 New changeset 3738d270c54a by Brian Curtin in branch 'default':
 st_dev/st_rdev should be unsigned long as dwVolumeSerialNumber, which it is
 set to, is a DWORD. This was fixed in #11939 and the overflow was
 mentioned in #10657 and seen by me on some machines.
 http://hg.python.org/cpython/rev/3738d270c54a

But than st_dev used as long in _pystat_fromstructstat(). Perhaps you should 
check if st_dev is negative and then select 
PyLong_FromLong/PyLong_FromLongLong or 
PyLong_FromUnsignedLong/PyLong_FromUnsignedLongLong.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11939] Implement stat.st_dev and os.path.samefile on windows

2013-01-01 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 61bada808b34 by Brian Curtin in branch 'default':
Set st_dev on Windows as unsigned long to match its DWORD type, related to the 
change to fix #11939.
http://hg.python.org/cpython/rev/61bada808b34

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11939] Implement stat.st_dev and os.path.samefile on windows

2013-01-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Now the code is wrong on non-Windows without PY_LONG_LONG and with signed 
st_dev.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11939] Implement stat.st_dev and os.path.samefile on windows

2013-01-01 Thread Brian Curtin

Brian Curtin added the comment:

Backed out the changeset. If you have a solution, feel free to fix it.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11939] Implement stat.st_dev and os.path.samefile on windows

2012-12-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 3738d270c54a by Brian Curtin in branch 'default':
st_dev/st_rdev should be unsigned long as dwVolumeSerialNumber, which it is set 
to, is a DWORD. This was fixed in #11939 and the overflow was mentioned in 
#10657 and seen by me on some machines.
http://hg.python.org/cpython/rev/3738d270c54a

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11939] Implement stat.st_dev and os.path.samefile on windows

2012-12-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 82531b78b719 by Brian Curtin in branch 'default':
Add NEWS entry for fixing #11939
http://hg.python.org/cpython/rev/82531b78b719

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11939] Implement stat.st_dev and os.path.samefile on windows

2012-12-26 Thread Brian Curtin

Brian Curtin added the comment:

Thanks for the reviews.

--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11939] Implement stat.st_dev and os.path.samefile on windows

2012-12-26 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9e980454b85e by Brian Curtin in branch 'default':
Add tests for Issue #10646.
http://hg.python.org/cpython/rev/9e980454b85e

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11939] Implement stat.st_dev and os.path.samefile on windows

2012-12-26 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Try on Windows:

 import os
 from os.path import *
 samestat(os.stat('.'), os.stat('.'))
Traceback (most recent call last):
  File stdin, line 1, in module
NameError: name 'samestat' is not defined

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11939] Implement stat.st_dev and os.path.samefile on windows

2012-12-26 Thread Brian Curtin

Brian Curtin added the comment:

Separate issue. Fixed in #16788.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11939] Implement stat.st_dev and os.path.samefile on windows

2012-12-24 Thread Brian Curtin

Brian Curtin added the comment:

Here's a patch that fills st_dev, and while we're at it st_rdev (which is the 
same value).

I've moved the implementation of samefile/sameopenfile/samestat from 
Lib/posixpath.py over to Lib/genericpath.py and then removed the implementation 
from Lib/ntpath.py, so those functions are now common. The same goes for tests 
- I've rearranged tests towards test_genericpath. I also removed 
_getfileinformation from Modules/posixmodule.c because it's no longer being 
used.

--
keywords: +needs review, patch
stage: needs patch - patch review
Added file: http://bugs.python.org/file28423/issue11939.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11939] Implement stat.st_dev and os.path.samefile on windows

2012-12-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

What about macpath? I think test_macpath will fail.

--
nosy: +serhiy.storchaka
versions: +Python 3.4 -Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11939] Implement stat.st_dev and os.path.samefile on windows

2012-12-24 Thread Brian Curtin

Brian Curtin added the comment:

Why do you think that? I don't have a mac so I can't test it.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11939] Implement stat.st_dev and os.path.samefile on windows

2012-12-24 Thread Brian Curtin

Brian Curtin added the comment:

Here is an updated patch addressing the sameopenfile that remained in 
Lib/ntpath.py, thanks to Sehriy's comment on the review.

--
Added file: http://bugs.python.org/file28429/issue11939_v2.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11939] Implement stat.st_dev and os.path.samefile on windows

2012-12-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Hmm. test_macpath will now run the tests for samefile etc. macpath doesn't 
contain os.path.samefile. But in Modules/posixmodule.c I don't see any special 
cases for classic MacOS. Actually, I don't know how tests behave on classic 
MacOS.

Please update the documentation (availability, versionchanged).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11939] Implement stat.st_dev and os.path.samefile on windows

2012-12-24 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

On other hand, you should add samefile, sameopenfile and samestat back to 
__all__ in posixpath and ntpath. __all__ is a list of exported names, not a 
list of defined names.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11939] Implement stat.st_dev and os.path.samefile on windows

2012-12-24 Thread Brian Curtin

Brian Curtin added the comment:

Docs and the __all__ changes in V3 patch.

--
Added file: http://bugs.python.org/file28430/issue11939_v3.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11939] Implement stat.st_dev and os.path.samefile on windows

2011-04-27 Thread Amaury Forgeot d'Arc

New submission from Amaury Forgeot d'Arc amaur...@gmail.com:

Since 9cd1036455e7, os.stat() on Windows fills the st_ino member;
it could fill st_dev just as easily;
then os.path.samefile() could be shared with the posix implementation.

--
components: Windows
messages: 134595
nosy: amaury.forgeotdarc
priority: normal
severity: normal
status: open
title: Implement stat.st_dev and os.path.samefile on windows
type: feature request

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11939] Implement stat.st_dev and os.path.samefile on windows

2011-04-27 Thread Brian Curtin

Brian Curtin br...@python.org added the comment:

I created/assigned #10646 to myself for other samefile issues - I can cover 
this as well unless someone beats me to it.

--
assignee:  - brian.curtin
nosy: +brian.curtin
stage:  - needs patch
versions: +Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11939
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com