[issue33687] uu.py calls os.path.chmod which doesn't exist

2018-07-12 Thread Poul-Henning Kamp
Poul-Henning Kamp added the comment: Please note that the mode is not just a parameter, it is also a data field inside the encoded input. See: https://en.wikipedia.org/wiki/Uuencoding (search for "mode") -- ___ Python track

[issue33687] uu.py calls os.path.chmod which doesn't exist

2018-06-10 Thread Poul-Henning Kamp
Poul-Henning Kamp added the comment: I was just playing with it in a prototype and noticed that it didn't work. -- ___ Python tracker <https://bugs.python.org/is

[issue33687] uu.py calls os.path.chmod which doesn't exist

2018-05-29 Thread Poul-Henning Kamp
New submission from Poul-Henning Kamp : Library file uu.py on at least 2.7 and 3.6 contains: try: os.path.chmod(out_file, mode) except AttributeError: pass As far as I can tell, os.path.chmod does not exist, so this always raises

[issue18127] Strange behaviour with default list argument

2013-06-03 Thread Poul-Henning Kamp
New submission from Poul-Henning Kamp: I'd like to nominate this piece of code as candidate for the next round of "Most unexpected python behaviour" awards: def foo(a, x = []): x.append(a) return x print(foo(1)) print(foo(2)) I expected the outpu

[issue16870] re fails to match ^ when start index is specified ?

2013-01-05 Thread Poul-Henning Kamp
Poul-Henning Kamp added the comment: I have tried hard, but have utterly failed to figure out why you have chosen the semantics for ^ you mention, tried to come up with a plausible use case, and I have utterly failed. I find it distinctly counter intuitive. I think the Principle of Least

[issue16870] re fails to match ^ when start index is specified ?

2013-01-05 Thread Poul-Henning Kamp
New submission from Poul-Henning Kamp: I'm surprised that this does not find any matches: import re r = re.compile("^abc") s = "0123abcxyz" for i in range(0,len(s)): print(i, r.search(s, i)) I would have expected the i==4 case to match ?

[issue15723] Python breaks OS' append guarantee on file writes

2012-08-18 Thread Poul-Henning Kamp
Poul-Henning Kamp added the comment: POLA = Principle Of Least Astonishment We use that a lot in architectural decision in FreeBSD :-) As I said: You deal with this as you see fit. If all python2 gets is a doc- or errata-notice, that's perfectly fine with me. I interpret "

[issue15723] Python breaks OS' append guarantee on file writes

2012-08-18 Thread Poul-Henning Kamp
Poul-Henning Kamp added the comment: I have not tried io.open(), nor would I suspect most users would realize that they needed to do so, in order to get the canonical behaviour from an operation called "write" on a file opened in "append" mode. IMO: If pythons file.write

[issue15723] Python breaks OS' append guarantee on file writes

2012-08-18 Thread Poul-Henning Kamp
Poul-Henning Kamp added the comment: Yes, it does: If the O_APPEND flag of the file status flags is set, the file offset shall be set to the end of the file prior to each write and no intervening file modification operation shall occur between changing the file offset and the write operation

[issue15723] Python breaks OS' append guarantee on file writes

2012-08-18 Thread Poul-Henning Kamp
New submission from Poul-Henning Kamp: When a file is opened in append mode, the operating system guarantees that all write(2) system calls atomically appended their payload to the file. At least on FreeBSD, Python breaks this guarantee, by chopping up large writes into multiple write(2