[issue4071] ntpath.abspath fails for long str paths

2019-03-16 Thread Eryk Sun


Eryk Sun  added the comment:

I'm closing this as a resolved issue. Python 2 is approaching end of life, and 
I don't see a pressing need for my suggestion in msg237007. We should be using 
unicode for paths in Windows anyway since its file systems are natively Unicode.

--
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4071] ntpath.abspath fails for long str paths

2019-03-15 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4071] ntpath.abspath fails for long str paths

2015-03-01 Thread eryksun

eryksun added the comment:

 Can we close this as I'm not aware of any possible way to fix this? 

Windows system and C runtime calls that take paths could be restricted to 
wide-character APIs, such as calling GetFullPathnameW in this case, or _wexecve 
instead of execve (issue 23462). Then for bytes paths an extension can call 
PyUnicode_FSDecoder (PyUnicode_DecodeMBCS). In posxmodule.c this can be handled 
in the path_converter function.

path_converter
https://hg.python.org/cpython/file/5d4b6a57d5fd/Modules/posixmodule.c#l698

path_converter could be moved to Python/fileutils.c to make it available for 
use by other modules such as io.

--
nosy: +eryksun

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



[issue4071] ntpath.abspath fails for long str paths

2015-03-01 Thread Mark Lawrence

Mark Lawrence added the comment:

Can we close this as I'm not aware of any possible way to fix this?  See also 
issue1776160.

--
nosy: +steve.dower, tim.golden, zach.ware

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



[issue4071] ntpath.abspath fails for long str paths

2014-06-07 Thread Mark Lawrence

Mark Lawrence added the comment:

I don't see that any further work can be done here owing to limitations of the 
Windows str API.  Note that the same argument can be applied to issue1776160.

--
nosy: +BreamoreBoy

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



[issue4071] ntpath.abspath fails for long str paths

2012-12-20 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
type: crash - behavior

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



[issue4071] ntpath.abspath fails for long str paths

2012-11-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I doubt this issue exists on Python = 3.2.

See also issue1776160.

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

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



[issue4071] ntpath.abspath fails for long str paths

2012-10-01 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
versions: +Python 3.2, Python 3.3, Python 3.4 -Python 2.6, Python 3.0

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



[issue4071] ntpath.abspath fails for long str paths

2008-12-14 Thread Hirokazu Yamamoto

Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment:

GetFullPathNameW may return the required buffer size (non-zero value) 
when buffer is too short. Before r67154, this case was treated as 
success, so there was possibility of access to uninitialized buffer 
woutbuf. Fortunately, GetFullPathNameW sets '\0' to woutbuf (this is 
undocumented behavior), so abspath() returned empty string instead of 
segmentation fault. But this is still potentially dangerous, so I fixed 
this by allocating required size buffer and calling GetFullPathNameW 
again. abspath() returns correct result for any long unicode path now.

But original poster hopes abspath() should return correct result for 
any long both *str* and unicode path. For str, this issue is not solved 
yet.

--
I'm skeptical abspath() should support longer path than MAX_PATH if 
ANSI version of Windows API cannot handle such path. Anyway, I won't 
use such long path. ;-)

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



[issue4071] ntpath.abspath fails for long str paths

2008-12-13 Thread Martin v. Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

As it is apparently not clear what change exactly needs to be applied to
2.5, I'm declaring that this fix will not be backported.

I would appreciate if somebody could summarize what still needs to be
done, or (if nothing needs to be done), close this issue.

--
priority: release blocker - normal
versions:  -Python 2.5, Python 2.5.3

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



[issue4071] ntpath.abspath fails for long str paths

2008-12-10 Thread Martin v. Löwis

Martin v. Löwis [EMAIL PROTECTED] added the comment:

ocean-city, can you please backport this to the 2.5 branch?

--
assignee:  - ocean-city
nosy: +loewis
priority:  - release blocker
resolution:  - accepted

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4071
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4071] ntpath.abspath fails for long str paths

2008-12-10 Thread Martin v. Löwis

Martin v. Löwis [EMAIL PROTECTED] added the comment:

As a follow-up: please don't forget to add Misc/NEWS entries (both for
the already-committed patch, as well as for the backport).

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4071
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4071] ntpath.abspath fails for long str paths

2008-12-10 Thread Hirokazu Yamamoto

Hirokazu Yamamoto [EMAIL PROTECTED] added the comment:

can you please backport this to the 2.5 branch?

Sorry for clarification. Which should I backport r67154 or
quick_hack_for_getfullpathname_v2.patch?

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4071
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4071] ntpath.abspath fails for long str paths

2008-11-07 Thread Hirokazu Yamamoto

Hirokazu Yamamoto [EMAIL PROTECTED] added the comment:

Fixed unicode issue in r67154(trunk). I'm not sure how to handle long
str, so I didn't touch it for now.

--
versions: +Python 2.5.3, Python 2.7

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4071
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4071] ntpath.abspath fails for long str paths

2008-10-09 Thread Jason Day

Changes by Jason Day [EMAIL PROTECTED]:


--
title: ntpath.abspath can fail on Win Server 2008 (64-bit) - ntpath.abspath 
fails for long str paths

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4071
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4071] ntpath.abspath fails for long str paths

2008-10-09 Thread Hirokazu Yamamoto

Hirokazu Yamamoto [EMAIL PROTECTED] added the comment:

I think attached patch fix_getfullpathname.patch will fix unicode
issue at least. For ansi issue, I followed the manner of win32_chdir for
now.

After some investigation, GetFullPathNameA fails if output size is more
than MAX_PATH even if input size is less than MAX_PATH. I feel it's
difficult check this before invoking GetFullPathNameA.

This is test for unicode issue.

/

import unittest
import ntpath
import os

class TestCase(unittest.TestCase):
def test_getfullpathname(self):
for count in xrange(1, 1000):
name = ux * count
path = ntpath._getfullpathname(name)
self.assertEqual(os.path.basename(path), name)

if __name__ == '__main__':
unittest.main()

--
keywords: +patch
versions: +Python 2.6, Python 3.0
Added file: http://bugs.python.org/file11755/fix_getfullpathname.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4071
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4071] ntpath.abspath fails for long str paths

2008-10-09 Thread Hirokazu Yamamoto

Hirokazu Yamamoto [EMAIL PROTECTED] added the comment:

I feel it's difficult to check this before invoking GetFullPathNameA.

And error number via GetLastError() is vogus, sometimes 0, sometimes others.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4071
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4071] ntpath.abspath fails for long str paths

2008-10-09 Thread Hirokazu Yamamoto

Hirokazu Yamamoto [EMAIL PROTECTED] added the comment:

Or, if PyArg_ParseTuple overflowed or GetFullPathNameA failed, (not
check GetLastError() because it's vogus) try GetFullPathNameW like
attached file quick_hack_for_getfullpathname.patch.

This inverses flow

if (unicode_file_names()) {
/* unicode */
}
/* ascii */

# Maybe it would be nice if convert_to_unicode() functionality is built
in PyArg_ParseTuple. (inverse of et)

Be care, this is quick hack, so maybe buggy. I confirmed test_os and
test_ntpath passed though.

/

import unittest
import ntpath
import os

class TestCase(unittest.TestCase):
def test_getfullpathname(self):
for c in ('x', u'x'):
for count in xrange(1, 1000):
name = c * count
path = ntpath._getfullpathname(name)
self.assertEqual(os.path.basename(path), name)

if __name__ == '__main__':
unittest.main()

Added file: 
http://bugs.python.org/file11757/quick_hack_for_getfullpathname.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4071
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4071] ntpath.abspath fails for long str paths

2008-10-09 Thread Hirokazu Yamamoto

Changes by Hirokazu Yamamoto [EMAIL PROTECTED]:


Added file: 
http://bugs.python.org/file11758/quick_hack_for_getfullpathname_v2.patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4071
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4071] ntpath.abspath fails for long str paths

2008-10-08 Thread Jason Day

Changes by Jason Day [EMAIL PROTECTED]:


--
title: ntpath.abspath can fail on Win Server 2008 (64-bit) - ntpath.abspath 
fails for long str paths

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4071
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com