Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Change in python behaviour

Aperta
#522 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
jupyter, python
Ambito
backend, devtools

Direzione di ricerca

Esamina ipykernel_launcher.py alla riga indicata, quindi confronta la gestione di sys.path con il comportamento di Python 3.7 descritto nella documentazione collegata. Esamina il pull request di spyder-kernels indicato per il contesto e individua un test esistente del launcher o del kernel da aggiornare; il lavoro è completato quando il comportamento previsto è documentato da un test di regressione superato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Since python 3.7, the sys.path behaviour changed:
https://docs.python.org/3/whatsnew/3.7.html#changes-in-python-behavior

When using the -m switch, the initial working directory is now added to sys.path, rather than an empty string (which dynamically denoted the current working directory at the time of each import). Any programs that are checking for the empty string, or otherwise relying on the previous behaviour, will need to be updated accordingly (e.g. by also checking for os.getcwd() or os.path.dirname(main.file), depending on why the code was checking for the empty string in the first place).

I don't know if ipykernel should be updated (see https://github.com/ipython/ipykernel/blob/9181966528c79d9f67e565e85d12439ec95a43bf/ipykernel_launcher.py#L12)

For reference: https://github.com/spyder-ide/spyder-kernels/pull/222

Lingua principale
Python
Stelle
734
Fork
411
Merge medio
1g 2h
PR unite (30g)
9

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ipython/ipykernel

Tutte le issue di ipython/ipykernel

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.