Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exercice ShipDict : l'option -z (--gzip) de merger.py ne fonctionne pas #45

Closed
aollier opened this issue Dec 5, 2020 · 3 comments · Fixed by #47
Closed

Exercice ShipDict : l'option -z (--gzip) de merger.py ne fonctionne pas #45

aollier opened this issue Dec 5, 2020 · 3 comments · Fixed by #47

Comments

@aollier
Copy link
Contributor

aollier commented Dec 5, 2020

$ python3 merger.py --gzip json/*
Opening ALL_SHIPS.txt for listing ships
Opening ALL_SHIPS.kmz for ship ALL_SHIPS
Something went wrong, <class 'ValueError'>, Argument 'newline' not supported in binary mode
Traceback (most recent call last):
  File "merger.py", line 188, in main
    kml_filename = self.write_kml_output(ships, output_name)
  File "merger.py", line 126, in write_kml_output
    with gzip.open(kml_filename, 'w', newline="\n") if self.args.gzip \
  File "/usr/lib/python3.8/gzip.py", line 54, in open
    raise ValueError("Argument 'newline' not supported in binary mode")
ValueError: Argument 'newline' not supported in binary mode
$ python3 merger.py -z json/*
Opening ALL_SHIPS.txt for listing ships
Opening ALL_SHIPS.kmz for ship ALL_SHIPS
Something went wrong, <class 'ValueError'>, Argument 'newline' not supported in binary mode
Traceback (most recent call last):
  File "merger.py", line 188, in main
    kml_filename = self.write_kml_output(ships, output_name)
  File "merger.py", line 126, in write_kml_output
    with gzip.open(kml_filename, 'w', newline="\n") if self.args.gzip \
  File "/usr/lib/python3.8/gzip.py", line 54, in open
    raise ValueError("Argument 'newline' not supported in binary mode")
ValueError: Argument 'newline' not supported in binary mode
@parmentelat
Copy link
Contributor

sans regarder le code, ça ressemble à un paramètre qu'on passe au moment de forker gzip, et ça pourrait dater du passage de Python2 à Python3; rien de bien méchant à corriger, si un volontaire voulait s'en occuper :)

@aollier
Copy link
Contributor Author

aollier commented Dec 5, 2020

Je vais m'y coller. Je ne sais pas combien de temps ça va me prendre parce que je dois regarder dans le détail, trouver, corriger et tester.

@parmentelat
Copy link
Contributor

ce bug est là depuis plusieurs années sans que personne ne s'en soit plaint avant toi, il n'y aucune espèce d'urgence :)

aollier added a commit to aollier/course that referenced this issue Dec 12, 2020
@aollier aollier mentioned this issue Dec 12, 2020
aollier added a commit to aollier/course that referenced this issue Dec 22, 2020
aollier added a commit to aollier/course that referenced this issue Dec 24, 2020
aollier added a commit to aollier/course that referenced this issue Dec 24, 2020
aollier added a commit to aollier/course that referenced this issue Dec 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants