[issue22901] test.test_uuid.test_find_mac fails because of `ifconfig` deprecation

2014-11-26 Thread bru

bru added the comment:

Closed the issue since it's already been fixed.

--
resolution:  -> out of date
status: open -> closed

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



[issue22940] readline does not offer partial saves

2014-11-25 Thread bru

New submission from bru:

The "readline" module offers "write_history_file" from readline/history.h 
"write_history", but there's no "append_history_file" that would invoke 
"append_history" from the C header.

This causes inconveniences when saving history to a file (like shown there: 
https://docs.python.org/3.5/library/readline.html?highlight=readline#example). 
Indeed, say you have 2 interpreters (A) and (B) open.
- (A) and (B) load the history, composed of (z) lines
- you work on both, writing (a) lines in (A) and (b) lines in (b)
- you close (A), the history file now has (z)+(a)
- you close (B), the history file now has (z)+(b)
Therefore (A) history (the (a) lines) is lost. Offering "append_history_file" 
would be a nice way to fix this problem: having (z)+(a)+(b) in the end would be 
easy.

This is exactly what the attached patch does. With it are tests, doc and an 
example. I've not updated Misc/NEWS yet though (no issue #).

--
components: Library (Lib)
files: 0001-Add-readline.append_history_file-function.patch
keywords: patch
messages: 231661
nosy: bru
priority: normal
severity: normal
status: open
title: readline does not offer partial saves
type: enhancement
versions: Python 3.5
Added file: 
http://bugs.python.org/file37275/0001-Add-readline.append_history_file-function.patch

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



[issue22901] test.test_uuid.test_find_mac fails because of `ifconfig` deprecation

2014-11-19 Thread bru

bru added the comment:

I realize that I was not working against the tip... The patch I offered does 
not apply since revision 88068, which fixes the test by skipping it when 
"ifconfig" isn't available. Therefore this issue is invalid.

However I think that "test_find_mac" should always should not be skipped but 
use any other binary instead.


(Context: I'm trying to start contributing by fixing tests/'easy' bugs; I 
should have updated by cpython repo beforehand...)

--

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



[issue22901] test.test_uuid.test_find_mac fails because of `ifconfig` deprecation

2014-11-19 Thread bru

bru added the comment:

According to http://en.wikipedia.org/wiki/Iproute2 "ip" is Linux-only.
I opened an issue with a patch that brings "ip link list" to "uuid.getnode()": 
http://bugs.python.org/issue22902

--

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



[issue22902] Use 'ip' for uuid.getnode()

2014-11-19 Thread bru

New submission from bru:

Only linux, `uuid.getnode()` will use the Unix ddl, then ifconfig, then random. 
`ifconfig` is disappearing in favour of `ip` (from iproute2), which should be 
used.
This patch ads `_ip_getnode` getter to `uuid.getnode()`

--
components: Library (Lib)
files: uuid_find_mac_with_ip.patch
keywords: patch
messages: 231382
nosy: bru
priority: normal
severity: normal
status: open
title: Use 'ip' for uuid.getnode()
versions: Python 3.4
Added file: http://bugs.python.org/file37228/uuid_find_mac_with_ip.patch

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



[issue22901] test.test_uuid.test_find_mac fails because of `ifconfig` deprecation

2014-11-19 Thread bru

New submission from bru:

`test.test_uuid.test_find_mac` relies on `ifconfig` binary presence, which is 
on its way out. This makes the test fail on more and more Linux installations.
Using `env` (for example) is more reliable. `ip` could also be used since it's 
the replacement to `ifconfig`, but an always-present binary such as `env` makes 
it work in all cases.
This is what the (trivial) patch does.

The same reasoning applies to `uuid.getnode`: if 'Unix dll' source is not 
available it will try to get a MAC address 'ifconfig' which will fail, and the 
fallback will be `_random_getnode` (but that's another issue).

--
components: Tests
files: fix_uuid_find_mac_test.patch
keywords: patch
messages: 231380
nosy: bru
priority: normal
severity: normal
status: open
title: test.test_uuid.test_find_mac fails because of `ifconfig` deprecation
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file37227/fix_uuid_find_mac_test.patch

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