cfbolz changed the topic of #pypy to: #pypy PyPy, the flexible snake https://pypy.org | IRC logs: https://quodlibet.duckdns.org/irc/pypy/latest.log.html#irc-end and https://libera.irclog.whitequark.org/pypy | so many corner cases, so little time
kor1 has joined #pypy
kor1 has quit [Quit: kor1]
kor1 has joined #pypy
kor1 has quit [Ping timeout: 272 seconds]
slav0nic has joined #pypy
slav0nic has quit [Ping timeout: 260 seconds]
slav0nic has joined #pypy
otisolsen70 has joined #pypy
jacob22 has quit [Ping timeout: 260 seconds]
otisolsen70 has quit [Remote host closed the connection]
otisolsen70 has joined #pypy
otisolsen70_ has joined #pypy
otisolsen70 has quit [Ping timeout: 272 seconds]
otisolsen70_ has quit [Remote host closed the connection]
mjacob has quit [Read error: Connection reset by peer]
mjacob has joined #pypy
Dejan has quit [Quit: Leaving]
<cfbolz> mattip: thanks for pointing me at unparse problems
<cfbolz> it's actually a real f-string bug
otisolsen70 has joined #pypy
otisolsen70 has quit [Quit: Leaving]
slav0nic has quit [Remote host closed the connection]
slav0nic has joined #pypy
<mattip> cfbolz: nice
lritter has joined #pypy
otisolsen70 has joined #pypy
slav0nic has quit [Ping timeout: 260 seconds]
slav0nic has joined #pypy
jacob22 has joined #pypy
greedom has joined #pypy
<exarkun> Anyone care to opine on where I screwed up this cffi? https://gist.github.com/exarkun/1e413822a925f5f366e3a8f8e5345bee
<exarkun> The inet_ntop call fails because "ValueError: invalid length of packed IP address string"
<exarkun> Hm. I guess one wrong thing is that "sizeof struct in_addr" is not the same as the size of an AF_INET address because ... padding or whatever.
greedom has quit [Remote host closed the connection]
greedom has joined #pypy
<tumbleweed> yeah, it's defined as a struct of an uint32_t
<tumbleweed> presumably the issue is the "unsigned long" union member
<exarkun> so if I fix it to just use 4 and 16 for INET and INET6 respectively, INET6 addresses seem to come out right but INET addresses are all 0
<exarkun> I see the right bytes nearby, seems like maybe the in_addr struct layout is wrong
<exarkun> which I guess is what I risk by using the cdef interface?
<exarkun> addressof(sockaddr_in, "sin_addr") is sockaddr_in + 8
<tumbleweed> yeah, you need the cdef to match the system headers
<exarkun> but there are only 2 `unsigned short` fields in front of sin_addr...?
<tumbleweed> and sa_family_t
<exarkun> sin_family is one of the unsigned shorts, sin_port is the second. and then sin_addr is next ... for an offset of 4?
<tumbleweed> ah, I misread as 2 after that
<tumbleweed> so yeah, must be alignment
greedom has quit [Remote host closed the connection]
greedom has joined #pypy
<exarkun> eh yea if I hard-code the "correct" offsets I get the right data. bummer
<exarkun> I guess sockaddr_in is too complex for AI mode
<exarkun> ABI
greedom has quit [Remote host closed the connection]
otisolsen70 has quit [Quit: Leaving]
jacob22_ has joined #pypy
jacob22 has quit [Read error: Connection reset by peer]
Techcable has quit [Remote host closed the connection]
Techcable has joined #pypy
Techcable has quit [Remote host closed the connection]
Techcable has joined #pypy
slav0nic has quit [Ping timeout: 240 seconds]
lritter has quit [Quit: Leaving]
epony has joined #pypy