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

Plantage de la commande magique avec l'option --arrange sur un texte non ASCII (sous Windows) #62

Open
laowantong opened this issue Sep 29, 2022 · 0 comments

Comments

@laowantong
Copy link
Owner

%%mocodo --arrange
... numéro ...

lève l'erreur

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Input In [43], in <cell line: 1>()
----> 1 get_ipython().run_cell_magic('mocodo', '--arrange', '\nPOMPIER :\nROLE :\nGROUPE : sigle, numero de local, numéro de telephone\nTELEPHONE :\nSPECIALITE :\nDATE :\n    \nRESPONSABLE, 01 POMPIER, 11 GROUPE\nENSEIGNE, 11 GROUPE, 11 SPECIALITE \nATTRIBUER, XX POMPIER, XX ROLE\n')

File ~\anaconda3\lib\site-packages\IPython\core\interactiveshell.py:2347, in InteractiveShell.run_cell_magic(self, magic_name, line, cell)
   2345 with self.builtin_trap:
   2346     args = (magic_arg_s, cell)
-> 2347     result = fn(*args, **kwargs)
   2348 return result

File ~\anaconda3\lib\site-packages\mocodo\magic_command.py:122, in MocodoMagics.mocodo(line, cell)
    120 parser.add_argument("--flip", nargs="?")
    121 (_, options) = parser.parse_known_args(options)
--> 122 input_path.write_text(stdoutdata, encoding="utf8")
    123 options.extend(["--input", str(input_path), "--output_dir", str(output_dir)])
    124 if execute_command(options):

File ~\anaconda3\lib\pathlib.py:1283, in Path.write_text(self, data, encoding, errors)
   1279 """
   1280 Open the file in text mode, write to it, and close the file.
   1281 """
   1282 if not isinstance(data, str):
-> 1283     raise TypeError('data must be str, not %s' %
   1284                     data.__class__.__name__)
   1285 with self.open(mode='w', encoding=encoding, errors=errors) as f:
   1286     return f.write(data)

TypeError: data must be str, not bytes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant