jeff deifik added the comment:
There are many possible solutions to this problem.
Personally, I think mine is the simplest, though it changes the API.
However, there have been several suggestions on simple fixes that don't change
the API, all of which fix the resource leak.
Doing no
New submission from jeff deifik :
I have a program which calls filecmp.cmp a lot.
It runs out of memory.
I read the source to filecmp, and then I periodically set
filecmp._cache = {}
Without doing this, filecmp's cache uses up all the memory in the computer.
There needs to be a docum
New submission from jeff deifik <[EMAIL PROTECTED]>:
I compiled python 3.0 on a cygwin platform.
Here is my modest function:
def List_to_String(lis):
#return str.join(lis, '') # This is fast, but seems broke in 3.0
s = ''
Changes by jeff deifik <[EMAIL PROTECTED]>:
--
title: problem with str.join -> problem with str.join - should work with list
input, error says requires 'str' object
___
Python tracker <[EMAIL PROTECTED]>
<http
jeff deifik <[EMAIL PROTECTED]> added the comment:
Thanks.
I want to learn what is wrong with the code I have though.
My main goal is to understand python 3.0 better, rather than
fixing a specific problem.
___
Python tracker <[EMAIL PROTECTE
jeff deifik <[EMAIL PROTECTED]> added the comment:
Yes, it was
import string
string.join(lis, '')
I am still a bit confused though.
Why doesn't my code of str.join(lis, '') work?
I don't think str is a reserved word.
I suppose that python might be able
jeff deifik <[EMAIL PROTECTED]> added the comment:
I fixed the code as follows:
return str.join('',lis)
I think it is readable, and I understand it.
Thanks everyone for clarifying everything
___
Python tracker <[EMAIL PROTECTED]>
&
New submission from jeff deifik <[EMAIL PROTECTED]>:
def char_sieve():
char_data = array('c')
...
produces:
File ".../prime.py", line 78, in char_sieve
char_data = array('c')
ValueError: bad typecode (must be b, B, u, h, H, i, I, l, L, f or d)
New submission from jeff deifik <[EMAIL PROTECTED]>:
I have a program that needs to output binary data to stdout.
I don't want to convert it to a string.
for example something like
sys.stdout.write('0o377')
to write a byte with all the bits turned on.
When I try this
jeff deifik <[EMAIL PROTECTED]> added the comment:
I don't consider sys.stdout.buffer.write(b'abc')
to be an acceptable solution. There are many programs that need
to produce binary output with standard output. Consider uudecode
and similar programs.
There needs to be
New submission from jeff deifik <[EMAIL PROTECTED]>:
I want to make my own data of types bytes in order to write it out.
For example, I want to write out the bytes 0..9
#!/usr/bin/env python3.0
foo = b''
for i in range (0,10):
foo += i
#sys.stdout.buffer.write(foo)
H
jeff deifik <[EMAIL PROTECTED]> added the comment:
Doesn't work.
#!/usr/bin/env python3.0
import sys
foo = b''
for i in range (0,10):
foo += bytes(i)
sys.stdout.buffer.write(foo)
produces a binary file of 45 bytes. Here is a hex dump (the '.'
represent unpr
New submission from jeff deifik :
I am running python 3.6.3 on cygwin / windows.
Here is a test program to demonstrate the bug:
#!/usr/bin/env python3
fp = open("bug_out.txt", "ab")
buff = 'Hello world'
print('type of buff is', type(buff))
bin_buf
jeff deifik added the comment:
Oops, you are correct, my mistake.
--
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue6909>
___
___
Py
New submission from jeff deifik :
I am calling filecmp.cmp on a two files, one of which has a name of
'./Julio_Iglesias-Un_Hombre_Solo-05-Qu\udce9_no_se_rompa_la_noche.mp3'
I get an exception from filecmp.cmp saying:
'ascii' codec can't encode character '\udce9
jeff deifik added the comment:
Forgive all the print statements.
Here is the result of running this:
floup:files are
['./Julio_Iglesias-Un_Hombre_Solo-05-Qu\udce9_no_se_rompa_la_noche.mp3',
'/cygdrive/j/music/bea/Julio_Iglesias-Un_Hombre_Solo-05-Qu\udce9_no_se_rompa_la_n
New submission from jeff deifik :
In order to compile 3.1.1 with the cygwin environment, it was necessary
to edit Modules/main.c after running configure
There are a few tests that still fail when running 'make test', but
overall, python 3.1.1 works fine.
Included is the co
17 matches
Mail list logo