00:54
jcea has joined #pypy
01:08
wleslie has joined #pypy
02:28
jcea has quit [Ping timeout: 268 seconds]
05:22
glyph has quit [Quit: End of line.]
05:23
glyph has joined #pypy
10:23
lritter has joined #pypy
10:24
lritter has quit [Client Quit]
10:24
DRMacIver has joined #pypy
10:25
cfbolz has joined #pypy
10:26
EWDurbin has joined #pypy
10:26
michelp has joined #pypy
10:28
graingert has joined #pypy
10:28
kristjansson has joined #pypy
10:28
jaraco has joined #pypy
10:57
<
arigato >
OK, help?
10:57
<
arigato >
in cpython3.7:
10:57
<
arigato >
>>> f = os.fdopen(2, 'w', 0)
10:57
<
arigato >
>>> id(f)
10:57
<
arigato >
>>> id(id)
10:57
<
arigato >
140634262135024
10:57
<
arigato >
>>> id(f)
10:58
<
arigato >
why is the output missing whenever I try to use `f` in an expression?
10:58
<
antocuni >
interesting
10:58
<
arigato >
(I'm starting to have a clue just now)
10:58
<
arigato >
(took a while)
10:59
<
antocuni >
fwiw, 3.8 behaves the same
11:00
<
antocuni >
it's even more obscure than that
11:00
<
antocuni >
>>> x = repr(f)
11:01
<
antocuni >
and type(x) is silent as well
11:01
<
arigato >
I know why, but I'm letting you be confused for a moment :-)
11:02
<
antocuni >
I give up :)
11:02
<
arigato >
try x = 5; x = repr(f); x
11:03
<
antocuni >
so, any expression involving "f" is aborted and silently ignored?
11:03
<
arigato >
then try 'f' in globals()...
11:03
<
arigato >
there is no variable 'f'
11:03
<
fijal >
it probably goes to recursion somehow?
11:04
<
arigato >
no, os.fdopen(2) destroys somehow the stderr file descriptor, and
*then* it raises an exception
11:04
<
fijal >
works on 3.7 too
11:04
<
arigato >
so there is no 'f', and id(f) gives a NameError
11:04
<
antocuni >
0/0 is also silent
11:04
<
fijal >
>>> f = os.fdopen(2, 'wb', 0)
11:04
<
fijal >
<_io.FileIO name=2 mode='wb' closefd=True>
11:05
<
arigato >
ah, binary-versus-unicode fun
11:05
<
antocuni >
it's worth reporting a bug which will generate an endless discussion and will be ultimately ignored
11:06
<
arigato >
how do I open a file connected to fd 2 with a method write() accepting strings?
11:07
<
antocuni >
you open an fd accepting bytes and wrap it using some io.* nonsense?
11:07
<
fijal >
may I complain python has departed from "simple language" far away?
11:07
<
arigato >
f = os.fdopen(2, 'w', 0, encoding="latin1")
11:07
<
antocuni >
which I think it's what happens under the hood anyway when you open a file using 'w'
11:07
<
arigato >
...fails in the same way as the original strangeness
11:08
<
arigato >
ah, so it looks like something is crashing when doing the wrapping, or something
11:08
<
arigato >
if I try with fd=1 instead of 2, my fd 2 remains valid and I see the error
11:09
<
arigato >
ValueError: can't have unbuffered text I/O
11:09
<
fijal >
lol that's a bad error
11:09
<
fijal >
but also why not?
11:10
<
antocuni >
yes I can imagine why you can't have unbuffered text input, but I can't understand why you can't have unbuffered output
11:10
* antocuni
--> lunch
13:23
otisolsen70 has joined #pypy
13:26
swills has quit [Quit: swills]
13:59
otisolsen70 has quit [Quit: Leaving]
13:59
otisolsen70 has joined #pypy
14:48
jcea has joined #pypy
17:25
ronan has joined #pypy
17:42
ronan has quit [Ping timeout: 272 seconds]
18:07
ronan has joined #pypy
18:12
ronan has quit [Ping timeout: 272 seconds]
19:36
ronan has joined #pypy
20:09
ronan has quit [Ping timeout: 268 seconds]
20:29
commandoline has quit [Ping timeout: 265 seconds]
20:40
commandoline has joined #pypy
21:01
jacob22_ has quit [Read error: Connection reset by peer]
21:05
jacob22_ has joined #pypy
22:17
otisolsen70 has quit [Quit: Leaving]
23:31
ronan has joined #pypy