« first day (4952 days earlier)      last day (12 days later) » 

12:29 AM
@inspectorG4dget ...goes well with bacon
 
 
1 hour later…
1:31 AM
I have yet another dumb question- pytest is recognising my imported functions- but doesn't recognise any of the variables in those functions- what am I doing wrong? (aside from being smoothbrain)
 
 
1 hour later…
2:48 AM
Question: DId the class datetime become immutable between Python 3.6.9 and 3.12.3 ?
(I know that in python 2, it was mutable)
 
3:07 AM
(or maybe not)
 
 
1 hour later…
4:12 AM
@ABcDexter They should be immutable objects
 
 
1 hour later…
5:21 AM
@user24556897 What's the error message?
 
@Aran-Fey It just doesn't recognise any variables from the function? NameError: name 'csv' is not defined
I hate pytest with a passion and cannot get it to work
 
What's the code?
 
def test_data_import():
> assert csv.endswith(".csv") == True
I am not really getting anywhere as it isn't recognising any variables from my function
 
And where did you define the csv variable?
 
It is in the function I am importing into the test.py file
 
5:28 AM
Since when does python let you access variables that are defined inside of another function?
You didn't even call the function
 
@Aran-Fey I tried calling the function first but it still doesn't recognise the variable
 
Yeah, because that's how functions work
If you want to get data from a function, the function has to return it and you have to call the function
 
@Aran-Fey specifically for pytest though- how can I test anything without variables?
 
I really don't know what that means. Pytest isn't some fantasy land where python works completely different than usual. You can use variables in pytest just like you can use them everywhere else. You just have to understand what you're doing and write code that actually works
 
@Aran-Fey Extremely insightful, thankyou
 
5:51 AM
I find decorators confusing in places but to describe them as "being cute" with code. Someone is wrong on the internet
 
I don't really know how LinkedIn works, but it's for people who want to find a job, right? So, uh, that seems like an unwise thing to post there O.o
 
10% trying to get a job, 90% boasting about how smart and virtuous you are for likes
 
6:10 AM
@user24556897 mostly the only magic with pytest is fixtures defined in a conftest.py. Otherwise you have to import modules like you'd always do, and call functions and methods with inputs. Pytest is great and convenient so the issue is on your end.
@Aran-Fey it's work facebook
 
I don't really know how facebook works either ¯\_(ツ)_/¯
 
@AndrasDeak--СлаваУкраїні Thanks :) I am going to have to run through some fixtures tutorials so I understand it properly!
 
@user24556897 no, start with basic tests first
Until you can get csv to work don't look at more magical things
 
@AndrasDeak--СлаваУкраїні but... I want to see magical things...
 
It's not necessarily helped by the fact that csv is also the name of a built-in module
 
6:18 AM
I figured that's what they need
Right, it's a string
 
Yeah, there is no endswith() method on the module
 
so am I right in saying- I can't access the variables of my main file... so I can essentially create mock data using fixtures instead to test with?
 
File or function?
@user24556897 Again, with zero code nobody can help you
If all your work is hidden in a main() then yes, you don't test main(), you use smaller helper functions inside and test those with test data.
And you don't need fixtures, but they are often convenient and useful, especially if you need some cleanup.
 
@AndrasDeak--СлаваУкраїні What my original confusion was with, starting a test_project.py file but being able to access the variables in the main file? but I just have to set the variables in my test_project.py file-?
 
6:29 AM
You can access variables from other files by importing the files
That said, I'm not so sure if that makes sense to do in unit tests. Do you really need variables from another file for your tests?
 
@user24556897 you can access the exact same things as you could in non-pytest modules. That's all I can say and we've said it multiple times already. Go and incorporate this knowledge.
 
 
1 hour later…
7:37 AM
in django is the default lru_cache functools decorator based per request or are they kept between connections/requests?
 
7:51 AM
@paul23 I would also love to know this, I guess it should be easy to test
 
 
3 hours later…
10:55 AM
This is the worst code cleanup I've ever done. I'm now going through just dumping emails in, in place of comments. "Why did you just increase that figure by 83% and then inflate the other by 745%?" the user might ask. ¯\_(ツ)_/¯ - consult this bat-yam email that compelled me to
Oh well, it's only three dictionaries layering on the fudge factors. It amazes me how companies like this function. The calculations are in the hundreds of million pounds per year and they just want to see numbers. I informally resigned this morning so I'll just make the docs "look what you made me do. Good luck understanding this"
 
11:15 AM
@roganjosh It's hard not to internalize stress from dealing with crappy codebases perpetrated by people who have long departed.
 
I wrote all of it, and I am totally ashamed of it
I'm just going on holiday tomorrow so have to hand this code over for a couple of weeks and it's an embarrassment in how many numbers are being fudged. It's not dodgy fudging like taxes or anything, it's an internal forecast but it does dictate company direction. I can't stand by any of the figures it produces and I don't know how else to convey it to other people that need to pick it up
 
Quoting the emails sounds like a good way to handle it. Much better than not explaining it at all, or making something up, or saying "X person told me to"
Also, being ashamed of your codebase is normal. Everyone is ashamed of your codebase :P *ducks*
 
@Aran-Fey I thought I'd come a long way since the code for my portfolio (that I never update) but instead it's gone backwards :P
I know I'm the fall-guy here, though, with a project that is totally impossible. I'd rather get out before I take the full fury right from the top; I gave my boss fair warning that I'm quitting after my holiday so he can plan around it since I'm literally the only person building this monstrosity
 
11:31 AM
What would be the best way to have a reproducible environment So that if I want to share my code people can clone the repository instal all the dependencies and run it?
From what I see conda is quite common But I doubt it will handle dependencies installed with PIP?
 
If you learn how to setup a well configured pyproject.toml then your repo should be reproducible. Setting up and using virtualenvs, using tox/nox/make to run your CI stuff, etc.
 
@MahNeh Depending on exactly how reproducible it needs to be, you can basically choose between a regular pyproject.toml, a requirements lock file, and docker
 
what about conda env create -f environment.yaml ?
But I don't know it can be made so that it contains PIP dependencies
 
I have no clue about conda, sorry
 
@MahNeh If you can't pull in pip dependencies then you should use pyproject.toml to make a setuptools package.
 
11:34 AM
Do you mean that you don't know?
I'm not trying to make a publish a package but just a Github repository
It only needs to be reproducible
 
Yes, but that can still have pyproject.toml
 
(For which I mean someone runs the programme against the same result)
 
@MahNeh You don't need to deploy the setuptools package.
 
@MahNeh we get it. Please take note of the advice you've already been given
 
@MahNeh python -m virtualenv venv && venv/bin/python -m pip install . (using a setuptools package)
 
11:37 AM
OK but I was just wondering whether any of you has used conda for the purpose just because it seems a pretty neat software
 
I was glad to see the back of conda, but it's no different than what you've been told already
 
There's a reason that mamba exists - because conda sucks in terms of speed
 
But pip in conda is a bit fragile, unsupported officially
The main benefit of conda is that it ships python and system packages as well. Otherwise I loathe it.
 
I always wonder why python is such a mess And it has been my barrier to start working with it for a long time
:-(
 
11:40 AM
Then please choose something else
 
But I need it now
 
Nah, typescript is great
 
No because I need to work with other people and they use python
So I guess that by pyproject.toml can record packages installed both with Conda and with pip?
 
?
Conda should still resolve dependencies from pyproject.toml?
 
11:45 AM
I'm just trying to understand whether this file will have keyss for conda and for pip installed packages ?
 
related answer which moves the requirements out of pyproject.toml into the old requirements.txt
 
I was reading the specs for the file here packaging.python.org/en/latest/guides/writing-pyproject-toml
I was wondering whether the requirements.txt would mix up packages installed with conda or with pip, but that seems to be quite a well spread Way to record the exact versions aand packages used in the project
 
@roganjosh they are looking for conda env files
 
Does PIP are the dependences automatically to the py project file? can't get how this is added
 
@MahNeh No. You manually add the requirements. If you wanted automated requirements you need a pip.lock file.
 
11:52 AM
Is poetry used for this purpose?
 
@Peilonrayz that's not standard pip, is it?
There's no point throwing around random suggestions as long as nobody knows what @MahNeh needs, including themselves
 
@AndrasDeak--СлаваУкраїні Can't fully remember. I think you can manually make and import from pip.lock files with pip -- just the commends are not native. However I don't use pip.lock files, the only time I did was with pipenv or something which I think is now deprecated.
 
Packaging is indeed a diverse mess, there are many options
 
What do you mean mate I think I was quite clear. I want to write some simple python projects that will be hosted on Github and I want people to be able to run and execute this programme, with the exact same dependencies that I did / I tested.
 
So you need docker
 
11:57 AM
Maybe, but a previous step is that I need a way to store all the dependencies (with exact versions) automatically
 
pip freeze can do that
 
Okay I guess I'm starting to see how to do it
thanks @Aran-Fey
And I think I would need an environment so that the user doesn't have trouble with own -installed dependencies. Is pyenv reasonably good option for this?
 
To be clear, I think there's approximately a 99% chance you don't actually need this. But if it is to be believed that you were "quite clear" and you need "the exact same dependencies", this is the correct answer
 
Well if that's 99% chance I don't need it then maybe don't help lol
 
What, so you weren't quite clear after all?
 
12:01 PM
@MahNeh maybe go away and come back when you're ready to do something to be helped
 
wtf...
 
You're not the one doing us a favour
You seem to like conda. So go read conda's docs to see if it works for your use case.
 
i didn't know you can block users
bye mate
 
You blocked me without a reason and then added me back, that's quite disrespectful. I may be quite dumb but I'm trying to learn, and you can just ignore my messages (like I do yours.)
 
12:07 PM
@MahNeh I kicked you to give emphasis to my request for you to pull your own weight.
Apr 28 at 11:19, by Andras Deak -- Слава Україні
@MahNeh heads-up: I refuse to let anyone else here waste their time by spoon-feeding you things you know where to read about.
Conda can do what you want. Go learn about it.
 
One of the first responses you got was "it depends on how reproducible you need it to be". Since then we've ruled out a pyproject.toml because you said you need exact dependencies, but other than that we haven't really gotten closer to figuring out your needs
 
OKI like and accept that kind of criticism
 
@AndrasDeak--СлаваУкраїні Mah Neh seems to have looked through the suggestions to see if the options provided apply to the situation. Hence why we said pyproject.toml is not correct but pip.lock probably is (given you can install from requirements files with conda). Mah Neh probably needs to do a little more research, but as one of the primary advice givers I'm not sure I agree with your perspective.
 
I need to also consider Mah Neh's history and attitude. Early correction goes a long way.
They are in the mindset that we need to convince them that python is good for them and cater to their underspecified whims.
 
Eh, I wouldn't go that far
 
12:15 PM
@AndrasDeak--СлаваУкраїні I will agree Mah Neh has an attitude problem.
 
I'm OK with a user being confused and ignorant, or they can be lacking any kind of humility, but both at the same time is unhealthy
 
from what I see in some videos pyproject can store exact versions, and be installed with pip install -e .
but i guess the software can't be automatically added to the dependencies upon installation
 
I think this is a bit of an unusual situation, where doing research actually just slows things down. That's how you start going on tangents about conda and pyenv and poetry. There are simply too many tools available in the python ecosystem
 
26 mins ago, by Andras Deak -- Слава Україні
There's no point throwing around random suggestions as long as nobody knows what @MahNeh needs, including themselves
Until they start being specific we're all throwing spaghetti at the wall
 
@MahNeh pip install -e . is building a setuptools package and is using either (the old) setup.py or the new pyproject.toml. You can hack both to read from a pip.lock automatically, but I wouldn't suggest doing so.
 
12:23 PM
@Aran-Fey That is usually how research works :D
 
@AndrasDeak--СлаваУкраїні Yes, but it's hard to be specific if you don't know what you need to be specific about. For that you need to already understand the shortcomings of requirements lock files and other solutions
 
@MahNeh I feel like you stepped into a classic problem, where you have been consuming software and everything including the packaging side has just worked(tm) and you expected it to be that way behind the curtains. But there is a huge variety in options and it's impossible to find something which satisfies all the needs of all the people. So yeah Andras advice is valid, figure out which peoples requirements you want to satisfy and then find build tools which can do that.
 
@Aran-Fey We don't know if they need to ship python, if they need to support multiple OSes, basic stuff like that. Their premise.
 
If you don't know your target audience yet, you can also just satisfy your needs for a built tool and see how far that gets you
 
@MahNeh While you can put exact versions in your pyproject.toml, there is no convenient way to update them. If you need exact versions, it's better to use some form of requirements lock file, like poetry.lock or a poor man's requirements.txt
@AndrasDeak--СлаваУкраїні True, but I honestly can't blame them for not including that information. I'm pretty sure I wouldn't have included it either, if I was the one asking such a question
 
12:34 PM
Honestly, git embedded in Azure makes me want to put my first through the screen. I have no idea who thought this was a good idea to wrap git
I can find the option to fork the repo before I can find how to merge two branches. Time to go outside to cool down
 
@roganjosh but how can you extract value of your customers if you don't wrap it? <sarcasm off>
 
@Hakaishin didn't you read my earlier messages? I just have to change a couple of fudge factors and our forecast is great
 
1:02 PM
@roganjosh def forceast(): return "Everything is fine", profit_is_over_9000 (:
@roganjosh good luck with finding a new place :) No sarcasm intended, just read your messages above
 
1:12 PM
Thanks. It'll be reet :) It's a new kind of low when you're considering how best to make an interface for people to specify an arbitrary number of fudge factor dictionaries :P
 
morning cabbages folks!
 
2:17 PM
morning
 
2:42 PM
Is it weird to use http for inter process communication on the same machine?
 
2:59 PM
actually this one was quite interesting to me, there may be downsides but stackoverflow.com/questions/18640305/…
conda-env can export both conda-installed and pip-installed packages
must be similar to pip freeze in the end I guess
 
3 hours ago, by Andras Deak -- Слава Україні
@MahNeh yes
But I'm glad you're doing your work
You'll want to keep track of your actual primary dependencies, and separately export fully pinned environment files for each OS.
conda-lock seems fun but it doesn't fit my use case so I never tried it.
 
3:29 PM
@Hakaishin no, why should it be?
 
@Hakaishin it /does/ add a communication layer which is inefficient (think about de/serializing data for IPC). But if you're building for a more distributed deployment architecture, I don't see anything fundamentally wrong with the approach. Notice that I didn't say "weird" anywhere
 
it's uncommon to go through setting up a http server though
normally you'd just use udp or raw sockets
as you also don't need to abstract things away to make sure messages are always delivered.
 
Why would you use UDP for localhost?
 
flask/fastAPI abstracts away the need to do that
 
Actually, looking further, I don't think I know enough to make comments on UDP
 
3:41 PM
@roganjosh Yeah udp is a no starter
Thanks guys, I will keep using http. I've used to until now and it has worked great. It just feels a bit inefficient, but I guess that's the premature optimization demon trying to haunt me :)
 
3:59 PM
do you have preferred cloud platform for ML when colab can't cope with it anymore
 
user22676652
Sorry for the flood, there is the pastebin: pastebin.com/jxBMg9jy
 
user22676652
I am using the code above ^ to fix an issue with my bot printing 2:282 of the Quran, but even printing the text to be smaller, it still gives me this traceback: pastebin.com/dqtaexiz
 
Must be 1024 or fewer in length suggests that the message you are attempting to post is too long. It looks like you've already tried to fix this with the use of put_periods. I'd recommend therefore, attempting to post your message without all the other embedding stuff (I'm referring to the set_author, set_image, etc that you currently have). If removing those works, that's a pretty clear indicator that the maximum message length includes all that other stuff
Room owners: I think I just found a (new to me) bug in chat: a message that's too long will still come through if I have a SHIFT-ENTER somewhere within it. Is this expected/intended behavior? Does a bugreport already exist? Should I make one? Am I just wayyy late to the party?
 
user22676652
@inspectorG4dget I used a character counter for the links and it counts as 153 characters
 
@zoomingspeed comment out all that stuff anyways and see if it works. At the very least, that's new information
 
user22676652
4:55 PM
@inspectorG4dget it is a bug, not the other characters I think. I set only_display_some_char = translation[:1] and even then it still gives the traceback
 
@zoomingspeed if you're sure it's a bug, it might be a good idea to file a bugreport
 
user22676652
I'll try out some other things before reporting it as a bug.
 
user22676652
@inspectorG4dget apparently, it is grabbing all parts of the string in translation instead of only a few, then adding the periods??
 
user22676652
import quranpy

translation = quranpy.show_verses(
    ayah="2:282",
    edition=quranpy.Editions.sahih_international
)

display_only_few_char = translation[:400]
periods = f"{display_only_few_char}.."
print(periods)
 
@inspectorG4dget This has always existed
 
5:07 PM
@inspectorG4dget one of many known quirks
chat is 100% unmaintained
 
user22676652
Does anyone else know what is the solution to my problem or how I should approach fixing it?
 
@zoomingspeed I'd check if you encode() your string it becomes longer than 1024 bytes
 
For a start, following the rules and not posting a huge block of unformatted code then just apologising after the fact, when you know you broke the rules
 
user22676652
Rogan I DID format it, but for some reason it did not format properly.
 
5:11 PM
hint: a message is either code OR text, not both
 
Not for "some reason" - you didn't follow the formatting guide
 
user22676652
Ok, that is my mistake.
 
user22676652
Won't happen again.
 
5:12 PM
But I'm sorry, I'm not going to allow you to post things against the rules and then say "Oops, sorry" when it's near-impossible to accidentally do that. You've also rubbed other members up the wrong way recently so please stick to the rules
 
user22676652
Ok
 
user22676652
@AndrasDeak--СлаваУкраїні it counts the length of the string and if it is over 1024, then it gives me back the error.
 
user22676652
I tried shortening it using translation[:1] to get only the first letter, but instead of shortening it the entire verse pops up then adds the periods
 
@zoomingspeed if you mean your last snippet: that's what your print does...
Not sure what that's meant to achieve
 
user22676652
I used this post for help: stackoverflow.com/questions/11714859/…
 
5:16 PM
Are you sure you're even altering the correct branch of the if statement? Is check_string greater than 990 or not?
(This is one of the reasons why it's important to write DRY code)
 
user22676652
@Aran-Fey that is what the if statement is put there for. Is it not doing it or did I write something wrong?
 
I don't know. But the fact that you have the same code twice worries me.
There's potential for you to do something wrong because of that
 
@zoomingspeed translation is a list of size 1
['O you who have believed, <truncated by peilonrayz>']..
 
The only thing the if statement should do is shorten the text. Nothing else
 
user22676652
@Peilonrayz yeah but it does not do anything.
 
user22676652
5:26 PM
Is it because that translation wasn't a string?
 
user22676652
I tried using len(translation) and it only gave me the number one, but then I converted it to a string and it showed me 1338.
 
Do you understand why?
 
I don't have a good feeling about how this ends
 
user22676652
@Aran-Fey because translation was not a string
 
So problem solved?
 
user22676652
5:35 PM
I fixed that part but now I am getting an error saying:
 
user22676652
Traceback (most recent call last):
  File "C:\Users\hhous\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\discord\commands\core.py", line 124, in wrapped
    ret = await coro(arg)
          ^^^^^^^^^^^^^^^
  File "C:\Users\hhous\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\discord\commands\core.py", line 982, in _invoke
    await self.callback(ctx, **kwargs)
 
... come on
 
user22676652
 
string = f"{translation}"
check_string = len(string)
string_check = int(check_string)
i'm curious... what was your train of thought when 1) writing this and 2) picking those names?
 
Yeah, ok, I'm out. I don't have the energy for this
 
user22676652
5:39 PM
@ThiefMaster 1) Because the string is too long, discord does not let me print the longest verse's translation, so I'm trying to solve that. 2) I just choose the names at random because I do not know what to name them
 
yes, but len() gives you an integer back, no need to cast it to int again
 
@zoomingspeed I've tried at a few points just tonight to give you pause to think. You're not making a good use of this room at all, not just through breaking rules but also showing very little understanding of what you're doing, let alone the advice you get given. I don't think this is the place for your questions
 
and if translation is a string, you can just do len(translation) directly
 
user22676652
translation isn't a string when you first call it
 
user22676652
@roganjosh I am banned off of Stack Overflow, I try to fix my questions but no one looks at them so I have to stick with this room to directly ask questions
 
5:41 PM
Ok, so being banned should tell you something. It doesn't mean you just bring your confusion here
 
user22676652
@roganjosh so what am I supposed to do when the moderators won't check anything I edit on my posts
 
Nothing. You had your chance and you blew it.
 
user22676652
@Aran-Fey I found out the mistake. Sorry for the trouble
 
And like the warnings you got up in the lead-up to that event, I'm strongly suggesting that you think about how you're interacting with the room. People can't just be helping you on every basic error you're hitting. There is stuff you're expected to debug yourself
 
user22676652
@roganjosh I have asked people to help me code this bot and they have refused, I have been working on it for around a year and people just don't want to help. I do not know what I am supposed to do.
 
5:52 PM
I don't know what part of what I'm saying isn't getting through to you. Nobody has an obligation to help you. This chat is not a dumping ground for questions you can't get answered elsewhere. We are not a resource of last resort.
Actually, "We are not a resource of last resort" probably isn't true since I do ask questions but only after trying to figure it out myself. Not just because I got banned from somewhere else I was asking.
 
user22676652
That is exactly what I have been doing.
 
No you haven't
 
user22676652
I have tried a million solutions before this and I have been working on this for the past 2-3 hours.
 
No you haven't
 
user22676652
How do you know do you have a camera on my room?
 
5:55 PM
@zoomingspeed this wasn't originally aimed at you but it applies:
Jan 12 at 21:22, by Andras Deak -- Слава Україні
But you must start with learning the basics. Find a good basic tutorial and read it first. Not a "how to write a discord bot" tutorial. A "learn Python" tutorial. You seem to have been asking for help here for 4 hours straight (on and off probably). That's a lot of time and a lot of messages for someone in your situation. Patience is a non-renewable resource so I strongly suggest that you try to limit the amount of help you're asking for here, because people will grow tired of this fast.
 
You immediately lurched from the first error to this. We can see it in the timestamps
 
Ah, no, that was aimed at you. Great.
 
user22676652
I have been awake since 10-11 in the morning working on this before going in the chat.
 
@zoomingspeed what you are seeing now is the "non-renewable resource" running out
 
user22676652
Sorry that I am not a computer scientist with three PHD's to understand everything in Python
 
5:58 PM
@zoomingspeed I don't know your time zone but it's important to take breaks, let your brain recover
 
user22676652
I have been unmotivated to work on this bot because no one wants to help me and every time I come in this room it ends in an argument because clearly since I don't know everything in the world and I am not God I am not accepted in this chat
 
Tired coding is unproductive, you end up debugging dumb problems for an hour
@zoomingspeed please stop moping.
Jan 12 at 21:22, by Andras Deak -- Слава Україні
@zoomingspeed it's easy to feel overwhelmed when you're still learning and facing a difficult challenge. And frankly you're way in over your head with your current project. You need classes and async and a whole framework for writing a discord bot, which is a lot of levels above "learn the basics of Python" which you often seem to be struggling with. At the same time the best way to learn is to try to build something you have a passion for. So I sympathize with your situation.
 
user22676652
I am not overwhelmed over not knowing how to do it (unless it is a serious problem with my bot that I can't usually solve)
 
user22676652
I am overwhelmed at the fact that every time I have came in here it has resulted in an argument
 
user22676652
Because asking for help with two errors is the end of the world
 
6:01 PM
This is ridiculous
 
user22676652
So matter of fact I will just delete my Stack Overflow account because this chat has been no help at all besides the people that have actually tried to help me instead of playing the 10 questions game or being completely rude and telling me I am a problem
 
@zoomingspeed I'm sorry, and goodbye
 
I sympathize with you a little bit because I know it's hard to be a beginner. But the way you completely ignore our feedback and instead make up stupid strawmen like "I am not God" is ridiculous and unacceptable. There will be no more help from me going forward.
 
And let's leave it at that
 
@Aran-Fey please don't. I know what you're feeling but let's not...
 
6:06 PM
@inspectorG4dget I remember once doing that before I knew about the rule, but never thought of it as a bug, interesting :o
@Hakaishin if you're using localhost in this case, it's not weird (I did that myself before since using socket can be a pain)
 
user22676652
@Aran-Fey no, you don't, because the last time I asked you for help and I did not know what I needed to do, because you are in love with the questions game, you think "oh this guy has no idea what he is doing" so you decide that you won't help me which is completely rude
 
user22676652
every other person that has helped me has told me what to do directly and straight up
 
user22676652
I looked back at the code and learned that I have to put the try in the for loop for it to work when they told me, since it will ignore every guild if I put the for loop in the try
 
This is nonsensical at this point and I will start kicking people
You said you were deleting your account @zoomingspeed. I don't think you need to do that but it might be worth taking a break from the room
@zoomingspeed please stop
@zoomingspeed no. You have had input from multiple users and you have said some things that aren't particularly polite about us, too. The matter was dropped. There really is no upside to coming back and arguing this. If you don't like the chat room regulars (who are held to account by Room Owners too) then you just need to find somewhere else to ask your questions. Nobody is forcing you to keep coming back to the apparent abuse you get.
1 message moved to MetaPython
 
One of these days I ought to buy you two a drink
 
One without arsenic, I hope :P
(going afk for a while)
 
Gah, I'll have to take my laptop to the pub with me. Nightmare. Lol, JK, I feel naked if I leave the house without it
 
7:02 PM
@AndrasDeak--СлаваУкраїні I'm afraid it'll have to have a bit of that, otherwise people might think I'm bribing you :P
 
;-)
 
@MahNeh Lets not repeat the behaviour you exerted on Code Review here.
 
@MahNeh that's you done.
 
OK, gone for a month. We're done for now.
Thanks, by the way :P
 
Zoe
@AndrasDeak--СлаваУкраїні No problem. I'll send you the bill :P
 
7:10 PM
@Aran-Fey is apparently buying the rounds!
 
I'm promised some slightly arsenic-laced beverage in the undetermined future... we can share
 
@roganjosh Are you sure you want a part of that though? :D
 
<pondering>If I let him kill the opposition... THE WORLD!</pondering>
 
7:28 PM
@AndrasDeak--СлаваУкраїні glad you see you back, even if it was for a bit :)
 
8:04 PM
How is it possible for shutil.which to give two different outputs with the same PATH? (It's not exactly the same PATH, but there's only an added directory and the executable isn't in there.) This is a super weird bug
 
8:17 PM
I think this is related: bugs.python.org/issue24505
 
8:27 PM
Hmm, I don't see an explanation for this in there. The NoDefaultCurrentDirectoryInExePath envvar could lead to different output, but in my case the exe isn't in the CWD
 
@Aran-Fey how about shell's which?
 
where gives the same output in both cases
 
that sounds awfully like windows :P
 
Yeah... my fling with linux only lasted a few days... again
 
> On Windows, the current directory is always prepended to the path whether or not you use the default or provide your own, which is the behavior the command shell uses when finding executables. Additionally, when finding the cmd in the path, the PATHEXT environment variable is checked. For example, if you call shutil.which("python"), which() will search PATHEXT to know that it should look for python.exe within the path directories. For example, on Windows:
I assume you've read the paragraph about windows
I was going to guess "something something registry"
 
8:33 PM
PATHEXT is also unchanged, sadly
 
How about cwd?
ah, it says where would do the same thing
To be clear, are we talking about two different systems?
Or the same system in two different states (e.g. production and testing)?
 
I'm not entirely sure if it's a problem with python/shutil.which. What I'm doing is running a python script via rye run, which tries to start npm as a subprocess. So it's rye run -> python script -> subprocess.run(['npm']). Running the script with py works, but running it with rye, it crashes because it can't find npm.
 
@AndrasDeak--СлаваУкраїні oops, quote from 3.8 which duckduckgo gave me. There's updated text in 3.12 but it seems to apply to the argument passed to which() so I assume it's the same in both cases.
hmm
 
I know for a fact that shutil.which gives different output in both cases, but it's not just shutil.which that is affected
 
I'd print stuff like cwd and os.environ but I have no specific advice otherwise, sorry
 
8:39 PM
I think at this point the universe is just inventing new nonsensical bugs simply because it can
 
it's a bit too complex to call it a single bug, some people might even call it an operating system after all
 
I'm not convinced it's operating :/
 
Ah, actually, I've had windows issues with subprocess before. I either needed 'npm.bat' or shell=True (actually it was conda, but possibly same difference).
and yes, I'd also expect that to be unsensitive to how the script is run, but you never know
and yes, according to the docs you only need shell=True if you need a shell built-in
The fact that I'm running stuff in cygwin might or might not matter here...
 
Oh shoot, I just realized I lied. When I said "it works" I meant "it prints the path you'd expect". Running npm through subprocess actually doesn't work
 
the good kind of "working even less"
 
8:59 PM
Welp, now it all makes sense. npm ships two files: A plain npm file which is a bash script, so it works in cygwin, and a npm.bat file, so it works in cmd/powershell. But no npm.exe so it doesn't work via subprocess, and apparently not via rust's subprocess library either :/
 
Are you sure bat doesn't work?
conda.bat works fine, give or take shell=True
 
I'll try in a minute. Updating my rye bug report atm
Actually, I should try that first. I'll include the workaround in the bug report if it works
.bat file alone doesn't cut it, needs shell=True :(
 
I can already see what's going to happen. rye will refuse to do anything because it's "not a bug", and npm will do the same
 
> On Windows with shell=True, the COMSPEC environment variable specifies the default shell. The only time you need to specify shell=True on Windows is when the command you wish to execute is built into the shell (e.g. dir or copy). You do not need shell=True to run a batch file or console-based executable.
lies, filthy lies
 
9:08 PM
...and a 3rd actor, who will also refuse to fix anything, enters the scene!
 
I'm not sure I ever tried outside cygwin, to be honest...
I probably did because I'm the only one using cygwin, including other developers and users :P
 

« first day (4952 days earlier)      last day (12 days later) »