[issue26671] Clean up path_converter in posixmodule.c

2016-04-07 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 633bb190fb76 by Serhiy Storchaka in branch 'default':
Issue #26671: Fixed tests for changed error messages.
https://hg.python.org/cpython/rev/633bb190fb76

--

___
Python tracker 

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



[issue26671] Clean up path_converter in posixmodule.c

2016-04-07 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Martin.

--
status: open -> closed

___
Python tracker 

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



[issue26671] Clean up path_converter in posixmodule.c

2016-04-07 Thread Martin Panter

Martin Panter added the comment:

Looks like the tests may need updating for a changed exception message:

http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%203.x/builds/12996/steps/test/logs/stdio
==
FAIL: test_stat (test.test_posix.PosixTester)
--
TypeError: stat: path should be string, bytes or integer, not NoneType

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_posix.py", 
line 415, in test_stat
posix.stat, None)
AssertionError: "can't specify None for path argument" does not match "stat: 
path should be string, bytes or integer, not NoneType"

==
FAIL: test_stat_dir_fd (test.test_posix.PosixTester)
--
TypeError: argument should be integer or None, not str

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/buildbot/buildarea/3.x.bolen-ubuntu/build/Lib/test/test_posix.py", 
line 867, in test_stat_dir_fd
posix.stat, support.TESTFN, dir_fd=posix.getcwd())
AssertionError: "should be integer, not" does not match "argument should be 
integer or None, not str"

--
nosy: +martin.panter
status: closed -> open

___
Python tracker 

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



[issue26671] Clean up path_converter in posixmodule.c

2016-04-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8dc144e47252 by Serhiy Storchaka in branch 'default':
Issue #26671: Fixed #ifdef indentation.
https://hg.python.org/cpython/rev/8dc144e47252

--

___
Python tracker 

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



[issue26671] Clean up path_converter in posixmodule.c

2016-04-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4acdb324a430 by Serhiy Storchaka in branch 'default':
Issue #26671: Fixed #ifdef indentation.
https://hg.python.org/cpython/rev/4acdb324a430

--

___
Python tracker 

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



[issue26671] Clean up path_converter in posixmodule.c

2016-04-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your review Larry.

--
resolution:  -> fixed
stage: patch review -> 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



[issue26671] Clean up path_converter in posixmodule.c

2016-04-06 Thread Roundup Robot

Roundup Robot added the comment:

New changeset a866f5727b7f by Serhiy Storchaka in branch 'default':
Issue #26671: Enhanced path_converter.
https://hg.python.org/cpython/rev/a866f5727b7f

--
nosy: +python-dev

___
Python tracker 

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



[issue26671] Clean up path_converter in posixmodule.c

2016-04-06 Thread Larry Hastings

Larry Hastings added the comment:

LGTM.

--

___
Python tracker 

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



[issue26671] Clean up path_converter in posixmodule.c

2016-04-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here it is.

--
Added file: http://bugs.python.org/file42380/path_converter_cleanup_3.patch

___
Python tracker 

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



[issue26671] Clean up path_converter in posixmodule.c

2016-04-06 Thread Larry Hastings

Larry Hastings added the comment:

Can you post the updated patch please?

--

___
Python tracker 

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



[issue26671] Clean up path_converter in posixmodule.c

2016-04-01 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue26671] Clean up path_converter in posixmodule.c

2016-04-01 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Good catch! Here is updated patch. It fixes also hiding exception in dir_fd 
converter.

--
Added file: http://bugs.python.org/file42341/path_converter_cleanup_2.patch

___
Python tracker 

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



[issue26671] Clean up path_converter in posixmodule.c

2016-03-31 Thread Larry Hastings

Larry Hastings added the comment:

I approve in principle, but this patch isn't ready.

If we compile on Win32, and allow_fd is on, and they pass in an invalid fd, 
your patched code will reach line 914 "length = PyBytes_GET_SIZE(bytes);" but 
bytes will be uninitialized.

--

___
Python tracker 

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



[issue26671] Clean up path_converter in posixmodule.c

2016-03-30 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

path_converter in Modules/posixmodule.c sequentially tries to convert an 
argument to str, bytes, and int. If previous conversion is failed, it clears 
the error and tries with type. This can hide some errors (such as MemoryError) 
and even cause using unexpected conversion.

Proposed patch cleans up path_converter. In addition it avoids copying the 
content of instances of string subclass.

--
assignee: serhiy.storchaka
components: Extension Modules
files: path_converter_cleanup.patch
keywords: patch
messages: 262657
nosy: larry, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Clean up path_converter in posixmodule.c
type: enhancement
versions: Python 3.6
Added file: http://bugs.python.org/file42327/path_converter_cleanup.patch

___
Python tracker 

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