New submission from jeff deifik <j...@jeffunit.com>:
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_
jeff deifik j...@jeffunit.com 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
New submission from jeff deifik j...@jeffunit.com:
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
New submission from jeff deifik j...@jeffunit.com:
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
jeff deifik j...@jeffunit.com added the comment:
Oops, you are correct, my mistake.
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6909
New submission from jeff deifik j...@jeffunit.com:
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' in position
jeff deifik j...@jeffunit.com 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
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 a standard, portable
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)
Here is the error
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 unprintable characters):
+00000
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, I get an error like
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)
However,
http://docs.python.org/3.0/library
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 = '' # This is really slow
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://bugs.python.org/issue4534
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 PROTECTED]
http
15 matches
Mail list logo