home.social

#footgun — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #footgun, aggregated by home.social.

fetched live
  1. @MaryAustinBooks

    And appropriately enough, this photo also looks an awful lot like the map of the Straight of Hormuz we've all been looking at for the last three-and-a-half months.

    #Hormuz #SelfInflicted #FootGun

  2. @MaryAustinBooks

    And appropriately enough, this photo also looks an awful lot like the map of the Straight of Hormuz we've all been looking at for the last three-and-a-half months.

    #Hormuz #SelfInflicted #FootGun

  3. @MaryAustinBooks

    And appropriately enough, this photo also looks an awful lot like the map of the Straight of Hormuz we've all been looking at for the last three-and-a-half months.

    #Hormuz #SelfInflicted #FootGun

  4. @MaryAustinBooks

    And appropriately enough, this photo also looks an awful lot like the map of the Straight of Hormuz we've all been looking at for the last three-and-a-half months.

    #Hormuz #SelfInflicted #FootGun

  5. @MaryAustinBooks

    And appropriately enough, this photo also looks an awful lot like the map of the Straight of Hormuz we've all been looking at for the last three-and-a-half months.

    #Hormuz #SelfInflicted #FootGun

  6. Google is so fearful that another company will make its dominant position in search irrelevant that it decided to kill the golden goose itself and play on a new field where it no longer has a moat. Stupid MBA brain rot. (Yes, I read Clayton Christenson, too.) #FootGun #SpreadsheetJockeys

    RE: https://bsky.app/profile/did:plc:uoxulaetdigublaslop63mvv/post/3mmh3gzjwmk2o

  7. You can try this in a terminal:
    ```
    python -c "from unittest.mock import MagicMock; open(MagicMock(), 'w'); print(0)"
    ```

    #Python #MagicMock #footgun

  8. You can try this in a terminal:
    ```
    python -c "from unittest.mock import MagicMock; open(MagicMock(), 'w'); print(0)"
    ```

    #Python #MagicMock #footgun

  9. You can try this in a terminal:
    ```
    python -c "from unittest.mock import MagicMock; open(MagicMock(), 'w'); print(0)"
    ```

    #Python #MagicMock #footgun

  10. You can try this in a terminal:
    ```
    python -c "from unittest.mock import MagicMock; open(MagicMock(), 'w'); print(0)"
    ```

    #Python #MagicMock #footgun

  11. You can try this in a terminal:
    ```
    python -c "from unittest.mock import MagicMock; open(MagicMock(), 'w'); print(0)"
    ```

    #Python #MagicMock #footgun

  12. But why didn't the tests fail under pytest?

    pytest wraps, substitutes or otherwise messes with `sys.stdout` enough that fd 1 being dead doesn't cause prints to fail.

    The best part? The method that calls `shutil.copy` is called `_safe_copy`, but it doesn't check whether the values it receives are strings or `Path`s. So it happily passes a `MagicMock` along as the copy destination.

    So yeah, test your tests, and if you call something safe make it at least careful.

    #Python #MagicMock #footgun

  13. But why didn't the tests fail under pytest?

    pytest wraps, substitutes or otherwise messes with `sys.stdout` enough that fd 1 being dead doesn't cause prints to fail.

    The best part? The method that calls `shutil.copy` is called `_safe_copy`, but it doesn't check whether the values it receives are strings or `Path`s. So it happily passes a `MagicMock` along as the copy destination.

    So yeah, test your tests, and if you call something safe make it at least careful.

    #Python #MagicMock #footgun

  14. But why didn't the tests fail under pytest?

    pytest wraps, substitutes or otherwise messes with `sys.stdout` enough that fd 1 being dead doesn't cause prints to fail.

    The best part? The method that calls `shutil.copy` is called `_safe_copy`, but it doesn't check whether the values it receives are strings or `Path`s. So it happily passes a `MagicMock` along as the copy destination.

    So yeah, test your tests, and if you call something safe make it at least careful.

    #Python #MagicMock #footgun

  15. But why didn't the tests fail under pytest?

    pytest wraps, substitutes or otherwise messes with `sys.stdout` enough that fd 1 being dead doesn't cause prints to fail.

    The best part? The method that calls `shutil.copy` is called `_safe_copy`, but it doesn't check whether the values it receives are strings or `Path`s. So it happily passes a `MagicMock` along as the copy destination.

    So yeah, test your tests, and if you call something safe make it at least careful.

    #Python #MagicMock #footgun

  16. But why didn't the tests fail under pytest?

    pytest wraps, substitutes or otherwise messes with `sys.stdout` enough that fd 1 being dead doesn't cause prints to fail.

    The best part? The method that calls `shutil.copy` is called `_safe_copy`, but it doesn't check whether the values it receives are strings or `Path`s. So it happily passes a `MagicMock` along as the copy destination.

    So yeah, test your tests, and if you call something safe make it at least careful.

    #Python #MagicMock #footgun

  17. Tests started failing when run with unittest, had been running fine with pytest for a while.

    Tests error out with `OSError: [Errno 9] Bad file descriptor`.

    Turns out if you `shutil.copy` something onto a `MagicMock`, you kill `sys.stdout`:

    ```
    from unittest.mock import MagicMock
    import shutil

    m = MagicMock()
    m.__fspath__.__index__() # → 1

    shutil.copy(filename, m)
    [errors omitted]

    print(1) # → OSError: [Errno 9] Bad file descriptor
    ```

    Much head scratching!

    #Python #MagicMock #footgun

  18. Tests started failing when run with unittest, had been running fine with pytest for a while.

    Tests error out with `OSError: [Errno 9] Bad file descriptor`.

    Turns out if you `shutil.copy` something onto a `MagicMock`, you kill `sys.stdout`:

    ```
    from unittest.mock import MagicMock
    import shutil

    m = MagicMock()
    m.__fspath__.__index__() # → 1

    shutil.copy(filename, m)
    [errors omitted]

    print(1) # → OSError: [Errno 9] Bad file descriptor
    ```

    Much head scratching!

    #Python #MagicMock #footgun

  19. Tests started failing when run with unittest, had been running fine with pytest for a while.

    Tests error out with `OSError: [Errno 9] Bad file descriptor`.

    Turns out if you `shutil.copy` something onto a `MagicMock`, you kill `sys.stdout`:

    ```
    from unittest.mock import MagicMock
    import shutil

    m = MagicMock()
    m.__fspath__.__index__() # → 1

    shutil.copy(filename, m)
    [errors omitted]

    print(1) # → OSError: [Errno 9] Bad file descriptor
    ```

    Much head scratching!

    #Python #MagicMock #footgun

  20. Tests started failing when run with unittest, had been running fine with pytest for a while.

    Tests error out with `OSError: [Errno 9] Bad file descriptor`.

    Turns out if you `shutil.copy` something onto a `MagicMock`, you kill `sys.stdout`:

    ```
    from unittest.mock import MagicMock
    import shutil

    m = MagicMock()
    m.__fspath__.__index__() # → 1

    shutil.copy(filename, m)
    [errors omitted]

    print(1) # → OSError: [Errno 9] Bad file descriptor
    ```

    Much head scratching!

    #Python #MagicMock #footgun

  21. Tests started failing when run with unittest, had been running fine with pytest for a while.

    Tests error out with `OSError: [Errno 9] Bad file descriptor`.

    Turns out if you `shutil.copy` something onto a `MagicMock`, you kill `sys.stdout`:

    ```
    from unittest.mock import MagicMock
    import shutil

    m = MagicMock()
    m.__fspath__.__index__() # → 1

    shutil.copy(filename, m)
    [errors omitted]

    print(1) # → OSError: [Errno 9] Bad file descriptor
    ```

    Much head scratching!

    #Python #MagicMock #footgun

  22. okay so: omemo sucks?

    https://github.com/dino/dino/issues/850

    this is basically the same story I've heard everywhere omemo is used: it's extremely hostile towards anyone who wants to back up their messages. forgetful? have multiple computers? fuck you I guess.

    I like XMPP overall but I'm going to be telling all my friends "oh yeah turn that off for any message you don't want to lose forever"

    #xmpp #omemo #wtf #footgun

  23. okay so: omemo sucks?

    https://github.com/dino/dino/issues/850

    this is basically the same story I've heard everywhere omemo is used: it's extremely hostile towards anyone who wants to back up their messages. forgetful? have multiple computers? fuck you I guess.

    I like XMPP overall but I'm going to be telling all my friends "oh yeah turn that off for any message you don't want to lose forever"

    #xmpp #omemo #wtf #footgun

  24. okay so: omemo sucks?

    https://github.com/dino/dino/issues/850

    this is basically the same story I've heard everywhere omemo is used: it's extremely hostile towards anyone who wants to back up their messages. forgetful? have multiple computers? fuck you I guess.

    I like XMPP overall but I'm going to be telling all my friends "oh yeah turn that off for any message you don't want to lose forever"

    #xmpp #omemo #wtf #footgun

  25. okay so: omemo sucks?

    https://github.com/dino/dino/issues/850

    this is basically the same story I've heard everywhere omemo is used: it's extremely hostile towards anyone who wants to back up their messages. forgetful? have multiple computers? fuck you I guess.

    I like XMPP overall but I'm going to be telling all my friends "oh yeah turn that off for any message you don't want to lose forever"

    #xmpp #omemo #wtf #footgun

  26. okay so: omemo sucks?

    https://github.com/dino/dino/issues/850

    this is basically the same story I've heard everywhere omemo is used: it's extremely hostile towards anyone who wants to back up their messages. forgetful? have multiple computers? fuck you I guess.

    I like XMPP overall but I'm going to be telling all my friends "oh yeah turn that off for any message you don't want to lose forever"

    #xmpp #omemo #wtf #footgun

  27. Python Path is great. Until it isn't.

    Don't try this at home.

    remotePath = Path("data", "stuff")
    pbexec("ssh", HOST, "rm", "-rf", remotePath / "/*")

    The result is disastrous, as it it is:

    ssh homeserver rm -rf /*

    Not run as root, the server's installed software was not accessible, but it proceeded to my home directory before I could stop it and made a mess of it. Luckily nothing terminally lost.

    It should have been remotePath / "*" or, even saner, just remotePath.

    #python #footgun

  28. Python Path is great. Until it isn't.

    Don't try this at home.

    remotePath = Path("data", "stuff")
    pbexec("ssh", HOST, "rm", "-rf", remotePath / "/*")

    The result is disastrous, as it it is:

    ssh homeserver rm -rf /*

    Not run as root, the server's installed software was not accessible, but it proceeded to my home directory before I could stop it and made a mess of it. Luckily nothing terminally lost.

    It should have been remotePath / "*" or, even saner, just remotePath.

    #python #footgun

  29. Python Path is great. Until it isn't.

    Don't try this at home.

    remotePath = Path("data", "stuff")
    pbexec("ssh", HOST, "rm", "-rf", remotePath / "/*")

    The result is disastrous, as it it is:

    ssh homeserver rm -rf /*

    Not run as root, the server's installed software was not accessible, but it proceeded to my home directory before I could stop it and made a mess of it. Luckily nothing terminally lost.

    It should have been remotePath / "*" or, even saner, just remotePath.

    #python #footgun

  30. Python Path is great. Until it isn't.

    Don't try this at home.

    remotePath = Path("data", "stuff")
    pbexec("ssh", HOST, "rm", "-rf", remotePath / "/*")

    The result is disastrous, as it it is:

    ssh homeserver rm -rf /*

    Not run as root, the server's installed software was not accessible, but it proceeded to my home directory before I could stop it and made a mess of it. Luckily nothing terminally lost.

    It should have been remotePath / "*" or, even saner, just remotePath.

    #python #footgun

  31. Python Path is great. Until it isn't.

    Don't try this at home.

    remotePath = Path("data", "stuff")
    pbexec("ssh", HOST, "rm", "-rf", remotePath / "/*")

    The result is disastrous, as it it is:

    ssh homeserver rm -rf /*

    Not run as root, the server's installed software was not accessible, but it proceeded to my home directory before I could stop it and made a mess of it. Luckily nothing terminally lost.

    It should have been remotePath / "*" or, even saner, just remotePath.

    #python #footgun

  32. Zig needs to add a hard copiler error for using spaces for indentation instead of tabs, because it is a #footgun to use a non-flexible indentation, and also for writing too many comments in one place because if you can't read the code to understand, you already have too many #footguns , and you are a bad programmer, and you have to stop programming, as we have stated in zig zen "Focus on code rather than style.
    ", this is not about style. #zig #ziglang #Zigtools #programming #codestyle

  33. Zig needs to add a hard copiler error for using spaces for indentation instead of tabs, because it is a #footgun to use a non-flexible indentation, and also for writing too many comments in one place because if you can't read the code to understand, you already have too many #footguns , and you are a bad programmer, and you have to stop programming, as we have stated in zig zen "Focus on code rather than style.
    ", this is not about style. #zig #ziglang #Zigtools #programming #codestyle

  34. Zig needs to add a hard copiler error for using spaces for indentation instead of tabs, because it is a #footgun to use a non-flexible indentation, and also for writing too many comments in one place because if you can't read the code to understand, you already have too many #footguns , and you are a bad programmer, and you have to stop programming, as we have stated in zig zen "Focus on code rather than style.
    ", this is not about style. #zig #ziglang #Zigtools #programming #codestyle

  35. Zig needs to add a hard copiler error for using spaces for indentation instead of tabs, because it is a #footgun to use a non-flexible indentation, and also for writing too many comments in one place because if you can't read the code to understand, you already have too many #footguns , and you are a bad programmer, and you have to stop programming, as we have stated in zig zen "Focus on code rather than style.
    ", this is not about style. #zig #ziglang #Zigtools #programming #codestyle

  36. I love variadic template arguments until ... .

  37. I love template in ++ but am constantly afraid of .

  38. Guess who's about to discover that #microprocessors (and other chips, of course) are in ... well, virtually everything these days?

    cnn.com/2025/08/06/tech/apple-

    100% tariff on imported chips will double manufacturers' costs for what is the most expensive component of many products. Cars have dozens-to-hundreds of MCUs in them now, and effectively none of them are made in the USA.

    Where's that Trump-pissing-into-a-fan meme when you need it...

    #tariff #moron #MangoMussolini #OrangeUtan #FootGun #trade #tech #CPU

  39. Guess who's about to discover that #microprocessors (and other chips, of course) are in ... well, virtually everything these days?

    cnn.com/2025/08/06/tech/apple-

    100% tariff on imported chips will double manufacturers' costs for what is the most expensive component of many products. Cars have dozens-to-hundreds of MCUs in them now, and effectively none of them are made in the USA.

    Where's that Trump-pissing-into-a-fan meme when you need it...

    #tariff #moron #MangoMussolini #OrangeUtan #FootGun #trade #tech #CPU

  40. Guess who's about to discover that #microprocessors (and other chips, of course) are in ... well, virtually everything these days?

    cnn.com/2025/08/06/tech/apple-

    100% tariff on imported chips will double manufacturers' costs for what is the most expensive component of many products. Cars have dozens-to-hundreds of MCUs in them now, and effectively none of them are made in the USA.

    Where's that Trump-pissing-into-a-fan meme when you need it...

    #tariff #moron #MangoMussolini #OrangeUtan #FootGun #trade #tech #CPU

  41. Guess who's about to discover that #microprocessors (and other chips, of course) are in ... well, virtually everything these days?

    cnn.com/2025/08/06/tech/apple-

    100% tariff on imported chips will double manufacturers' costs for what is the most expensive component of many products. Cars have dozens-to-hundreds of MCUs in them now, and effectively none of them are made in the USA.

    Where's that Trump-pissing-into-a-fan meme when you need it...

    #tariff #moron #MangoMussolini #OrangeUtan #FootGun #trade #tech #CPU

  42. Guess who's about to discover that #microprocessors (and other chips, of course) are in ... well, virtually everything these days?

    cnn.com/2025/08/06/tech/apple-

    100% tariff on imported chips will double manufacturers' costs for what is the most expensive component of many products. Cars have dozens-to-hundreds of MCUs in them now, and effectively none of them are made in the USA.

    Where's that Trump-pissing-into-a-fan meme when you need it...

    #tariff #moron #MangoMussolini #OrangeUtan #FootGun #trade #tech #CPU

  43. TIL that #golang interfaces have two different nil values (typed and untyped nil). This is a bit confusing, but I can see the value (jerf.org/iri/post/2957/ argues this and has details).

    But I do not understand the language designers chose to make the "contains a typed nil" case not equal to nil.

    This can make:

    if (x != nil) { x.Foo() }

    cause a segfault (inside Foo) because it gets called with a nil pointer (full code: go.dev/play/p/2SeoJj2Go_l)

    Anyone know the rationale behind this #footgun?

  44. TIL that interfaces have two different nil values (typed and untyped nil). This is a bit confusing, but I can see the value (jerf.org/iri/post/2957/ argues this and has details).

    But I do not understand the language designers chose to make the "contains a typed nil" case not equal to nil.

    This can make:

    if (x != nil) { x.Foo() }

    cause a segfault (inside Foo) because it gets called with a nil pointer (full code: go.dev/play/p/2SeoJj2Go_l)

    Anyone know the rationale behind this ?

  45. TIL that #golang interfaces have two different nil values (typed and untyped nil). This is a bit confusing, but I can see the value (jerf.org/iri/post/2957/ argues this and has details).

    But I do not understand the language designers chose to make the "contains a typed nil" case not equal to nil.

    This can make:

    if (x != nil) { x.Foo() }

    cause a segfault (inside Foo) because it gets called with a nil pointer (full code: go.dev/play/p/2SeoJj2Go_l)

    Anyone know the rationale behind this #footgun?

  46. TIL that #golang interfaces have two different nil values (typed and untyped nil). This is a bit confusing, but I can see the value (jerf.org/iri/post/2957/ argues this and has details).

    But I do not understand the language designers chose to make the "contains a typed nil" case not equal to nil.

    This can make:

    if (x != nil) { x.Foo() }

    cause a segfault (inside Foo) because it gets called with a nil pointer (full code: go.dev/play/p/2SeoJj2Go_l)

    Anyone know the rationale behind this #footgun?

  47. TIL that #golang interfaces have two different nil values (typed and untyped nil). This is a bit confusing, but I can see the value (jerf.org/iri/post/2957/ argues this and has details).

    But I do not understand the language designers chose to make the "contains a typed nil" case not equal to nil.

    This can make:

    if (x != nil) { x.Foo() }

    cause a segfault (inside Foo) because it gets called with a nil pointer (full code: go.dev/play/p/2SeoJj2Go_l)

    Anyone know the rationale behind this #footgun?

  48. And today, while peeling the #disaster #recovery onion, I found that I had a mild case of self-inflicted #footgun that went unnoticed for months because I didn’t read a certain bit of vendor documentation that I didn’t know about until today because of a link in another vendor’s documentation.

    The fix is not difficult. Many (two? three?) new stories are about to spawn as a result of this discovery.

    #hindsightis2020