[issue10364] Color coding fails after running program.

2011-10-24 Thread Ariel

Ariel  added the comment:

Excuse me for budging in, I was having the same problem (both python 3.2 and 
2.7, on both win XP and 7) without knowing the file extention is the cause.

Why doesn't IDLE editor save files with the .py extention unless specificly 
ordered to? The Save as dialoge window has a "type" drop-down menue. Maybe I'm 
missing some of the logic behind it?

------
nosy: +Ariel

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



[issue14377] Modify serializer for xml.etree.ElementTree to allow forcing the use of long tag closing

2012-03-20 Thread Ariel Poliak

New submission from Ariel Poliak :

As it stands in Hg, when the write() method of an xml.etree.ElementTree object 
is called, and a tag within the XML tree has no child tags or defined text, the 
tag is written using the short notation "".

Whether or not the short notation is used instead of the long "" 
notation is used should be configurable by the programmer, without having to 
resort to serializing the XML into a string and then doing replace() on said 
string.

The attached patch adds an optional parameter to the write() method that 
provides this choice.
If the 'use_long_xml_tags' parameter is not set (or otherwise evaluates to the 
boolean False), the current behavior applies.
If this parameter evaluates to the boolean True, long tags are used when 
producing XML output.

--
components: Library (Lib)
files: ElementTree_py-force_long_tags.patch
keywords: patch
messages: 156472
nosy: adpoliak
priority: normal
severity: normal
status: open
title: Modify serializer for xml.etree.ElementTree to allow forcing the use of 
long tag closing
type: enhancement
versions: Python 3.2
Added file: 
http://bugs.python.org/file24978/ElementTree_py-force_long_tags.patch

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



[issue14377] Modify serializer for xml.etree.ElementTree to allow forcing the use of long tag closing

2012-03-23 Thread Ariel Poliak

Ariel Poliak  added the comment:

To answer eli.bendersky's questions:

1. That's just the name of the file with my changes in it.
I pulled the original file from Hg, copied it to "ElementTree_new.py", made my 
changes, and created a patch from the two.

2. I'm not very familiar with the structure of the codebase for Python, so I'll 
provide some information that sounds relevant to me...

The changes I made were for the ElementTree.py file under 
cpython/Lib/xml/etree/ .
I used 
http://hg.python.org/cpython/file/54055646fd1f/Lib/xml/etree/ElementTree.py as 
the base to make a new patch, reflecting storchaka's recommendation on logic 
order and a clarification on path name for the modified file.

The source for the 'ElementC14N' module is not part of Python, so I cannot 
modify the code for the '_serialize_c14n' function.
It appears that this is dependent on http://bugs.python.org/issue13611 .

Looks like I may need to refactor this patch to work in a way that does not 
alter the signature for the _serialize_* methods.

--
Added file: 
http://bugs.python.org/file25008/ElementTree_py-force_long_tags-v2.patch

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



[issue791968] Arguments tooltip wrong if def contains tuple

2013-07-23 Thread ariel brunner

ariel brunner added the comment:

It seems like the solution has caused a different issue: now, when defining a 
function with factional default arguments, the  text replaces the 
correct values in the tooltip.

Here's an example -

>>> def f(a=0.5):
pass
>>> f(

tooltip shows - "(a=0)", i.e. replaces the ".5" with .

--
nosy: +ariel_bruner

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



[issue791968] Arguments tooltip wrong if def contains tuple

2013-07-24 Thread ariel brunner

ariel brunner added the comment:

I will, sorry. I thought it's possible reopen an issue. Since all the relevant 
information is already contained here, and since the problem is with the fix to 
the issue, I figured it's best to reopen this one.

--

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



[issue18539] Arguments tooltip wrong if def contains fractional default value

2013-07-24 Thread ariel brunner

New submission from ariel brunner:

When defining a function with factional default arguments, the  text 
replaces the correct values in the tooltip.

Here's an example -

>>> def f(a=0.5):
pass
>>> f(

tooltip shows - "(a=0)", i.e. replaces the ".5" with .

This was found to happen on IDLE with python 2.7.3 and 2.7.5 (the latter was on 
64 bit python installation on a windows 7 machine).

The problem was discussed here - 
http://stackoverflow.com/questions/17053492/pythons-idle-behavior-while-defining-fractional-default-values-to-function-para
and the problem was found to stem from the CallTips.py file (exact code lines 
in the link).

I believe this is the result of a fix to issue791968.

--
components: IDLE
messages: 193631
nosy: ariel_bruner
priority: normal
severity: normal
status: open
title: Arguments tooltip wrong if def contains fractional default value
type: behavior
versions: Python 2.6, Python 2.7

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



[issue18539] Arguments tooltip wrong if def contains fractional default value

2013-07-24 Thread ariel brunner

Changes by ariel brunner :


--
versions:  -Python 2.6

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



[issue18539] Idle 2.7: Calltip wrong if def contains float default value

2013-07-27 Thread ariel brunner

ariel brunner added the comment:

Superb, and thanks for doing the actual work on fixing it.

--

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



[issue14377] Modify serializer for xml.etree.ElementTree to allow forcing the use of long tag closing

2012-06-12 Thread Ariel Poliak

Ariel Poliak  added the comment:

Made a new patch.
This one contains changes for xml.etree.ElementTree for cpython, jython, and 
stackless.
It also contains changes to Modules/_elementtree.c for cpython and stackless.

The changes within this patch do not change the signature for the _serialize_* 
methods, so it can be used with any third-party library that extends 
ElementTree.

--
Added file: 
http://bugs.python.org/file25946/ElementTree-force_long_tags-v3.patch

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



[issue14377] Modify serializer for xml.etree.ElementTree to allow forcing the use of long tag closing

2012-06-15 Thread Ariel Poliak

Ariel Poliak  added the comment:

Ideally, this would be taken care by the _serialize_xml() with a parameter 
specified when called from within write().

However, the signature for the _serialize_xml() function cannot be changed, as 
it needs to match the signature for the rest of the _serialize_*() functions 
(since which serializing function is chosen from a dictionary that then calls 
the specific function using the same parameters.

An alternative to this would be to create a single variable within the scope of 
ElementTree at runtime if the code calls to write out the full tags closing, 
and have the _serialize_xml() function check for the presence and value of that 
variable.

I initially approached the problem via the flags on Element instead due to the 
perceived usefulness of giving the programmer full control on how the tree is 
serialized into XML.

However, if I'm the only one that sees that as useful, I can certainly refactor 
the code to go with the above solution (or some other more elegant solution).

--

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



[issue20418] socket.getaddrinfo fails for hostname that is all digits 0-9

2014-01-28 Thread ariel-wikimedia

New submission from ariel-wikimedia:

With python 2.7.5 (running on fedora 20 with all updates), socket.getaddrinfo 
for a hostname such as 836937931829 will fail.  Docker produces these sorts of 
hostnames (really random hex strings, but some hex strings only contain digits 
0-9).

How to reproduce:

Add the lines

172.17.10.53blobber
172.17.10.54836937931829

to /etc/hosts

run the following:

import socket
print socket.getaddrinfo('172.17.10.53',80,socket.AF_INET,0,socket.SOL_TCP)
print socket.getaddrinfo('blobber',80,socket.AF_INET,0,socket.SOL_TCP)
print socket.getaddrinfo('172.17.10.54',80,socket.AF_INET,0,socket.SOL_TCP)
print socket.getaddrinfo('836937931829',80,socket.AF_INET,0,socket.SOL_TCP)

Expected output:
[(2, 1, 6, '', ('172.17.10.53', 80))]
[(2, 1, 6, '', ('172.17.10.53', 80))]
[(2, 1, 6, '', ('172.17.10.54', 80))]
[(2, 1, 6, '', ('172.17.10.54', 80))]

Actual output:
[(2, 1, 6, '', ('172.17.10.53', 80))]
[(2, 1, 6, '', ('172.17.10.53', 80))]
[(2, 1, 6, '', ('172.17.10.54', 80))]
Traceback (most recent call last):
  File "./test-getaddrinfo.py", line 6, in 
print socket.getaddrinfo('836937931829',80,socket.AF_INET,0,socket.SOL_TCP)
socket.gaierror: [Errno -2] Name or service not known

--
components: Library (Lib)
messages: 209539
nosy: ariel-wikimedia
priority: normal
severity: normal
status: open
title: socket.getaddrinfo fails for hostname that is all digits 0-9
type: behavior
versions: Python 2.7

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



[issue20418] socket.getaddrinfo fails for hostname that is all digits 0-9

2014-01-28 Thread Ariel Glenn

Ariel Glenn added the comment:

Yes, I had checked that just in case; getaddrinfo(3) works for the all-digit 
hostname, returning no error.  I'm using these hints:

   memset(&hints, 0, sizeof(struct addrinfo));
   hints.ai_family = AF_UNSPEC;
   hints.ai_socktype = SOCK_STREAM;
   hints.ai_flags = AI_PASSIVE;
   hints.ai_protocol = 0;
   hints.ai_canonname = NULL;
   hints.ai_addr = NULL;
   hints.ai_next = NULL;

Tested on glibc-2.18.

--
nosy: +ariel

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



[issue20418] socket.getaddrinfo fails for hostname that is all digits 0-9

2014-01-29 Thread Ariel Glenn

Ariel Glenn added the comment:

Verified that with AF_INET instead of AF_UNSPEC I get the error from my c 
program.  I'll take this to the glibc folks and see what's up. Thanks.

--

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



[issue23714] Comprehension + eval doesn't work inside function definition

2015-03-19 Thread Ariel Bruner

New submission from Ariel Bruner:

The following code gives a NameError:

>>> def foo(bar):
print {eval(x) for x in ['bar']}


>>> foo(2)

Traceback (most recent call last):
  File "", line 1, in 
foo(2)
  File "", line 2, in foo
print {eval(x) for x in ['bar']}
  File "", line 2, in 
print {eval(x) for x in ['bar']}
  File "", line 1, in 
NameError: name 'bar' is not defined

I've seen this kind of bug reported for Python 3.X (e.g. Issue5242), and the 
behavior seems to be identical (e.g. can be fixed with {eval(x) for x in 
['bar'] if True or bar}), but the previously reported bug reports mention 
comprehension is implemented differently on 2.X and that it should not happen 
there, so I thought that might be of interest.

--
components: Windows
messages: 238561
nosy: Ariel Bruner, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Comprehension + eval doesn't work inside function definition
versions: Python 2.7

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



[issue33415] When add_mutually_exclusive_group is built without argument, the help breaks with "IndexError: list index out of range"

2018-05-03 Thread Ariel Otilibili Anieli

New submission from Ariel Otilibili Anieli :

Hello,

When add_mutually_exclusive_group is built without argument, the help breaks 
with "IndexError: list index out of range". Indeed this snippet:

actions_ = parser.add_argument_group('Actions')
actions  = actions_.add_mutually_exclusive_group()

Breaks the help of argparse:

# --help
Traceback (most recent call last):
  File "./ovpauto", line 135, in 
args = parser.parse_args()
  File "/usr/lib/python2.7/argparse.py", line 1701, in parse_args
args, argv = self.parse_known_args(args, namespace)
  File "/usr/lib/python2.7/argparse.py", line 1733, in parse_known_args
namespace, args = self._parse_known_args(args, namespace)
  File "/usr/lib/python2.7/argparse.py", line 1939, in _parse_known_args
start_index = consume_optional(start_index)
  File "/usr/lib/python2.7/argparse.py", line 1879, in consume_optional
take_action(action, args, option_string)
  File "/usr/lib/python2.7/argparse.py", line 1807, in take_action
action(self, namespace, argument_values, option_string)
  File "/usr/lib/python2.7/argparse.py", line 996, in __call__
parser.print_help()
  File "/usr/lib/python2.7/argparse.py", line 2340, in print_help
self._print_message(self.format_help(), file)
  File "/usr/lib/python2.7/argparse.py", line 2314, in format_help
return formatter.format_help()
  File "/usr/lib/python2.7/argparse.py", line 281, in format_help
help = self._root_section.format_help()
  File "/usr/lib/python2.7/argparse.py", line 211, in format_help
func(*args)
  File "/usr/lib/python2.7/argparse.py", line 319, in _format_usage
action_usage = format(optionals + positionals, groups)
  File "/usr/lib/python2.7/argparse.py", line 390, in _format_actions_usage
start = actions.index(group._group_actions[0])
IndexError: list index out of range

Moreover, the trace does not say whence the error came from.

# uname -a 
Linux quasar 4.8.0-2-amd64 #1 SMP Debian 4.8.15-2 (2017-01-04) x86_64 GNU/Linux

#  lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:Debian GNU/Linux testing (buster)
Release:testing
Codename:   buster

#  gcc --version
gcc (Debian 7.3.0-17) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# python --version 
Python 2.7.15rc1

#  dpkg -l | grep -P '\s+python\s+.*2.7.15'
ii  python   
2.7.15~rc1-1   amd64interactive 
high-level object-oriented language (default version)

Regards,
Ariel

--
messages: 316113
nosy: ariel-anieli, bethard
priority: normal
severity: normal
status: open
title: When add_mutually_exclusive_group is built without argument, the help 
breaks with "IndexError: list index out of range"
type: behavior
versions: Python 2.7

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



[issue15276] unicode format does not really work in Python 2.x

2012-07-07 Thread Ariel Ben-Yehuda

New submission from Ariel Ben-Yehuda :

unicode formats (u'{:n}'.format) in python 2.x assume that the thousands 
seperator is in ascii, so this fails:

>>> import locale
>>> locale.setlocale(locale.LC_NUMERIC, 'fra') # or fr_FR on UNIX
>>> u'{:n}'.format(1)
Traceback (most recent call last):
  File "", line 1, in 
u'{:n}'.format(1)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa0 in position 2: ordinal 
not in range(128)

However, it works correctly in python 3, properly returning '10\xA0' (the 
\xA0 is a nbsp)

--
messages: 164844
nosy: Ariel.Ben-Yehuda
priority: normal
severity: normal
status: open
title: unicode format does not really work in Python 2.x
versions: Python 2.7

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



[issue15276] unicode format does not really work in Python 2.x

2012-07-07 Thread Ariel Ben-Yehuda

Ariel Ben-Yehuda  added the comment:

I don't work on CPython

On Sat, Jul 7, 2012 at 6:57 PM, Martin v. Löwis wrote:

>
> Martin v. Löwis  added the comment:
>
> Ariel: would you like to provide a patch?
>
> --
> nosy: +loewis
>
> ___
> Python tracker 
> <http://bugs.python.org/issue15276>
> ___
>

--

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



[issue9259] Python 2.7 breaks assigned __exit__s

2010-07-14 Thread Ariel Ben-Yehuda

New submission from Ariel Ben-Yehuda :

Hello, I think there is a problem with Python 2.7: I installed it, and tried to 
compile GObject-Introspection 0.9.2. Here is the result:

...
  GISCAN GLib-2.0.gir
Traceback (most recent call last):
  File "../tools/g-ir-scanner", line 36, in 
from giscanner.scannermain import scanner_main
  File "/sources/gobject-introspection-0.9.2/giscanner/scannermain.py", line 
31, in 
from giscanner.dumper import compile_introspection_binary
  File "/sources/gobject-introspection-0.9.2/giscanner/dumper.py", line 26, in 

from .glibtransformer import IntrospectionBinary
  File "/sources/gobject-introspection-0.9.2/giscanner/glibtransformer.py", 
line 34, in 
from .transformer import Names
  File "/sources/gobject-introspection-0.9.2/giscanner/transformer.py", line 
31, in 
from .girparser import GIRParser
  File "/sources/gobject-introspection-0.9.2/giscanner/girparser.py", line 32, 
in 
from .girwriter import COMPATIBLE_GIR_VERSION
  File "/sources/gobject-introspection-0.9.2/giscanner/girwriter.py", line 30, 
in 
from .xmlwriter import XMLWriter
  File "/sources/gobject-introspection-0.9.2/giscanner/xmlwriter.py", line 70, 
in 
with LibtoolImporter:
AttributeError: __exit__

Oops, no GObject-Introspection for me. Investigating the bug, I looked in the 
recent changes in Python2.7 for something interesting, and found this: 
A new opcode was added to perform the initial setup for with statements, 
looking up the __enter__()  and __exit__()  methods. (Contributed by Benjamin 
Peterson.)

Finally, I made 3 test cases to the bug. All 3 produce no input in Python 2.6, 
but crash pretty nicely in 2.7, the first 2 not finding __exit__ and the last 
missing __enter__.

I will try to make a patch, however my CPython skills are not so great, so you 
will probably make a better one.

--
components: Interpreter Core
files: tests.tar.xz
messages: 110268
nosy: arielbyd
priority: normal
severity: normal
status: open
title: Python 2.7 breaks assigned __exit__s
versions: Python 2.7
Added file: http://bugs.python.org/file17996/tests.tar.xz

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



[issue9259] Python 2.7 breaks assigned __exit__s

2010-07-14 Thread Ariel Ben-Yehuda

Ariel Ben-Yehuda  added the comment:

Bug or not bug, Python2.7 breaks Gobject-Introspection.

--
status: closed -> open

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



[issue9259] Python 2.7 breaks assigned __exit__s

2010-07-14 Thread Ariel Ben-Yehuda

Ariel Ben-Yehuda  added the comment:

My test on Class Methods was based on the GI Code that does not run on Python 
2.7.

--

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



[issue9259] Python 2.7 breaks assigned __exit__s

2010-07-14 Thread Ariel Ben-Yehuda

Ariel Ben-Yehuda  added the comment:

Done it for myself. However, I am not a GI Maintainer - you should talk with 
them and send them this patch.

--

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