[issue28905] re.sub appears not to check count optional argument for integerness

2016-12-08 Thread Danny Yoo
Danny Yoo added the comment: Alternatively, change the representation of flag values from integers to some class extension that supports the common bitwise operators. As a very rough sketch: >>> class FlagInt(int): ... def __or__(self, other): ... return FlagInt(int(se

[issue28905] re.sub appears not to check count optional argument for integerness

2016-12-08 Thread Danny Yoo
Danny Yoo added the comment: Ugh. I suddenly realize that this is complicated by the fact that flag values are themselves represented as integers, and Python's type system isn't rich enough to label flag values as a distinct type for the purposes. It may be worthwhile to add a warning

[issue28905] re.sub appears not to check count optional argument for integerness

2016-12-08 Thread Danny Yoo
New submission from Danny Yoo: This comes from diagnosing a beginner's question on Python-tutor. https://mail.python.org/pipermail/tutor/2016-December/110066.html It appears that re.sub is not checking whether the count argument is integer or not, and silently accepts a nonsensical argument

[issue23306] zlib.crc32 raises OverflowError at argument-parsing time on large strings

2015-01-23 Thread Danny Yoo
Danny Yoo added the comment: Unfortunately, fixing just zlib.crc32 isn't quite enough for our purposes. We still will see OverflowErrow in zipfile if compression is selected. Demonstration code: import zipfile ## Possible workaround: monkey

[issue23306] zlib.crc32 raises OverflowError at argument-parsing time on large strings

2015-01-23 Thread Danny Yoo
New submission from Danny Yoo: Reproduction steps: --- $ python2.7 -c import zlib;zlib.crc32('a'*(131)) Traceback (most recent call last): File string, line 1, in module OverflowError: size does not fit in an int --- We ran into this bug in zlib.crc32 when using zipfile.writestr

[issue23306] Within zipfile, use of zlib.crc32 raises OverflowError at argument-parsing time on large strings

2015-01-23 Thread Danny Yoo
Changes by Danny Yoo danny...@google.com: -- title: zlib.crc32 raises OverflowError at argument-parsing time on large strings - Within zipfile, use of zlib.crc32 raises OverflowError at argument-parsing time on large strings ___ Python tracker rep

Re: [Tutor] Convert Qstring to string in windows

2014-10-16 Thread Danny Yoo
On Thu, Oct 16, 2014 at 8:21 AM, C@rlos cmfer...@estudiantes.uci.cu wrote: I have been tryed to convert a Qstring text to string on python, in linux that work fine but in windows when qstring contine á,é,í,ó,ú the converted text is not correct, contine extranger characters, this qstring text

Re: [Python-Help] os listdir access denied when run as a service

2006-05-25 Thread Danny Yoo
On Thu, 25 May 2006, Thomas Thomas wrote: I am trying to access a mapped network drive folder. everything works fine normally. But when i run the application as service I am getting the error The error is on the line: for filename in os.listdir(folder):#line 25 and I have to

Re: [Baypiggies] BayPIGgies: December 8, 7:30pm (IronPort)

2005-12-05 Thread Danny Yoo
Advance notice: We need speakers for January and later. Please send e-mail to [EMAIL PROTECTED] if you want to suggest an agenda (or volunteer to give a presentation). Correction: that email address should be '[EMAIL PROTECTED]'. -- http://mail.python.org/mailman/listinfo/python-list

Re: [Tutor] how to convert between type string and token

2005-11-14 Thread Danny Yoo
On Mon, 14 Nov 2005, enas khalil wrote: hello all [program cut] Hi Enas, You may want to try talking with NTLK folks about this, as what you're dealing with is a specialized subject. Also, have you gone through the tokenization tutorial in:

Re: [Python-Help] Programming help

2004-12-06 Thread Danny Yoo
On Mon, 6 Dec 2004, Alfred Canoy wrote: Please help me out:(.. I've been trying to figure this out for 2 days now.. I don't know what to use to print all the list of numbers. I hve know idea how should I do this. I tried a lot of trial error for the the def, dict, .list( ). have no luck.